diff --git a/docs/resources/ecr_repository.md b/docs/resources/ecr_repository.md index cc7b3eee78..baaeea9292 100644 --- a/docs/resources/ecr_repository.md +++ b/docs/resources/ecr_repository.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "awscc_ecr_repository Resource - terraform-provider-awscc" subcategory: "" description: |- @@ -10,7 +9,91 @@ description: |- The AWS::ECR::Repository resource specifies an Amazon Elastic Container Registry (Amazon ECR) repository, where users can push and pull Docker images. For more information, see https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html +## Example Usage +### ECR Repository with scan on push +To create ECR Repository with scan on push: + +```terraform +resource "awscc_ecr_repository" "this" { + repository_name = "example-ecr" + image_tag_mutability = "MUTABLE" + image_scanning_configuration = { + scan_on_push = true + } + +} +``` + +### ECR Repository with lifecycle policy +To create ECR Repository with lifecycle policy that expires untagged images older than 14 days: + +```terraform +resource "awscc_ecr_repository" "lifecycle_policy_example" { + repository_name = "example-ecr-lifecycle-policy" + image_tag_mutability = "MUTABLE" + + lifecycle_policy = { + lifecycle_policy_text = < ## Schema @@ -78,4 +161,4 @@ Import is supported using the following syntax: ```shell $ terraform import awscc_ecr_repository.example -``` +``` \ No newline at end of file diff --git a/examples/resources/awscc_ecr_repository/ecr_repository.tf b/examples/resources/awscc_ecr_repository/ecr_repository.tf new file mode 100644 index 0000000000..2a22394924 --- /dev/null +++ b/examples/resources/awscc_ecr_repository/ecr_repository.tf @@ -0,0 +1,8 @@ +resource "awscc_ecr_repository" "this" { + repository_name = "example-ecr" + image_tag_mutability = "MUTABLE" + image_scanning_configuration = { + scan_on_push = true + } + +} diff --git a/examples/resources/awscc_ecr_repository/ecr_repository_lifecycle_policy.tf b/examples/resources/awscc_ecr_repository/ecr_repository_lifecycle_policy.tf new file mode 100644 index 0000000000..07882f5b1f --- /dev/null +++ b/examples/resources/awscc_ecr_repository/ecr_repository_lifecycle_policy.tf @@ -0,0 +1,26 @@ +resource "awscc_ecr_repository" "lifecycle_policy_example" { + repository_name = "example-ecr-lifecycle-policy" + image_tag_mutability = "MUTABLE" + + lifecycle_policy = { + lifecycle_policy_text = <