Skip to content

Commit b498c0a

Browse files
dfanglalexrashed
authored andcommitted
change more commands to new shortcode
1 parent 6b2fd25 commit b498c0a

File tree

10 files changed

+90
-87
lines changed

10 files changed

+90
-87
lines changed

Diff for: content/en/docs/Integrations/architect/index.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ The ``` arclocal``` command has the same usage as the ```arc``` command, so you
2525

2626
Create a test directory
2727

28-
```bash
29-
mkdir architect_quickstart && cd architect_quickstart
30-
```
28+
{{< command >}}
29+
$ mkdir architect_quickstart && cd architect_quickstart
30+
{{< / command >}}
3131

3232
then create an architect project
3333

34-
```
35-
arclocal init
36-
```
34+
{{< command >}}
35+
$ arclocal init
36+
{{< / command >}}
3737

3838
### Deployment
3939

@@ -43,9 +43,9 @@ Now you need to start LocalStack. The services you need to start are
4343
- cloudformation
4444

4545
After LocalStack has started you can deploy your Architect setup via
46-
```
47-
arclocal deploy
48-
```
46+
{{< command >}}
47+
$ arclocal deploy
48+
{{< / command >}}
4949

5050
## Further reading
5151

Diff for: content/en/docs/Integrations/aws-cli/index.md

+20-19
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ The source code can be found on GitHub: https://github.com/localstack/awscli-loc
6868

6969
You can install the `awslocal` command via `pip`:
7070

71-
```
72-
pip install awscli-local[ver1]
73-
```
71+
{{< command >}}
72+
$ pip install awscli-local[ver1]
73+
{{< / command >}}
7474

7575
Note that the command above also installs the latest version of the underlying AWS CLI version 1 (`awscli`) package. Use this command if you prefer to manage your own version of `awscli` (e.g., `v1`/`v2`) and install the wrapper script only:
76-
```
77-
pip install awscli-local
78-
```
76+
{{< command >}}
77+
$ pip install awscli-local
78+
{{< / command >}}
7979

8080
{{< alert >}}
8181
**Note:** Automatic installation of AWS CLI version 2 is currently not supported yet (at the time of writing there is no official pypi package for `v2` available), but the `awslocal` technically also works with AWS CLI v2 (see [this section]({{< ref "#limitations" >}}) for more details).
@@ -107,11 +107,11 @@ To work around this issue, you have 2 options:
107107
We do not recommend this, but it is technically possible.
108108
Also, you should install these libraries in a Python virtualenv, to avoid version clashes with other libraries on your system:
109109

110-
```bash
111-
virtualenv .venv
112-
. .venv/bin/activate
113-
pip install https://github.com/boto/botocore/archive/v2.zip https://github.com/aws/aws-cli/archive/v2.zip
114-
```
110+
{{< command >}}
111+
$ virtualenv .venv
112+
$ . .venv/bin/activate
113+
$ pip install https://github.com/boto/botocore/archive/v2.zip https://github.com/aws/aws-cli/archive/v2.zip
114+
{{< / command >}}
115115

116116
## AWS CLI v2
117117

@@ -123,10 +123,11 @@ By default, the container running [amazon/aws-cli](https://docs.aws.amazon.com/c
123123

124124
To ensure that the two docker containers can communicate create a network on the docker engine:
125125

126-
```bash
126+
{{< command >}}
127127
$ docker network create localstack
128128
0c9cb3d37b0ea1bfeb6b77ade0ce5525e33c7929d69f49c3e5ed0af457bdf123
129-
```
129+
{{< / command >}}
130+
130131
Then modify the `docker-compose.yml` specifying the network to use:
131132

132133
```yaml
@@ -138,24 +139,24 @@ networks:
138139
139140
Run AWS Cli v2 docker container using this network (example):
140141
141-
```bash
142+
{{< command >}}
142143
$ docker run --network localstack --rm -it amazon/aws-cli --endpoint-url=http://localstack:4566 lambda list-functions
143144
{
144145
"Functions": []
145146
}
146-
```
147+
{{< / command >}}
147148
148149
If you use AWS CLI v2 from a docker container often, create an alias:
149150
150-
```bash
151+
{{< command >}}
151152
$ alias laws='docker run --network localstack --rm -it amazon/aws-cli --endpoint-url=http://localstack:4566'
152-
```
153+
{{< / command >}}
153154
154155
So you can type:
155156
156-
```bash
157+
{{< command >}}
157158
$ laws lambda list-functions
158159
{
159160
"Functions": []
160161
}
161-
```
162+
{{< / command >}}

Diff for: content/en/docs/Integrations/pulumi/index.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ Make sure your LocalStack is running.
143143
For the example stack, the only required service is S3.
144144
After updating the stack configuration, and starting localstack, you can run:
145145
146-
```bash
147-
pulumi up
148-
```
146+
{{< command >}}
147+
$ pulumi up
148+
{{< / command >}}
149149
150150
once the stack update was performed, you can run:
151151
152-
```bash
153-
awslocal s3 ls
154-
```
152+
{{< command >}}
153+
$ awslocal s3 ls
154+
{{< / command >}}
155155
156156
Where you should see something like
157157
@@ -169,34 +169,34 @@ You can find the source code repository here: https://github.com/localstack/pulu
169169
`pulumilocal` requires that you already have the `pulumi` command in your path.
170170
Then, simply run
171171

172-
```bash
173-
pip install pulumi-local
174-
```
172+
{{< command >}}
173+
$ pip install pulumi-local
174+
{{< / command >}}
175175

176176
then,
177177

178-
```
178+
{{< command >}}
179179
pulumi version
180180
pulumilocal version
181-
```
181+
{{< / command >}}
182182

183183
should output the same value.
184184

185185
### Use
186186

187187
Instead of manually editing a stack configuration as explained earlier, you can run
188188

189-
```bash
190-
pulumilocal init
191-
```
189+
{{< command >}}
190+
$ pulumilocal init
191+
{{< / command >}}
192192

193193
which will create a `Pulumi.localstack.yaml` stack configuration, and initialize an additional stack named `localstack`.
194194

195195
You can now run
196196

197-
```bash
198-
pulumilocal up
199-
```
197+
{{< command >}}
198+
$ pulumilocal up
199+
{{< / command >}}
200200

201201
to start the localstack stack.
202202

Diff for: content/en/docs/Integrations/serverless-framework/index.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ resources:
6868
6969
## Install and configure Serverless-LocalStack Plugin
7070
To install the plugin, execute the following command in the root of your project.
71-
```bash
72-
npm install -D serverless-localstack
73-
```
71+
{{< command >}}
72+
$ npm install -D serverless-localstack
73+
{{< / command >}}
7474
7575
Next, set up the plugin by adding the following properties to `serverless.yml`.
7676
```yaml
@@ -126,14 +126,14 @@ else:
126126
You can now deploy your Serverless service to LocalStack.
127127

128128
First, start LocalStack by running
129-
```bash
130-
localstack start
131-
```
129+
{{< command >}}
130+
$ localstack start
131+
{{< / command >}}
132132

133133
Then deploy the endpoint by running
134-
```bash
135-
serverless deploy --stage local
136-
```
134+
{{< command >}}
135+
$ serverless deploy --stage local
136+
{{< / command >}}
137137

138138
The expected result should be similar to:
139139

Diff for: content/en/docs/Integrations/terraform/index.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Apart from some information Terraform expects there are basically only two thing
2323

2424
Before we start changing the configuration, create and change into a new directory for this sample
2525

26-
```bash
27-
mkdir terraform_quickstart && cd terraform_quickstart
28-
```
26+
{{< command >}}
27+
$ mkdir terraform_quickstart && cd terraform_quickstart
28+
{{< / command >}}
2929

3030
Inside this directory, create a file called `main.tf`.
3131
The following changes go into this file.
@@ -115,14 +115,14 @@ After starting LocalStack you can now deploy the s3 bucket via `terraform` and i
115115

116116
All you need to do is to initialize Terraform
117117

118-
```bash
119-
terraform init
120-
```
118+
{{< command >}}
119+
$ terraform init
120+
{{< / command >}}
121121

122122
and then deploy the configuration
123-
```bash
124-
terraform deploy
125-
```
123+
{{< command >}}
124+
$ terraform deploy
125+
{{< / command >}}
126126

127127
## Endpoint configuration
128128

Diff for: content/en/docs/Local AWS Services/apigatewayv2/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ functions:
2323
2424
Upon deployment of the Serverless project, a new API Gateway V2 endpoint will be created in LocalStack. The [`awslocal`](https://github.com/localstack/awscli-local) CLI can be used to get the list of APIs, which should contain the WebSocket endpoint, e.g., `ws://localhost:4510` in the example below:
2525

26-
```bash
26+
{{< command >}}
2727
$ awslocal apigatewayv2 get-apis
2828
{
2929
"Items": [{
@@ -32,7 +32,7 @@ $ awslocal apigatewayv2 get-apis
3232
...
3333
}]
3434
}
35-
```
35+
{{< / command >}}
3636

3737
Assuming your project contains a simple Lambda `handler.js` like this:
3838

Diff for: content/en/docs/Local AWS Services/appsync/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ $util.toJson($context.result["Items"])
4040
```
4141

4242
Once things have been wired up properly, and assuming the ID of your GraphQL API is `"api123"`, you should be able to run the following GraphQL query to retrieve all items from the `"posts"` DynamoDB table:
43-
```bash
44-
curl -d '{"query":"query {getPosts{id{S}}}"}' http://localhost:4605/graphql/api123
45-
```
43+
{{< command >}}
44+
$ curl -d '{"query":"query {getPosts{id{S}}}"}' http://localhost:4605/graphql/api123
45+
{{< / command >}}
4646

4747
For more details, please refer to the self-contained sample published in [this Github repository](https://github.com/localstack/localstack-pro-samples/tree/master/appsync-graphql-api).

Diff for: content/en/docs/Local AWS Services/athena/index.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ description: >
88
LocalStack Pro ships with built-in support for [Athena](https://aws.amazon.com/athena), Amazon's serverless data warehouse and analytics platform. Athena uses [Presto](https://prestodb.github.io/) under the covers, and your Athena instance will be automatically configured with a Hive metastore that connects seamlessly to the LocalStack S3 API. That is, you can easily connect your local S3 buckets and query data directly from S3 via the powerful Athena query API.
99

1010
The following commands illustrate how to use Athena from the command line (assuming you have [`awslocal`](https://github.com/localstack/awscli-local) installed):
11-
```bash
11+
12+
{{< command >}}
1213
$ awslocal athena start-query-execution --query-string 'SELECT 1, 2, 3'
1314
{
1415
"QueryExecutionId": "c9f453ad"
@@ -33,7 +34,7 @@ $ awslocal athena get-query-results --query-execution-id c9f453ad
3334
},
3435
"UpdateCount": 0
3536
}
36-
```
37+
{{< / command >}}
3738

3839
{{< alert >}}**Note**:
3940
In order to use the Athena API, some additional dependencies have to be fetched from the network, including a Docker image of apprx. 1.5GB which includes Presto, Hive and other tools. These dependencies are automatically fetched when you start up the service, so please make sure you're on a decent internet connection when pulling the dependencies for the first time.

Diff for: content/en/docs/Local AWS Services/cloudfront/index.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ description: >
99
LocalStack Pro supports creation of local CloudFront distributions, which allows you to transparently access your applications and file artifacts via CloudFront URLs like `https://abc123.cloudfront.net`.
1010

1111
For example, take the following simple example which creates an S3 bucket, puts a small text file `hello.txt` to the bucket, and then creates a CloudFront distribution which makes the file accessible via a `https://abc123.cloudfront.net/hello.txt` proxy URL (where `abc123` is a placeholder for the real distribution ID):
12-
```bash
13-
awslocal s3 mb s3://bucket1
14-
echo 'Hello World' > /tmp/hello.txt
15-
awslocal s3 cp /tmp/hello.txt s3://bucket1/hello.txt --acl public-read
16-
domain=$(awslocal cloudfront create-distribution \
17-
--origin-domain-name bucket1.s3.amazonaws.com | jq -r '.Distribution.DomainName')
18-
curl -k https://$domain/hello.txt
19-
```
12+
13+
{{< command >}}
14+
$ awslocal s3 mb s3://bucket1
15+
$ echo 'Hello World' > /tmp/hello.txt
16+
$ awslocal s3 cp /tmp/hello.txt s3://bucket1/hello.txt --acl public-read
17+
$ domain=$(awslocal cloudfront create-distribution \
18+
--origin-domain-name bucket1.s3.amazonaws.com | jq -r '.Distribution.DomainName')
19+
$ curl -k https://$domain/hello.txt
20+
{{< / command >}}
2021

2122
{{< alert >}}
2223
**Note:** In order for CloudFront to be fully functional, your local DNS setup needs to be properly configured. See the section on [configuring the local DNS server]({{< ref "#configuring-local-dns-server" >}}) for details.

Diff for: content/en/docs/Local AWS Services/elasticsearch/index.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can go ahead and use [awslocal]({{< ref "aws-cli.md#localstack-aws-cli-awslo
2222
**Note**: The default Elasticsearch version used is 7.7.
2323
{{< /alert >}}
2424

25-
```bash
25+
{{< command >}}
2626
$ awslocal es create-elasticsearch-domain --domain-name foobar
2727
{
2828
"DomainStatus": {
@@ -53,7 +53,7 @@ $ awslocal es create-elasticsearch-domain --domain-name foobar
5353
}
5454
}
5555
}
56-
```
56+
{{< / command >}}
5757

5858
In the LocalStack log you will see something like
5959

@@ -77,10 +77,10 @@ In the LocalStack log you will see something like
7777

7878
and after some time, you should see that the `Created` state of the domain is set to `true`:
7979

80-
```bash
80+
{{< command >}}
8181
$ awslocal es describe-elasticsearch-domain --domain-name foobar | jq ".DomainStatus.Created"
8282
true
83-
```
83+
{{< / command >}}
8484

8585
## Interact with the cluster
8686

@@ -93,7 +93,7 @@ Additional domains share the same Elasticsearch cluster.
9393

9494
For example:
9595

96-
```bash
96+
{{< command >}}
9797
$ curl http://localhost:4571
9898
{
9999
"name" : "om",
@@ -112,12 +112,12 @@ $ curl http://localhost:4571
112112
},
113113
"tagline" : "You Know, for Search"
114114
}
115-
```
115+
{{< / command >}}
116116

117117
Or the health endpoint:
118118

119-
```bash
120-
curl -s http://localhost:4571/_cluster/health | jq .
119+
{{< command >}}
120+
$ curl -s http://localhost:4571/_cluster/health | jq .
121121
{
122122
"cluster_name": "elasticsearch",
123123
"status": "green",
@@ -135,4 +135,4 @@ curl -s http://localhost:4571/_cluster/health | jq .
135135
"task_max_waiting_in_queue_millis": 0,
136136
"active_shards_percent_as_number": 100
137137
}
138-
```
138+
{{< / command >}}

0 commit comments

Comments
 (0)