Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java V2 Add Amazon ECR Basic Scenario files. #6541

Merged
merged 55 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
38dbfe8
Add draft ECR content
scmacdon Jun 7, 2024
71be3a2
Updated Readme
scmacdon Jun 7, 2024
5597f82
updated the spec
scmacdon Jun 11, 2024
0f30f25
updated the spec
scmacdon Jun 11, 2024
42e99fc
updated java code
scmacdon Jun 11, 2024
c49a25e
updated ECR Yaml
scmacdon Jun 12, 2024
2c406a2
updated ECR Yaml
scmacdon Jun 12, 2024
bdbe488
updated ECR Yaml
scmacdon Jun 12, 2024
d3e871d
updated ECR Yaml
scmacdon Jun 12, 2024
f555379
updated ECR Yaml
scmacdon Jun 12, 2024
084dae6
updated ECR Yaml
scmacdon Jun 12, 2024
7972a8a
updated ECR Yaml
scmacdon Jun 12, 2024
133e560
updated Java files
scmacdon Jun 13, 2024
d4dd325
updated Java files
scmacdon Jun 13, 2024
812555a
updated Java files
scmacdon Jun 13, 2024
b7d214e
update Readme via Write me
scmacdon Jun 13, 2024
5ff7bc0
update Readme via Write me
scmacdon Jun 13, 2024
1bb0e6c
update Readme via Write me
scmacdon Jun 13, 2024
4991ee9
fixed the YAML file
scmacdon Jun 13, 2024
89bcefa
fixed the YAML file
scmacdon Jun 13, 2024
df92f5c
fixed the YAML file
scmacdon Jun 13, 2024
1f92d75
fixed the YAML file
scmacdon Jun 13, 2024
4964591
Updated code to push to ECR for MAC
scmacdon Jun 13, 2024
a967432
updated Java file
scmacdon Jun 14, 2024
5f4fb4d
rolled in review comments
scmacdon Jun 17, 2024
e8f1f48
rolled in review comments
scmacdon Jun 17, 2024
2d3481b
rolled in review comments
scmacdon Jun 18, 2024
de5b6d3
rolled in review comments
scmacdon Jun 18, 2024
a64533b
rolled in review comments
scmacdon Jun 18, 2024
5e2c89a
updated Java ECR files
scmacdon Jun 18, 2024
3e73bfb
rolled in more review comments
scmacdon Jun 19, 2024
66f86f6
rolled in more review comments
scmacdon Jun 19, 2024
ed04c59
rolled in more review comments
scmacdon Jun 19, 2024
2acedde
ran write me tool
scmacdon Jun 19, 2024
1b02915
updated Java code
scmacdon Jun 19, 2024
95e0a73
updated Java code
scmacdon Jun 20, 2024
a3bba4f
rolled in review comments
scmacdon Jun 27, 2024
a72baee
rolled in review comments
scmacdon Jun 27, 2024
3a57739
rolled in review comments
scmacdon Jun 27, 2024
d2c7f83
rolled in review comments
scmacdon Jun 27, 2024
6b8907e
rolled in review comments
scmacdon Jun 27, 2024
f401c32
rolled in review comments
scmacdon Jun 27, 2024
5bcf0fd
rolled in review comments
scmacdon Jun 27, 2024
1c95e48
updated Readme with WriteMe
scmacdon Jun 27, 2024
998cc06
updated Readme with WriteMe
scmacdon Jun 27, 2024
f31e060
updated spec
scmacdon Jun 27, 2024
f79bfdd
updated spec
scmacdon Jun 27, 2024
851d9fa
updated readme
scmacdon Jun 27, 2024
f371903
rolled in more comments
scmacdon Jun 28, 2024
aa390a2
rolled in more comments
scmacdon Jun 28, 2024
13172ba
rolled in more comments
scmacdon Jun 28, 2024
1a388f1
fixed a tag
scmacdon Jun 28, 2024
6d5b598
fixed a tag
scmacdon Jun 28, 2024
562247a
fixed readme
scmacdon Jun 28, 2024
1298113
Merge branch 'main' into ecr
beqqrry-aws Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions .doc_gen/metadata/ecr_metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,136 @@
# zexi 0.4.0
ecr_Hello:
title: Hello &ECR;
title_abbrev: Hello &ECR;
synopsis: get started using &ECR;.
category: Hello
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2_hello.main
services:
ecr: {listImages}
ecr_PushImageCmd:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.push.image.main
services:
ecr: {PushImageCmd}
ecr_SetRepositoryPolicy:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.set.repo.policy.main
services:
ecr: {SetRepositoryPolicy}
ecr_GetRepositoryPolicy:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.get.repo.policy.main
services:
ecr: {GetRepositoryPolicy}
ecr_GetAuthorizationToken:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.get.token.main
services:
ecr: {GetAuthorizationToken}
ecr_StartLifecyclePolicyPreview:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.verify.image.main
services:
ecr: {StartLifecyclePolicyPreview}
ecr_DescribeImages:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.verify.image.main
services:
ecr: {DescribeImages}
ecr_DeleteRepository:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.delete.repo.main
services:
ecr: {DeleteRepository}
ecr_CreateRepository:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.create.repo.main
services:
ecr: {CreateRepository}
ecr_DescribeRepositories:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/ecr
sdkguide:
excerpts:
- description:
snippet_tags:
- ecr.java2.describe.policy.main
Rust:
versions:
- sdk_version: 1
Expand All @@ -25,3 +155,32 @@ ecr_ListImages:
- ecr.rust.list-images
services:
ecr: {ListImages}
ecr_Scenario_RepositoryManagement:
title: Learn core operations for &ECR; using an &AWS; SDK
title_abbrev: Learn &ECR; core operations
synopsis_list:
scmacdon marked this conversation as resolved.
Show resolved Hide resolved
- Create an &ECR; repository.
- Set repository policies.
- Retrieve repository URIs.
- Get &ECR; authorization tokens.
- Set lifecycle policies for &ECR; repositories.
- Push a Docker image to an &ECR; repository.
- Verify the existence of an image in an &ECR; repository.
- List &ECR; repositories for your account and get details about them.
- Delete &ECR; repositories.
category: Scenarios
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/kms
sdkguide:
excerpts:
- description: Run an interactive scenario demonstrating &ECR; features.
snippet_tags:
- ecr.java2_scenario.parent.main
- description: A wrapper class for &ECR; SDK methods.
snippet_tags:
- ecr.java2_scenario.main
services:
ecr: {CreateRepository, DescribeRepositories, DeleteRepository, DescribeImages, StartLifecyclePolicyPreview, GetAuthorizationToken, GetRepositoryPolicy, SetRepositoryPolicy}
64 changes: 64 additions & 0 deletions getting_started_scenarios/ecr_scenario/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Amazon Elastic Container Registry Service Basic Scenario

## Overview

This Amazon Elastic Container Registry Service (Amazon ECR) basic scenario demonstrates how to interact with the Amazon ECR service using an AWS SDK. The scenario covers various operations such as creating an Amazon ECR repository, pushing images to the repository, setting an ECR repository policy, and so on.

Here are the top six service operations this scenario covers.

1. **Create an ECR repository**: The program creates an Amazon ECR repository.

2. **Set an ECR repository policy**: The program sets an ECR repository policy, which grants the specified IAM role the necessary permissions to access the repository.

3. **Retrieve an ECR authorization token**: The program retrieves an ECR authorization token which is required for subsequent operations.

4. **Get the ECR repository URI**: The program retrieves the URI of the ECR repository.

5. **Push a Docker image to the ECR repository**: The program pushes a local Docker image to the ECR repository using a Docker client.

6. **Verify the image in the ECR repository**: The program verifies that the Docker image was successfully pushed to the ECR repository.

Note: These steps are not the complete program, but summarizes the 5-6 high-level steps. See the Eng Spec for a complete listing of ECR operations.

### Resources

The basic scenario requires an IAM role that has Amazon ECR permissions. To create an IAM role, see [Creating IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create.html).

For more information about using permissions with ECR (for example, how to create Amazon ECR Identity-based policies), see [How Amazon Elastic Container Registry works with IAM](https://docs.aws.amazon.com/AmazonECR/latest/userguide/security_iam_service-with-iam.html).

This scenario requires a local Docker image created using Bash. To create a local Docker image named "echo-text" using Bash, perform these steps:

1. **Install Docker**: First, you'll need to install Docker and Docker Desktop on your system. You can download the appropriate Docker version for your operating system from the official Docker website (https://www.docker.com/get-started).

2. **Go to the resource folder**: Go to the resource sub folder and notice the two files: `Dockerfile` and `hello.sh`.

3. **Build the Docker image**: In the resource folder that contains `Dockerfile` and `hello.sh`, run the following command to build the Docker image:

```bash
docker build -t echo-text .
```

This command builds a Docker image with the tag "echo-text" using the instructions in the Dockerfile.

4. **Run the Docker container**: Once the image is built, you can run a container based on the "echo-text" image by executing the following command:

```bash
docker run echo-text
```


## Implementations

This scenario example will be implemented in the following languages:

- Java
- Python
- Kotlin

## Additional reading

- [Amazon ECR](https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html)

---

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
Loading
Loading