terraform-aws-modules / terraform-aws-ecr

Terraform module to create AWS ECR resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/ecr/aws
Apache License 2.0
52 stars 111 forks source link

fix: Do not create a repository policy when the create_repository_policy variable is false #5

Closed phr3nzii closed 2 years ago

phr3nzii commented 2 years ago

Description

If create_repository_policy is set to false the module still tries to create the aws_ecr_repository_policy.this[0] resource. This PR fixes this so that when this variable is set to false this resource is no longer created.

One question I have is whether create_repository_policy should default to false? When creating an ECR repository in the console, you do not automatically get a repository policy. I thought about including this change in this PR but thought I would get feedback first. Apologies if this is not the correct place to discuss this. Should I open an issue for this discussion?

Motivation and Context

This change is required to fix the expected behaviour.

Breaking Changes

This is not a breaking change

How Has This Been Tested?

antonbabenko commented 2 years ago

This issue has been resolved in version 1.3.0 :tada:

github-actions[bot] commented 1 year ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.