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

resource/aws_amplify_app: update repository attribute in place #23517

Merged
merged 5 commits into from
Mar 14, 2022

Conversation

mmourick
Copy link
Contributor

@mmourick mmourick commented Mar 4, 2022

Fixes an issue where an aws_amplify_app will be destroyed and recreated when modifying the repository attribute instead of being updated in place.

Closes #23499

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

Output from acceptance testing:

❯ TF_ACC=1 go test  ./internal/service/amplify -run=TestAccAmplify_serial  -v -count 1 -parallel 1   -timeout 180m
=== RUN   TestAccAmplify_serial
=== RUN   TestAccAmplify_serial/App
=== RUN   TestAccAmplify_serial/App/Tags
=== PAUSE TestAccAmplify_serial/App/Tags
=== RUN   TestAccAmplify_serial/App/AutoBranchCreationConfig
=== PAUSE TestAccAmplify_serial/App/AutoBranchCreationConfig
=== RUN   TestAccAmplify_serial/App/BuildSpec
=== PAUSE TestAccAmplify_serial/App/BuildSpec
=== RUN   TestAccAmplify_serial/App/CustomRules
=== PAUSE TestAccAmplify_serial/App/CustomRules
=== RUN   TestAccAmplify_serial/App/IamServiceRole
=== PAUSE TestAccAmplify_serial/App/IamServiceRole
=== RUN   TestAccAmplify_serial/App/Repository
=== PAUSE TestAccAmplify_serial/App/Repository
=== RUN   TestAccAmplify_serial/App/basic
=== PAUSE TestAccAmplify_serial/App/basic
=== RUN   TestAccAmplify_serial/App/disappears
=== PAUSE TestAccAmplify_serial/App/disappears
=== RUN   TestAccAmplify_serial/App/BasicAuthCredentials
=== PAUSE TestAccAmplify_serial/App/BasicAuthCredentials
=== RUN   TestAccAmplify_serial/App/Description
=== PAUSE TestAccAmplify_serial/App/Description
=== RUN   TestAccAmplify_serial/App/EnvironmentVariables
=== PAUSE TestAccAmplify_serial/App/EnvironmentVariables
=== RUN   TestAccAmplify_serial/App/Name
=== PAUSE TestAccAmplify_serial/App/Name
=== CONT  TestAccAmplify_serial/App/Tags
=== CONT  TestAccAmplify_serial/App/basic
=== CONT  TestAccAmplify_serial/App/Name
=== CONT  TestAccAmplify_serial/App/EnvironmentVariables
=== CONT  TestAccAmplify_serial/App/Description
=== CONT  TestAccAmplify_serial/App/BasicAuthCredentials
=== CONT  TestAccAmplify_serial/App/disappears
=== CONT  TestAccAmplify_serial/App/CustomRules
=== CONT  TestAccAmplify_serial/App/Repository
=== CONT  TestAccAmplify_serial/App/IamServiceRole
=== CONT  TestAccAmplify_serial/App/BuildSpec
=== CONT  TestAccAmplify_serial/App/AutoBranchCreationConfig
=== RUN   TestAccAmplify_serial/BackendEnvironment
=== RUN   TestAccAmplify_serial/BackendEnvironment/basic
=== PAUSE TestAccAmplify_serial/BackendEnvironment/basic
=== RUN   TestAccAmplify_serial/BackendEnvironment/disappears
=== PAUSE TestAccAmplify_serial/BackendEnvironment/disappears
=== RUN   TestAccAmplify_serial/BackendEnvironment/DeploymentArtifacts_StackName
=== PAUSE TestAccAmplify_serial/BackendEnvironment/DeploymentArtifacts_StackName
=== CONT  TestAccAmplify_serial/BackendEnvironment/basic
=== CONT  TestAccAmplify_serial/BackendEnvironment/DeploymentArtifacts_StackName
=== CONT  TestAccAmplify_serial/BackendEnvironment/disappears
=== RUN   TestAccAmplify_serial/Branch
=== RUN   TestAccAmplify_serial/Branch/disappears
=== PAUSE TestAccAmplify_serial/Branch/disappears
=== RUN   TestAccAmplify_serial/Branch/Tags
=== PAUSE TestAccAmplify_serial/Branch/Tags
=== RUN   TestAccAmplify_serial/Branch/BasicAuthCredentials
=== PAUSE TestAccAmplify_serial/Branch/BasicAuthCredentials
=== RUN   TestAccAmplify_serial/Branch/EnvironmentVariables
=== PAUSE TestAccAmplify_serial/Branch/EnvironmentVariables
=== RUN   TestAccAmplify_serial/Branch/OptionalArguments
=== PAUSE TestAccAmplify_serial/Branch/OptionalArguments
=== RUN   TestAccAmplify_serial/Branch/basic
=== PAUSE TestAccAmplify_serial/Branch/basic
=== CONT  TestAccAmplify_serial/Branch/disappears
=== CONT  TestAccAmplify_serial/Branch/EnvironmentVariables
=== CONT  TestAccAmplify_serial/Branch/basic
=== CONT  TestAccAmplify_serial/Branch/OptionalArguments
=== CONT  TestAccAmplify_serial/Branch/Tags
=== CONT  TestAccAmplify_serial/Branch/BasicAuthCredentials
=== RUN   TestAccAmplify_serial/DomainAssociation
=== RUN   TestAccAmplify_serial/DomainAssociation/basic
    domain_association_test.go:23: Environment variable AMPLIFY_DOMAIN_NAME is not set
=== RUN   TestAccAmplify_serial/DomainAssociation/disappears
    domain_association_test.go:64: Environment variable AMPLIFY_DOMAIN_NAME is not set
=== RUN   TestAccAmplify_serial/DomainAssociation/update
    domain_association_test.go:93: Environment variable AMPLIFY_DOMAIN_NAME is not set
=== RUN   TestAccAmplify_serial/Webhook
=== RUN   TestAccAmplify_serial/Webhook/basic
=== PAUSE TestAccAmplify_serial/Webhook/basic
=== RUN   TestAccAmplify_serial/Webhook/disappears
=== PAUSE TestAccAmplify_serial/Webhook/disappears
=== RUN   TestAccAmplify_serial/Webhook/update
=== PAUSE TestAccAmplify_serial/Webhook/update
=== CONT  TestAccAmplify_serial/Webhook/basic
=== CONT  TestAccAmplify_serial/Webhook/update
    webhook_test.go:76: Step 1/3 error: Error running apply: exit status 1

        Error: error creating Amplify App (tf-acc-test-4386902220289407518): BadRequestException: Rate exceeded while calling CreateApp, please slow down or try again later.

          with aws_amplify_app.test,
          on terraform_plugin_test.tf line 2, in resource "aws_amplify_app" "test":
           2: resource "aws_amplify_app" "test" {

=== CONT  TestAccAmplify_serial/Webhook/disappears
    webhook_test.go:53: Step 1/1 error: Error running apply: exit status 1

        Error: error creating Amplify App (tf-acc-test-1096456474378132208): BadRequestException: Rate exceeded while calling CreateApp, please slow down or try again later.

          with aws_amplify_app.test,
          on terraform_plugin_test.tf line 2, in resource "aws_amplify_app" "test":
           2: resource "aws_amplify_app" "test" {

--- FAIL: TestAccAmplify_serial (1122.73s)
    --- PASS: TestAccAmplify_serial/App (0.00s)
        --- PASS: TestAccAmplify_serial/App/Tags (65.36s)
        --- PASS: TestAccAmplify_serial/App/basic (27.76s)
        --- PASS: TestAccAmplify_serial/App/Name (53.18s)
        --- PASS: TestAccAmplify_serial/App/EnvironmentVariables (58.72s)
        --- PASS: TestAccAmplify_serial/App/Description (61.79s)
        --- PASS: TestAccAmplify_serial/App/BasicAuthCredentials (58.67s)
        --- PASS: TestAccAmplify_serial/App/disappears (22.47s)
        --- PASS: TestAccAmplify_serial/App/CustomRules (58.59s)
        --- PASS: TestAccAmplify_serial/App/Repository (31.26s)
        --- PASS: TestAccAmplify_serial/App/IamServiceRole (65.89s)
        --- PASS: TestAccAmplify_serial/App/BuildSpec (55.02s)
        --- PASS: TestAccAmplify_serial/App/AutoBranchCreationConfig (73.07s)
    --- PASS: TestAccAmplify_serial/BackendEnvironment (0.00s)
        --- PASS: TestAccAmplify_serial/BackendEnvironment/basic (38.35s)
        --- PASS: TestAccAmplify_serial/BackendEnvironment/DeploymentArtifacts_StackName (32.86s)
        --- PASS: TestAccAmplify_serial/BackendEnvironment/disappears (28.11s)
    --- PASS: TestAccAmplify_serial/Branch (0.01s)
        --- PASS: TestAccAmplify_serial/Branch/disappears (29.48s)
        --- PASS: TestAccAmplify_serial/Branch/EnvironmentVariables (63.82s)
        --- PASS: TestAccAmplify_serial/Branch/basic (34.52s)
        --- PASS: TestAccAmplify_serial/Branch/OptionalArguments (54.60s)
        --- PASS: TestAccAmplify_serial/Branch/Tags (63.49s)
        --- PASS: TestAccAmplify_serial/Branch/BasicAuthCredentials (62.29s)
    --- PASS: TestAccAmplify_serial/DomainAssociation (0.00s)
        --- SKIP: TestAccAmplify_serial/DomainAssociation/basic (0.00s)
        --- SKIP: TestAccAmplify_serial/DomainAssociation/disappears (0.00s)
        --- SKIP: TestAccAmplify_serial/DomainAssociation/update (0.00s)
    --- FAIL: TestAccAmplify_serial/Webhook (0.00s)
        --- PASS: TestAccAmplify_serial/Webhook/basic (68.84s)
        --- FAIL: TestAccAmplify_serial/Webhook/update (7.54s)
        --- FAIL: TestAccAmplify_serial/Webhook/disappears (7.02s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/amplify	1124.325s
FAIL

Some tests fail due to rate limits somehow, however the relevant tests (repository related) pass.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. service/amplify Issues and PRs that pertain to the amplify service. labels Mar 4, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @mmourick 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 4, 2022
…ors like 'Rate exceeded while calling CreateApp, please slow down or try again later.'.
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Mar 14, 2022
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 TESTS=TestAccAmplify_serial/App PKG=amplify ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/amplify/... -v -count 1 -parallel 3 -run='TestAccAmplify_serial/App'  -timeout 180m
=== RUN   TestAccAmplify_serial
=== RUN   TestAccAmplify_serial/App
=== RUN   TestAccAmplify_serial/App/basic
=== PAUSE TestAccAmplify_serial/App/basic
=== RUN   TestAccAmplify_serial/App/disappears
=== PAUSE TestAccAmplify_serial/App/disappears
=== RUN   TestAccAmplify_serial/App/AutoBranchCreationConfig
=== PAUSE TestAccAmplify_serial/App/AutoBranchCreationConfig
=== RUN   TestAccAmplify_serial/App/BuildSpec
=== PAUSE TestAccAmplify_serial/App/BuildSpec
=== RUN   TestAccAmplify_serial/App/CustomRules
=== PAUSE TestAccAmplify_serial/App/CustomRules
=== RUN   TestAccAmplify_serial/App/IamServiceRole
=== PAUSE TestAccAmplify_serial/App/IamServiceRole
=== RUN   TestAccAmplify_serial/App/Tags
=== PAUSE TestAccAmplify_serial/App/Tags
=== RUN   TestAccAmplify_serial/App/BasicAuthCredentials
=== PAUSE TestAccAmplify_serial/App/BasicAuthCredentials
=== RUN   TestAccAmplify_serial/App/Description
=== PAUSE TestAccAmplify_serial/App/Description
=== RUN   TestAccAmplify_serial/App/EnvironmentVariables
=== PAUSE TestAccAmplify_serial/App/EnvironmentVariables
=== RUN   TestAccAmplify_serial/App/Name
=== PAUSE TestAccAmplify_serial/App/Name
=== RUN   TestAccAmplify_serial/App/Repository
    app_test.go:541: Environment variable AMPLIFY_GITHUB_ACCESS_TOKEN is not set
=== CONT  TestAccAmplify_serial/App/basic
=== CONT  TestAccAmplify_serial/App/Tags
=== CONT  TestAccAmplify_serial/App/BuildSpec
=== CONT  TestAccAmplify_serial/App/IamServiceRole
=== CONT  TestAccAmplify_serial/App/CustomRules
=== CONT  TestAccAmplify_serial/App/AutoBranchCreationConfig
=== CONT  TestAccAmplify_serial/App/disappears
=== CONT  TestAccAmplify_serial/App/EnvironmentVariables
=== CONT  TestAccAmplify_serial/App/Name
=== CONT  TestAccAmplify_serial/App/Description
=== CONT  TestAccAmplify_serial/App/BasicAuthCredentials
=== CONT  TestAccAmplify_serial/App/Description
    app_test.go:376: Step 4/4 error: Error running apply: exit status 1
        
        Error: error creating Amplify App (tf-acc-test-5910433071672985256): BadRequestException: Rate exceeded while calling CreateApp, please slow down or try again later.
        
          with aws_amplify_app.test,
          on terraform_plugin_test.tf line 2, in resource "aws_amplify_app" "test":
           2: resource "aws_amplify_app" "test" {
        
=== CONT  TestAccAmplify_serial/App/BasicAuthCredentials
    app_test.go:239: Step 1/4 error: Error running apply: exit status 1
        
        Error: error creating Amplify App (tf-acc-test-4498095110754920113): BadRequestException: Rate exceeded while calling CreateApp, please slow down or try again later.
        
          with aws_amplify_app.test,
          on terraform_plugin_test.tf line 2, in resource "aws_amplify_app" "test":
           2: resource "aws_amplify_app" "test" {
        
--- FAIL: TestAccAmplify_serial (191.39s)
    --- FAIL: TestAccAmplify_serial/App (0.00s)
        --- SKIP: TestAccAmplify_serial/App/Repository (0.00s)
        --- PASS: TestAccAmplify_serial/App/basic (37.45s)
        --- PASS: TestAccAmplify_serial/App/Tags (65.32s)
        --- PASS: TestAccAmplify_serial/App/BuildSpec (78.60s)
        --- PASS: TestAccAmplify_serial/App/IamServiceRole (71.83s)
        --- PASS: TestAccAmplify_serial/App/CustomRules (59.51s)
        --- PASS: TestAccAmplify_serial/App/AutoBranchCreationConfig (67.88s)
        --- PASS: TestAccAmplify_serial/App/disappears (37.45s)
        --- PASS: TestAccAmplify_serial/App/EnvironmentVariables (54.10s)
        --- FAIL: TestAccAmplify_serial/App/Description (36.41s)
        --- FAIL: TestAccAmplify_serial/App/BasicAuthCredentials (4.89s)
        --- PASS: TestAccAmplify_serial/App/Name (44.91s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/amplify	195.601s
FAIL
make: *** [testacc] Error 1

Errors are unrelated to this change.

…duce errors like 'Rate exceeded while calling CreateApp, please slow down or try again later.'."

This reverts commit 86eaf8f.
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Mar 14, 2022
@ewbankkit ewbankkit merged commit 68ebcac into hashicorp:main Mar 14, 2022
@github-actions github-actions bot added this to the v4.6.0 milestone Mar 14, 2022
@github-actions
Copy link

This functionality has been released in v4.6.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

github-actions bot commented May 7, 2022

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 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/amplify Issues and PRs that pertain to the amplify service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
5 participants