Skip to content

Commit 6a5326a

Browse files
committed
get all done
1 parent 75cd35c commit 6a5326a

File tree

12 files changed

+262
-242
lines changed

12 files changed

+262
-242
lines changed

src/content/docs/aws/services/ssm.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "Systems Manager (SSM)"
3-
linkTitle: "Systems Manager (SSM)"
43
description: Get started with Systems Manager (SSM) on LocalStack
54
tags: ["Free"]
65
persistence: supported
@@ -12,7 +11,7 @@ Systems Manager (SSM) is a management service provided by Amazon Web Services th
1211
SSM simplifies tasks related to system and application management, patching, configuration, and automation, allowing you to maintain the health and compliance of your environment.
1312

1413
LocalStack allows you to use the SSM APIs in your local environment to run operational tasks on the Dockerized instances.
15-
The supported APIs are available on our [API coverage page]({{< ref "coverage_ssm" >}}), which provides information on the extent of SSM's integration with LocalStack.
14+
The supported APIs are available on our [API coverage page](), which provides information on the extent of SSM's integration with LocalStack.
1615

1716
## Getting started
1817

@@ -27,20 +26,20 @@ To get started, pull the `ubuntu:focal` image from Docker Hub and tag it as `loc
2726
LocalStack uses a naming scheme to recognise and manage the containers and images associated with it.
2827
The container are named `localstack-ec2.<InstanceId>`, while images are tagged `localstack-ec2/<AmiName>:<AmiId>`.
2928

30-
{{< command >}}
31-
$ docker pull ubuntu:focal
32-
$ docker tag ubuntu:focal localstack-ec2/ubuntu-focal-docker-ami:ami-00a001
33-
{{< / command >}}
29+
```bash
30+
docker pull ubuntu:focal
31+
docker tag ubuntu:focal localstack-ec2/ubuntu-focal-docker-ami:ami-00a001
32+
```
3433

3534
LocalStack's Docker backend treats Docker images with the above naming scheme as AMIs.
3635
The AMI ID is the last part of the image tag, `ami-00a001` in this case.
3736
You can run an EC2 instance using the [`RunInstances`](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_RunInstances.html) API.
3837
Execute the following command to create an EC2 instance using the `ami-00a001` AMI.
3938

40-
{{< command >}}
41-
$ awslocal ec2 run-instances \
39+
```bash
40+
awslocal ec2 run-instances \
4241
--image-id ami-00a001 --count 1
43-
{{< / command >}}
42+
```
4443

4544
The following output would be retrieved:
4645

@@ -71,12 +70,12 @@ You can copy the `InstanceId` value and use it in the following commands.
7170
You can use the [`SendCommand`](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_SendCommand.html) API to send a command to the EC2 instance.
7271
The following command sends a `cat lsb-release` command in the `/etc` directory to the EC2 instance.
7372
74-
{{< command >}}
75-
$ awslocal ssm send-command --document-name "AWS-RunShellScript" \
73+
```bash
74+
awslocal ssm send-command --document-name "AWS-RunShellScript" \
7675
--document-version "1" \
7776
--instance-ids i-abf6920789a06dd84 \
7877
--parameters "commands='cat lsb-release',workingDirectory=/etc"
79-
{{< / command >}}
78+
```
8079
8180
The following output would be retrieved:
8281
@@ -101,11 +100,11 @@ You can copy the `CommandId` value and use it in the following commands.
101100
You can use the [`GetCommandInvocation`](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_GetCommandInvocation.html) API to retrieve the command output.
102101
The following command retrieves the output of the command sent in the previous step.
103102
104-
{{< command >}}
105-
$ awslocal ssm get-command-invocation \
103+
```bash
104+
awslocal ssm get-command-invocation \
106105
--command-id 23547a9b-6993-4967-9446-f96b9b5dac70 \
107106
--instance-id i-abf6920789a06dd84
108-
{{< / command >}}
107+
```
109108
110109
Change the `CommandId` and `InstanceId` values to the ones you received in the previous step.
111110
The following output would be retrieved:
@@ -127,7 +126,7 @@ The following output would be retrieved:
127126
The LocalStack Web Application provides a Resource Browser for managing SSM System Parameters.
128127
You can access the Resource Browser by opening the LocalStack Web Application in your browser, navigating to the **Resource Browser** section, and then clicking on **Simple Systems Manager (SSM)** under the **Management/Governance** section.
129128
130-
<img src="ssm-resource-browser.png" alt="SSM Resource Browser" title="SSM Resource Browser" width="900" />
129+
![SSM Resource Browser](/images/aws/ssm-resource-browser.png)
131130
132131
The Resource Browser allows you to perform the following actions:
133132

src/content/docs/aws/services/stepfunctions.md renamed to src/content/docs/aws/services/stepfunctions.mdx

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
22
title: "Step Functions"
3-
linkTitle: "Step Functions"
43
tags: ["Free"]
5-
description: >
6-
Get started with Step Functions on LocalStack
4+
description: Get started with Step Functions on LocalStack
75
---
86

97
## Introduction
@@ -13,7 +11,7 @@ It provides a JSON-based structured language called Amazon States Language (ASL)
1311
Thus making it easier to build and maintain complex and distributed applications.
1412

1513
LocalStack allows you to use the Step Functions APIs in your local environment to create, execute, update, and delete state machines locally.
16-
The supported APIs are available on our [API coverage page]({{< ref "coverage_stepfunctions" >}}), which provides information on the extent of Step Function's integration with LocalStack.
14+
The supported APIs are available on our [API coverage page](), which provides information on the extent of Step Function's integration with LocalStack.
1715

1816
## Getting started
1917

@@ -28,8 +26,8 @@ You can create a state machine using the [`CreateStateMachine`](https://docs.aws
2826
The API requires the name of the state machine, the state machine definition, and the role ARN that the state machine will assume to call AWS services.
2927
Run the following command to create a state machine:
3028

31-
{{< command >}}
32-
$ awslocal stepfunctions create-state-machine \
29+
```bash
30+
awslocal stepfunctions create-state-machine \
3331
--name "CreateAndListBuckets" \
3432
--definition '{
3533
"Comment": "Create bucket and list buckets",
@@ -51,7 +49,7 @@ $ awslocal stepfunctions create-state-machine \
5149
}
5250
}' \
5351
--role-arn "arn:aws:iam::000000000000:role/stepfunctions-role"
54-
{{< /command >}}
52+
```
5553

5654
The output of the above command is the ARN of the state machine:
5755

@@ -68,10 +66,10 @@ You can execute the state machine using the [`StartExecution`](https://docs.aws.
6866
The API requires the state machine's ARN and the state machine's input.
6967
Run the following command to execute the state machine:
7068

71-
{{< command >}}
72-
$ awslocal stepfunctions start-execution \
69+
```bash
70+
awslocal stepfunctions start-execution \
7371
--state-machine-arn "arn:aws:states:us-east-1:000000000000:stateMachine:CreateAndListBuckets"
74-
{{< /command >}}
72+
```
7573

7674
The output of the above command is the execution ARN:
7775

@@ -87,10 +85,10 @@ The output of the above command is the execution ARN:
8785
To check the status of the execution, you can use the [`DescribeExecution`](https://docs.aws.amazon.com/step-functions/latest/apireference/API_DescribeExecution.html) API.
8886
Run the following command to describe the execution:
8987

90-
{{< command >}}
91-
$ awslocal stepfunctions describe-execution \
88+
```bash
89+
awslocal stepfunctions describe-execution \
9290
--execution-arn "arn:aws:states:us-east-1:000000000000:execution:CreateAndListBuckets:bf7d2138-e96f-42d1-b1f9-41f0c1c7bc3e"
93-
{{< /command >}}
91+
```
9492

9593
Replace the `execution-arn` with the ARN of the execution you want to describe.
9694

@@ -161,10 +159,10 @@ LocalStack can also serve as a drop-in replacement for [AWS Step Functions Local
161159
It supports test cases with mocked Task states and maintains compatibility with existing Step Functions Local configurations.
162160
This functionality is extended in LocalStack by providing access to the latest Step Functions features such as [JSONata and Variables](https://blog.localstack.cloud/aws-step-functions-made-easy/), as well as the ability to enable both mocked and emulated service interactions emulated by LocalStack.
163161

164-
{{< callout >}}
162+
:::note
165163
LocalStack does not validate response formats.
166164
Ensure the payload structure in the mocked responses matches what the real service expects.
167-
{{< /callout >}}
165+
:::
168166

169167
### Identify a State Machine for Mocked Integrations
170168

@@ -287,9 +285,9 @@ In the example above:
287285
- `Return`: Simulates a successful response by returning a predefined payload.
288286
- `Throw`: Simulates a failure by returning an `Error` and an optional `Cause`.
289287

290-
{{< callout >}}
288+
:::note
291289
Each entry must have **either** `Return` or `Throw`, but cannot have both.
292-
{{< /callout >}}
290+
:::
293291

294292
Here is a complete example of the `MockedResponses` section:
295293

@@ -390,12 +388,17 @@ Set the `SFN_MOCK_CONFIG` environment variable to the path of your mock configur
390388

391389
If you're running LocalStack in Docker, mount the file and pass the variable as shown below:
392390

393-
{{< tabpane >}}
394-
{{< tab header="LocalStack CLI" lang="shell" >}}
391+
import { Tabs, TabItem } from '@astrojs/starlight/components';
392+
393+
<Tabs>
394+
<TabItem label="LocalStack CLI">
395+
```bash
395396
LOCALSTACK_SFN_MOCK_CONFIG=/tmp/MockConfigFile.json \
396397
localstack start --volume /path/to/MockConfigFile.json:/tmp/MockConfigFile.json
397-
{{< /tab >}}
398-
{{< tab header="Docker Compose" lang="yaml" >}}
398+
```
399+
</TabItem>
400+
<TabItem label="Docker Compose">
401+
```yaml
399402
services:
400403
localstack:
401404
container_name: "${LOCALSTACK_DOCKER_NAME:-localstack-main}"
@@ -411,21 +414,22 @@ services:
411414
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
412415
- "/var/run/docker.sock:/var/run/docker.sock"
413416
- "./MockConfigFile.json:/tmp/MockConfigFile.json"
414-
{{< /tab >}}
415-
{{< /tabpane >}}
417+
```
418+
</TabItem>
419+
</Tabs>
416420
417421
### Run Test Cases with Mocked Integrations
418422
419423
Create the state machine to match the name defined in the mock configuration file.
420424
421425
In this example, create the `LambdaSQSIntegration` state machine using:
422426

423-
{{< command >}}
424-
$ awslocal stepfunctions create-state-machine \
427+
```bash
428+
awslocal stepfunctions create-state-machine \
425429
--definition file://LambdaSQSIntegration.json \
426430
--name "LambdaSQSIntegration" \
427431
--role-arn "arn:aws:iam::000000000000:role/service-role/testrole"
428-
{{< /command >}}
432+
```
429433

430434
After the state machine is created and correctly named, you can run test cases defined in the mock configuration file using the [`StartExecution`](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html) API.
431435

@@ -435,22 +439,22 @@ This tells LocalStack to apply the corresponding mocked responses from the confi
435439

436440
For example, to run the `BaseCase` test case:
437441

438-
{{< command >}}
439-
$ awslocal stepfunctions start-execution \
442+
```bash
443+
awslocal stepfunctions start-execution \
440444
--state-machine arn:aws:states:us-east-1:000000000000:stateMachine:LambdaSQSIntegration#BaseCase \
441445
--input '{"name": "John", "surname": "smith"}' \
442446
--name "MockExecutionBaseCase"
443-
{{< /command >}}
447+
```
444448

445449
During execution, any state mapped in the mock config will use the predefined response.
446450
States without mock entries invoke the actual emulated service as usual.
447451

448452
You can inspect the execution using the [`DescribeExecution`](https://docs.aws.amazon.com/step-functions/latest/apireference/API_DescribeExecution.html) API:
449453

450-
{{< command >}}
451-
$ awslocal stepfunctions describe-execution \
454+
```bash
455+
awslocal stepfunctions describe-execution \
452456
--execution-arn "arn:aws:states:us-east-1:000000000000:execution:LambdaSQSIntegration:MockExecutionBaseCase"
453-
{{< /command >}}
457+
```
454458

455459
The sample output shows the execution details, including the state machine ARN, execution ARN, status, start and stop dates, input, and output:
456460

@@ -475,10 +479,10 @@ The sample output shows the execution details, including the state machine ARN,
475479

476480
You can also use the [`GetExecutionHistory`](https://docs.aws.amazon.com/step-functions/latest/apireference/API_GetExecutionHistory.html) API to retrieve the execution history, including the events and their details.
477481

478-
{{< command >}}
479-
$ awslocal stepfunctions get-execution-history \
482+
```bash
483+
awslocal stepfunctions get-execution-history \
480484
--execution-arn "arn:aws:states:us-east-1:000000000000:execution:LambdaSQSIntegration:MockExecutionBaseCase"
481-
{{< /command >}}
485+
```
482486

483487
This will return the full execution history, including entries that indicate how mocked responses were applied to Lambda and SQS states.
484488

@@ -522,9 +526,7 @@ The LocalStack Web Application includes a **Resource Browser** for managing Step
522526

523527
To access it, open the LocalStack Web UI in your browser, navigate to the **Resource Browser** section, and click **Step Functions** under **App Integration**.
524528

525-
<img src="stepfunctions-resource-browser.png" alt="Step Functions Resource Browser" title="Step Functions Resource Browser" width="900" />
526-
<br>
527-
<br>
529+
![Step Functions Resource Browser](/images/aws/stepfunctions-resource-browser.png)
528530

529531
The Resource Browser allows you to perform the following actions:
530532

src/content/docs/aws/services/sts.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "Security Token Service (STS)"
3-
linkTitle: "Security Token Service (STS)"
43
description: Get started with Security Token Service on LocalStack
54
persistence: supported
65
tags: ["Free"]
@@ -13,7 +12,7 @@ STS implements fine-grained access control and reduce the exposure of your long-
1312
The temporary credentials, known as security tokens, can be used to access AWS services and resources based on the permissions specified in the associated policies.
1413

1514
LocalStack allows you to use the STS APIs in your local environment to request security tokens, manage permissions, integrate with identity providers, and more.
16-
The supported APIs are available on our [API coverage page]({{< ref "coverage_sts" >}}), which provides information on the extent of STS's integration with LocalStack.
15+
The supported APIs are available on our [API coverage page](), which provides information on the extent of STS's integration with LocalStack.
1716

1817
## Getting started
1918

@@ -28,18 +27,18 @@ You can create an IAM User and Role using the [`CreateUser`](https://docs.aws.am
2827
The IAM User will be used to assume the IAM Role.
2928
Run the following command to create an IAM User, named `localstack-user`:
3029

31-
{{< command >}}
32-
$ awslocal iam create-user \
30+
```bash
31+
awslocal iam create-user \
3332
--user-name localstack-user
34-
{{< /command >}}
33+
```
3534

3635
You can generate long-term access keys for the IAM user using the [`CreateAccessKey`](https://docs.aws.amazon.com/STS/latest/APIReference/API_CreateAccessKey.html) API.
3736
Run the following command to create an access key for the IAM user:
3837

39-
{{< command >}}
40-
$ awslocal iam create-access-key \
38+
```bash
39+
awslocal iam create-access-key \
4140
--user-name localstack-user
42-
{{< /command >}}
41+
```
4342

4443
The following output would be retrieved:
4544

@@ -58,9 +57,9 @@ The following output would be retrieved:
5857
Using STS, you can also fetch temporary credentials for this user using the [`GetSessionToken`](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html) API.
5958
Run the following command using your long-term credentials to get your temporary credentials:
6059

61-
{{< command >}}
62-
$ awslocal sts get-session-token
63-
{{< /command >}}
60+
```bash
61+
awslocal sts get-session-token
62+
```
6463

6564
The following output would be retrieved:
6665

@@ -80,11 +79,11 @@ The following output would be retrieved:
8079
You can now create an IAM Role, named `localstack-role`, using the [`CreateRole`](https://docs.aws.amazon.com/STS/latest/APIReference/API_CreateRole.html) API.
8180
Run the following command to create the IAM Role:
8281

83-
{{< command >}}
84-
$ awslocal iam create-role \
82+
```bash
83+
awslocal iam create-role \
8584
--role-name localstack-role \
8685
--assume-role-policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::000000000000:root"},"Action":"sts:AssumeRole"}]}'
87-
{{< /command >}}
86+
```
8887

8988
The following output would be retrieved:
9089

@@ -115,22 +114,22 @@ The following output would be retrieved:
115114
You can attach the policy to the IAM role using the [`AttachRolePolicy`](https://docs.aws.amazon.com/STS/latest/APIReference/API_AttachRolePolicy.html) API.
116115
Run the following command to attach the policy to the IAM role:
117116

118-
{{< command >}}
119-
$ awslocal iam attach-role-policy \
117+
```bash
118+
awslocal iam attach-role-policy \
120119
--role-name localstack-role \
121120
--policy-arn arn:aws:iam::aws:policy/AdministratorAccess
122-
{{< /command >}}
121+
```
123122

124123
### Assume an IAM Role
125124

126125
You can assume an IAM Role using the [`AssumeRole`](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) API.
127126
Run the following command to assume the IAM Role:
128127

129-
{{< command >}}
130-
$ awslocal sts assume-role \
128+
```bash
129+
awslocal sts assume-role \
131130
--role-arn arn:aws:iam::000000000000:role/localstack-role \
132131
--role-session-name localstack-session
133-
{{< /command >}}
132+
```
134133

135134
The following output would be retrieved:
136135

@@ -157,9 +156,9 @@ You can use the temporary credentials in your applications for temporary access.
157156
You can get the caller identity to identify the principal your current credentials are valid for using the [`GetCallerIdentity`](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html) API.
158157
Run the following command to get the caller identity for the credentials set in your environment:
159158

160-
{{< command >}}
161-
$ awslocal sts get-caller-identity
162-
{{< /command >}}
159+
```bash
160+
awslocal sts get-caller-identity
161+
```
163162

164163
The following output would be retrieved:
165164

0 commit comments

Comments
 (0)