Skip to content

Commit 685c774

Browse files
committed
Capabilities section done
Moving on to tooling
1 parent 9c6f54e commit 685c774

File tree

139 files changed

+854567
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+854567
-122
lines changed
1.12 MB
Loading
235 KB
Loading
268 KB
Loading

src/components/persistence-coverage.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import data from '../data/coverage.json';
2+
import data from '../data/persistence/coverage.json';
33
44
const coverage = Object.values(data);
55
console.log(coverage);

src/content/docs/aws/capabilities/chaos-engineering/aws-fault-injection.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ This service allows you to conduct controlled experiments on your AWS infrastruc
1212
By using the Fault Injection Service, you can identify weaknesses, test recovery procedures, and ensure that your applications can withstand unexpected disruptions.
1313
This proactive approach to reliability engineering enables you to enhance system robustness, minimize downtime, and maintain a high level of service availability for your users.
1414

15-
{{< alert title="Note">}}
15+
:::note
1616
Fault Injection Service emulation is available as part of the LocalStack Enterprise plan.
1717
If you'd like to try it out, please [contact us](https://www.localstack.cloud/demo) to request access.
18-
{{< /alert >}}
18+
:::
1919

20-
{{< callout "tip" >}}
21-
For more information, please refer to the [FIS service docs]({{< ref "user-guide/aws/fis" >}}).
22-
{{< /callout >}}
20+
:::tip
21+
For more information, please refer to the [FIS service docs](/aws/services/fis).
22+
:::
2323

2424
Some of the most important concepts associated with a FIS experiment are:
2525

src/content/docs/aws/capabilities/chaos-engineering/chaos-api.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ You can use LocalStack Chaos API to cause API failures for any combination of th
1818
- Region
1919
- Operation
2020

21-
You can customise the HTTP error code and message that LocalStack responds with.
21+
You can customize the HTTP error code and message that LocalStack responds with.
2222
If required, you can make the failures occur probabilistically.
2323

2424
Furthermore, the Chaos API can also be configured to add a network latency for all calls.
2525

26-
{{< alert title="Note">}}
26+
:::note
2727
Chaos API is available as part of the LocalStack Enterprise plan.
2828
If you'd like to try it out, please [contact us](https://www.localstack.cloud/demo) to request access.
29-
{{< /alert >}}
29+
:::
3030

3131
## Prerequisites
3232

@@ -92,8 +92,8 @@ This endpoint allows the following operations:
9292

9393
To cause faults, make a POST request as follows:
9494

95-
{{< command >}}
96-
$ curl --location --request POST 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \
95+
```bash
96+
curl --location --request POST 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \
9797
--header 'Content-Type: application/json' \
9898
--data '
9999
[
@@ -109,48 +109,50 @@ $ curl --location --request POST 'http://localhost.localstack.cloud:4566/_locals
109109
"service": "lambda"
110110
}
111111
]'
112-
{{< /command >}}
112+
```
113113

114114
In this example, S3 is affected in `us-east-1` and `ap-south-1,` and Lambda is affected in all regions.
115115
All calls to these services in these regions will return a 503 Service Unavailable error.
116116

117117
To see this in action, try to create an S3 bucket in `us-east-1`:
118118

119-
{{< command >}}
120-
$ awslocal s3 mb s3://test-bucket --region us-east-1
121-
<disable-copy>
119+
```bash
120+
awslocal s3 mb s3://test-bucket --region us-east-1
121+
```
122+
123+
```bash
122124
make_bucket failed: s3://test-bucket An error occurred (ServiceUnavailableException) when calling the CreateBucket operation (reached max retries: 4): Service 's3' not accessible due to an outage
123-
</disable-copy>
124-
{{< /command >}}
125+
```
125126

126127
However, the same operation, when run in `eu-central-1` will work as expected.
127128

128-
{{< command >}}
129+
```bash
129130
$ awslocal s3 mb s3://test-bucket --region eu-central-1
130-
<disable-copy>
131+
```
132+
133+
```bash
131134
make_bucket: test-bucket
132-
</disable-copy>
133-
{{< /command >}}
135+
```
134136

135137
Faults can be disabled by setting an empty rule list in the configuration.
136138
The following request will clear the current configuration:
137139

138-
{{< command >}}
139-
$ curl --location --request POST 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \
140+
```bash
141+
curl --location --request POST 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \
140142
--header 'Content-Type: application/json' \
141143
--data '[]'
142-
{{< /command >}}
144+
```
143145

144146
To retrieve the current configuration, make the following GET call:
145147

146-
{{< command >}}
147-
$ curl --location --request GET 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults'
148-
{{</ command >}}
148+
```bash
149+
curl --location --request GET 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults'
150+
```
149151

150152
To add a new rule to the current configuration, make a PATCH call as follows:
151153

152-
{{< command >}}
153-
$ curl --location --request PATCH 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \
154+
```bash
155+
curl --location --request PATCH 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \
154156
--header 'Content-Type: application/json' \
155157
--data '
156158
[
@@ -164,18 +166,18 @@ $ curl --location --request PATCH 'http://localhost.localstack.cloud:4566/_local
164166
}
165167
}
166168
]'
167-
{{</ command >}}
169+
```
168170

169171
This new rule will cause probabilistic failures for Kinesis PutRecord operation.
170172
Here, the returned error is also customised to be HTTP 400 ProvisionedThroughputExceededException.
171173

172174
To remove a rule from the configuration, make a DELETE call as follows:
173175

174-
{{< command >}}
175-
$ curl --location --request DELETE 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \
176+
```bash
177+
curl --location --request DELETE 'http://localhost.localstack.cloud:4566/_localstack/chaos/faults' \
176178
--header 'Content-Type: application/json' \
177179
--data '[{"service": "lambda"}]'
178-
{{</ command >}}
180+
```
179181

180182
The rule to be removed must be exactly the same as in the existing configuration.
181183

src/content/docs/aws/capabilities/chaos-engineering/chaos-engineering-dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Chaos Engineering Dashboard in LocalStack offers streamlined testing for clo
1212

1313
The dashboard uses [LocalStack Chaos API]({{< ref "chaos-api" >}}) under the hood to offer a set of customizable templates that can be seamlessly integrated into any automation workflows.
1414

15-
{{< figure src="chaos-engineering-dashboard.png" width="900" >}}
15+
![chaos engineering dashboard](/images/aws/chaos-engineering-dashboard.png)
1616

1717
You can find this feature in the LocalStack Web Application by navigating to [**app.localstack.cloud/chaos-engineering**](https://app.localstack.cloud/chaos-engineering).
1818

src/content/docs/aws/capabilities/security-testing/custom-tls-certificates.md renamed to src/content/docs/aws/capabilities/security-testing/custom-tls-certificates.mdx

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar:
66
order: 5
77
---
88

9+
import { Tabs, TabItem } from '@astrojs/starlight/components';
10+
911
## Background
1012

1113
LocalStack sometimes performs on-demand fetching of resources from the public internet.
@@ -15,9 +17,9 @@ You may see errors in the logs relating to TLS such as "unable to get local issu
1517

1618
There are three options when running LocalStack:
1719

18-
1. [creating a custom Docker image]({{< ref "#creating-a-custom-docker-image" >}}),
19-
2. [using init hooks]({{< ref "#custom-ssl-certificates-with-init-hooks" >}}) or
20-
3. [when running in host mode]({{< ref "#custom-ssl-certificates-with-host-mode" >}}).
20+
1. [creating a custom Docker image](#creating-a-custom-docker-image),
21+
2. [using init hooks](#custom-ssl-certificates-with-init-hooks) or
22+
3. [when running in host mode](#custom-ssl-certificates-with-host-mode).
2123

2224
They all can be summarised as:
2325

@@ -28,11 +30,11 @@ They all can be summarised as:
2830

2931
## Creating a custom docker image
3032

31-
If you run LocalStack in a docker container (which includes using [the CLI]({{< ref "/getting-started#localstack-cli" >}}), [docker]({{< ref "/getting-started/#docker" >}}), [docker-compose]({{< ref "/getting-started/#docker-compose" >}}), or [helm]({{< ref "/getting-started/#helm" >}})), to include a custom TLS root certificate a new docker image should be created.
33+
If you run LocalStack in a docker container (which includes using [the CLI](/aws/getting-started/installation/#installing-localstack-cli), [docker](/aws/getting-started/installation/#docker), [docker-compose](/aws/getting-started/installation/#docker-compose), or [helm](/aws/getting-started/installation/#helm)), to include a custom TLS root certificate a new docker image should be created.
3234

3335
Create a `Dockerfile` containing the following commands:
3436

35-
```docker
37+
```yaml
3638
FROM localstack/localstack:latest
3739
# or if using the pro image:
3840
FROM localstack/localstack-pro:latest
@@ -46,34 +48,40 @@ ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
4648

4749
and build the image:
4850

49-
{{< command >}}
50-
$ docker build -t <image name> .
51-
{{< / command >}}
51+
```bash
52+
docker build -t <image name> .
53+
```
5254

53-
{{< callout "tip" >}}
55+
:::tip
5456
Certificate files must end in `.crt` to be included in the system certificate store.
5557
If your certificate file ends with `.pem`, you can rename it to end in `.crt`.
56-
{{< /callout >}}
58+
:::
5759

5860
### Starting LocalStack with the custom image
5961

6062
LocalStack now needs to be configured to use this custom image.
6163
The workflow is different depending on how you start localstack.
6264

63-
{{< tabpane lang="bash">}}
64-
{{< tab header="CLI" lang="bash" >}}
65+
<Tabs>
66+
<TabItem label="CLI">
67+
```bash
6568
IMAGE_NAME=<image name> localstack start
66-
{{< /tab >}}
67-
{{< tab header="Docker" lang="bash" >}}
69+
```
70+
</TabItem>
71+
<TabItem label="Docker">
72+
```bash
6873
docker run <docker arguments> <image name>
69-
{{< /tab >}}
70-
{{< tab header="docker-compose.yml" lang="yml" >}}
74+
```
75+
</TabItem>
76+
<TabItem label="docker-compose.yml">
77+
```yaml
7178
services:
7279
localstack:
7380
image: <image name>
7481
# the rest of your configuration
75-
{{< /tab >}}
76-
{{< / tabpane >}}
82+
```
83+
</TabItem>
84+
</Tabs>
7785

7886
## Custom TLS certificates with init hooks
7987

@@ -98,7 +106,7 @@ Then run LocalStack with the environment variables
98106
* `CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt`, and
99107
* `NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt`
100108

101-
and follow the instructions fn the [init hooks documentation]({{< ref "init-hooks" >}}) for configuring LocalStack to use the hook directory as a `boot` hook.
109+
and follow the instructions fn the [init hooks documentation](/aws/capabilities/config/initialization-hooks) for configuring LocalStack to use the hook directory as a `boot` hook.
102110

103111
## Custom TLS certificates with host mode
104112

@@ -107,21 +115,21 @@ and follow the instructions fn the [init hooks documentation]({{< ref "init-hook
107115
On linux the custom certificate should be added to your `ca-certificates` bundle.
108116
For example on Debian based systems (as root):
109117

110-
{{< command >}}
118+
```bash
111119
# cp <your custom certificate.crt> /usr/local/share/ca-certificates
112120

113121
# update-ca-certificates
114122

115-
{{< / command >}}
123+
```
116124

117125
Then run LocalStack with the environment variables `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, and `NODE_EXTRA_CA_CERTS``:
118126

119-
{{< command >}}
120-
$ NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt \
127+
```bash
128+
NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt \
121129
CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
122130
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
123131
localstack start --host
124-
{{< / command >}}
132+
```
125133

126134
### macOS
127135

@@ -130,14 +138,14 @@ See [this Apple support article](https://support.apple.com/en-gb/guide/keychain-
130138

131139
Then run LocalStack with the environment variables `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, and `NODE_EXTRA_CA_CERTS``:
132140

133-
{{< command >}}
134-
$ NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt \
141+
```bash
142+
NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt \
135143
CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
136144
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
137145
localstack start --host
138-
{{< / command >}}
146+
```
139147

140148
### Windows
141149

142150
Currently host mode does not work with Windows.
143-
If you are using WSL2 you should follow the [Linux]({{< ref "#linux" >}}) steps above.
151+
If you are using WSL2 you should follow the [Linux](#linux) steps above.

src/content/docs/aws/capabilities/security-testing/explainable-iam.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ This guide is designed for users new to Explainable IAM and assumes basic knowle
1717

1818
Start your LocalStack container with the `DEBUG=1` and `ENFORCE_IAM=1` environment variables set:
1919

20-
{{< command >}}
21-
$ DEBUG=1 ENFORCE_IAM=1 localstack start
22-
{{< /command >}}
20+
```bash
21+
DEBUG=1 ENFORCE_IAM=1 localstack start
22+
```
2323

2424
In this guide, we will create a policy for creating Lambda functions by only allowing the `lambda:CreateFunction` permission.
2525
However we have not included the `iam:PassRole` permission, and we will use the Policy Engine's log to point out adding the necessary permission.
@@ -44,9 +44,11 @@ Create a policy document named `policy_1.json` and add the following content:
4444

4545
You can now create a new user named `test-user`, and put the policy in place by executing the following commands:
4646

47-
{{< command >}}
48-
$ awslocal iam create-user --user-name test-user
49-
<disable-copy>
47+
```bash
48+
awslocal iam create-user --user-name test-user
49+
```
50+
51+
```bash
5052
{
5153
"User": {
5254
"Path": "/",
@@ -56,38 +58,41 @@ $ awslocal iam create-user --user-name test-user
5658
"CreateDate": "2022-07-05T16:08:25.741000+00:00"
5759
}
5860
}
59-
</disable-copy>
60-
$ awslocal iam put-user-policy --user-name test-user --policy-name policy1 --policy-document file://policy_1.json
61-
{{< /command >}}
61+
```
62+
63+
```bash
64+
awslocal iam put-user-policy --user-name test-user --policy-name policy1 --policy-document file://policy_1.json
65+
```
6266

6367
You can further create an access key for the user by executing the following command:
6468

65-
{{< command >}}
66-
$ awslocal iam create-access-key --user-name test-user
67-
{{< /command >}}
69+
```bash
70+
awslocal iam create-access-key --user-name test-user
71+
```
6872

6973
Export the access key and secret key as environment variables:
7074

71-
{{< command >}}
72-
$ export AWS_ACCESS_KEY_ID=...
73-
$ export AWS_SECRET_ACCESS_KEY=...
74-
{{< /command >}}
75+
```bash
76+
export AWS_ACCESS_KEY_ID=...
77+
export AWS_SECRET_ACCESS_KEY=...
78+
```
7579

7680
### Attempt to create a Lambda function
7781

7882
You can now attempt to create a Lambda function using the newly created user's credentials:
7983

80-
{{< command >}}
81-
$ awslocal lambda create-function \
84+
```bash
85+
awslocal lambda create-function \
8286
--function-name test-function \
8387
--role arn:aws:iam::000000000000:role/lambda-role \
8488
--runtime python3.8 \
8589
--handler handler.handler \
8690
--zip-file fileb://function.zip
87-
<disable-copy>
91+
```
92+
93+
```bash
8894
An error occurred (AccessDeniedException) when calling the CreateFunction operation: Access to the specified resource is denied
89-
</disable-copy>
90-
{{< / command >}}
95+
```
9196

9297
You can inspect the LocalStack logs, to observe the presence of five log entries directly related to the denied request:
9398

0 commit comments

Comments
 (0)