Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit a1d090f

Browse files
authored
Implement multiple fixes for ECR-ECR tutorial (#1630)
1 parent 1c0d4fc commit a1d090f

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

content/en/tutorials/ecs-ecr-container-app/index.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,18 @@ Next, we will create an ECR repository to push our Docker image.
6565
We will use the `awslocal` CLI to create the repository.
6666

6767
{{< command >}}
68-
$ awslocal ecr create-repository --repository-name <REPOSITORY_NAME>
68+
$ awslocal ecr create-repository --repository-name sample-ecr-repo
6969
{{< / command >}}
7070

71-
Replace `<REPOSITORY_NAME>` with your desired repository name.
7271
The output of this command will contain the `repositoryUri` value that we'll need in the next step:
7372

7473
```json
7574
{
7675
"repository": {
77-
"repositoryArn": "arn:aws:ecr:us-east-1:000000000000:repository/<REPOSITORY_NAME>",
76+
"repositoryArn": "arn:aws:ecr:us-east-1:000000000000:repository/sample-ecr-repo",
7877
"registryId": "000000000000",
79-
"repositoryName": "<REPOSITORY_NAME>",
80-
"repositoryUri": "localhost.localstack.cloud:4510/<REPOSITORY_NAME>",
78+
"repositoryName": "sample-ecr-repo",
79+
"repositoryUri": "localhost.localstack.cloud:4510/sample-ecr-repo",
8180
"createdAt": "<TIMESTAMP>",
8281
"imageTagMutability": "MUTABLE",
8382
"imageScanningConfiguration": {
@@ -111,7 +110,7 @@ We can now create an ECS cluster and deploy our NGINX web server.
111110
LocalStack enables the deployment of ECS task definitions, services, and tasks, allowing us to deploy our ECR containers via the ECS Fargate launch type, which uses the local Docker engine to deploy containers locally.
112111
To create the necessary ECS infrastructure on our local machine before deploying our NGINX web server, we will use a CloudFormation template.
113112

114-
You can create a new file named `ecs.infra.yml` inside a new `templates` directory, using a [publicly available CloudFormation template as a starting point](https://github.com/awslabs/aws-cloudformation-templates/blob/master/aws/services/ECS/FargateLaunchType/clusters/public-vpc.yml).
113+
You can create a new file named `ecs.infra.yml` inside a new `templates` directory, using a [publicly available CloudFormation template as a starting point](https://github.com/aws-cloudformation/aws-cloudformation-templates/blob/main/ECS/FargateLaunchType/services/public-service.yaml).
115114
To begin, we'll add the `Mappings` section and configure the subnet mask values, which define the range of internal IP addresses that can be assigned.
116115

117116
```yaml
@@ -373,14 +372,13 @@ Outputs:
373372
To deploy the CloudFormation template we created earlier, use the following command:
374373

375374
{{< command >}}
376-
$ awslocal cloudformation create-stack --stack-name <STACK_NAME> --template-body file://templates/ecs.infra.yml
375+
$ awslocal cloudformation create-stack --stack-name infra --template-body file://templates/ecs.infra.yml
377376
{{< /command >}}
378377

379-
Make sure to replace `<STACK_NAME>` with a name of your choice.
380378
Wait until the stack status changes to `CREATE_COMPLETE` by running the following command:
381379

382380
{{< command >}}
383-
$ awslocal cloudformation wait stack-create-complete --stack-name <STACK_NAME>
381+
$ awslocal cloudformation wait stack-create-complete --stack-name infra
384382
{{< /command >}}
385383

386384
You can also check your deployed stack on the LocalStack Web Application by navigating to the [CloudFormation resource browser](https://app.localstack.cloud/resources/cloudformation/stacks).
@@ -549,14 +547,14 @@ Resources:
549547
Next, let's deploy the CloudFormation template by running the following command:
550548

551549
{{< command >}}
552-
$ awslocal cloudformation create-stack --stack-name <STACK_NAME> --template-body file://templates/ecs.sample.yml --parameters ParameterKey=ImageUrl,ParameterValue=<REPOSITORY_URI>
550+
$ awslocal cloudformation create-stack --stack-name ecs --template-body file://templates/ecs.sample.yml --parameters ParameterKey=ImageUrl,ParameterValue=<REPOSITORY_URI>
553551
{{< /command >}}
554552

555-
Replace `<STACK_NAME>` with a name of your choice and `<REPOSITORY_URI>` with the URI of the Docker image that you want to deploy.
553+
Replace `<REPOSITORY_URI>` with the URI of the Docker image that you want to deploy.
556554
Wait for the stack to be created by running the following command:
557555

558556
{{< command >}}
559-
$ awslocal cloudformation wait stack-create-complete --stack-name <STACK_NAME>
557+
$ awslocal cloudformation wait stack-create-complete --stack-name ecs
560558
{{< /command >}}
561559

562560
Now that the ECS service has been deployed successfully, let's access the application endpoint.

layouts/shortcodes/github.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
{{ if (.Get "ref") }}
33
{{ $ref = printf "?ref=%s" (.Get "ref") }}
44
{{ end }}
5-
{{ $json := resources.GetRemote "https://api.github.com/repos/" (.Get "repo") "/contents/" (.Get "file") $ref }}
5+
{{ $url := "https://api.github.com/repos/" }}
6+
{{ $opts := dict
7+
(.Get "repo") "/contents/" (.Get "file") $ref
8+
}}
9+
{{ $json := resources.GetRemote $url $opts }}
610
{{ $data := $json | transform.Unmarshal }}
711
{{ $con := base64Decode $data.content }}
812
{{ $content := "" }}

0 commit comments

Comments
 (0)