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

Increase rules and destination limits for aws_ecr_replication_configuration #22281

Conversation

sjonpaulbrown
Copy link

Description

This Pull Request increases the rules and destination limits for the aws_ecr_replication_configuration. The replication configuration can contain up to 10 rules, and each rule can contain up to 25 destinations.

This PR only encompasses resource schema updates to allow us to match the limits that have been declared by the AWS API.

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #21898

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccECRReplicationConfiguration_' PKG_NAME=internal/service/ecr
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 20 -run=TestAccECRReplicationConfiguration_ -timeout 180m
=== RUN   TestAccECRReplicationConfiguration_basic
=== PAUSE TestAccECRReplicationConfiguration_basic
=== CONT  TestAccECRReplicationConfiguration_basic
--- PASS: TestAccECRReplicationConfiguration_basic (43.27s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ecr        54.523s

Example Usage of Multiple Replication Rules with Multiple Destinations

Terraform Configuration

data "aws_caller_identity" "current" {}

resource "aws_ecr_replication_configuration" "example" {
  replication_configuration {
    rule {
      destination {
        region      = "us-west-1"
        registry_id = data.aws_caller_identity.current.account_id
      }
      destination {
        region      = "us-west-2"
        registry_id = data.aws_caller_identity.current.account_id
      }
    }
    rule {
      destination {
        region      = "eu-west-1"
        registry_id = data.aws_caller_identity.current.account_id
      }
      destination {
        region      = "eu-west-2"
        registry_id = data.aws_caller_identity.current.account_id
      }
    }
  }
}

Apply Output

$ terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_ecr_replication_configuration.example will be created
  + resource "aws_ecr_replication_configuration" "example" {
      + id          = (known after apply)
      + registry_id = (known after apply)

      + replication_configuration {
          + rule {
              + destination {
                  + region      = "us-west-1"
                  + registry_id = "562177434340"
                }
              + destination {
                  + region      = "us-west-2"
                  + registry_id = "562177434340"
                }
            }
          + rule {
              + destination {
                  + region      = "eu-west-1"
                  + registry_id = "562177434340"
                }
              + destination {
                  + region      = "eu-west-2"
                  + registry_id = "562177434340"
                }
            }
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_ecr_replication_configuration.example: Creating...
aws_ecr_replication_configuration.example: Creation complete after 1s [id=562177434340]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

@github-actions github-actions bot added service/ecr Issues and PRs that pertain to the ecr service. size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Dec 18, 2021
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. and removed documentation Introduces or discusses updates to documentation. labels Dec 18, 2021
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Dec 20, 2021
@ewbankkit ewbankkit force-pushed the f/aws_ecr_replication_configuration-increase-rules-and-destinations branch from 9c31e86 to 7846740 Compare December 20, 2021 16:24
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Dec 20, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc PKG=ecr TESTS=TestAccECRReplicationConfiguration_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ecr/... -v -count 1 -parallel 20 -run='TestAccECRReplicationConfiguration_' -timeout 180m
=== RUN   TestAccECRReplicationConfiguration_serial
=== RUN   TestAccECRReplicationConfiguration_serial/repositoryFilter
=== RUN   TestAccECRReplicationConfiguration_serial/basic
--- PASS: TestAccECRReplicationConfiguration_serial (73.95s)
    --- PASS: TestAccECRReplicationConfiguration_serial/repositoryFilter (38.03s)
    --- PASS: TestAccECRReplicationConfiguration_serial/basic (35.92s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ecr	77.842s

@ewbankkit
Copy link
Contributor

@sjonpaulbrown Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 1938244 into hashicorp:main Dec 20, 2021
@github-actions github-actions bot added this to the v3.71.0 milestone Dec 20, 2021
@sjonpaulbrown sjonpaulbrown deleted the f/aws_ecr_replication_configuration-increase-rules-and-destinations branch December 20, 2021 18:43
@github-actions
Copy link

github-actions bot commented Jan 6, 2022

This functionality has been released in v3.71.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/ecr Issues and PRs that pertain to the ecr service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple rules in ECR replication configuration
2 participants