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_ssm_parameter: Ignore Update if only overwrite parameter changes #32372

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Jul 5, 2023

Description

Ignores Update if only overwrite parameter changes. Prevents the error

Error: updating SSM Parameter (example): ParameterAlreadyExists: The parameter already exists. To overwrite this value, set the overwrite option in the request to true.

when removing parameter.

Closes #31655.

Output from Acceptance Testing

$ make testacc PKG=ssm TESTS=TestAccSSMParameter_

--- PASS: TestAccSSMParameter_disappears (64.78s)
--- PASS: TestAccSSMParameter_Secure_basic (83.54s)
--- PASS: TestAccSSMParameter_Tier_intelligentTieringOnCreation (83.55s)
--- PASS: TestAccSSMParameter_basic (83.62s)
--- PASS: TestAccSSMParameter_Overwrite_noOverwriteTags (85.51s)
--- PASS: TestAccSSMParameter_fullPath (85.62s)
--- PASS: TestAccSSMParameter_DataType_ssmIntegration (85.95s)
--- PASS: TestAccSSMParameter_Overwrite_tags (88.79s)
--- PASS: TestAccSSMParameter_Secure_key (90.50s)
--- PASS: TestAccSSMParameter_DataType_ec2Image (91.05s)
--- PASS: TestAccSSMParameter_Tier_intelligentTieringOnUpdate (125.59s)
--- PASS: TestAccSSMParameter_Overwrite_updateDescription (132.63s)
--- PASS: TestAccSSMParameter_Overwrite_updateToTags (133.14s)
--- PASS: TestAccSSMParameter_changeNameForcesNew (134.67s)
--- PASS: TestAccSSMParameter_Secure_keyUpdate (137.96s)
--- PASS: TestAccSSMParameter_updateDescription (141.88s)
--- PASS: TestAccSSMParameter_Overwrite_cascade (149.95s)
--- PASS: TestAccSSMParameter_Overwrite_removeAttribute (72.31s)
--- PASS: TestAccSSMParameter_Tier_intelligentTieringToStandard (159.41s)
--- PASS: TestAccSSMParameter_Tier_intelligentTieringToAdvanced (162.87s)
--- PASS: TestAccSSMParameter_Overwrite_basic (163.30s)
--- PASS: TestAccSSMParameter_updateType (84.28s)
--- PASS: TestAccSSMParameter_updateValue (89.34s)
--- PASS: TestAccSSMParameter_tier (115.34s)
--- PASS: TestAccSSMParameter_Secure_insecureChangeSecure (96.61s)
--- PASS: TestAccSSMParameter_Secure_insecure (97.95s)
--- PASS: TestAccSSMParameter_tags (97.43s)

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ssm Issues and PRs that pertain to the ssm service. size/L Managed by automation to categorize the size of a PR. labels Jul 5, 2023
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 TESTARGS='-run=TestAccSSMParameter_' PKG=ssm ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ssm/... -v -count 1 -parallel 2  -run=TestAccSSMParameter_ -timeout 180m
=== RUN   TestAccSSMParameter_basic
=== PAUSE TestAccSSMParameter_basic
=== RUN   TestAccSSMParameter_updateValue
=== PAUSE TestAccSSMParameter_updateValue
=== RUN   TestAccSSMParameter_updateDescription
=== PAUSE TestAccSSMParameter_updateDescription
=== RUN   TestAccSSMParameter_tier
=== PAUSE TestAccSSMParameter_tier
=== RUN   TestAccSSMParameter_Tier_intelligentTieringToStandard
=== PAUSE TestAccSSMParameter_Tier_intelligentTieringToStandard
=== RUN   TestAccSSMParameter_Tier_intelligentTieringToAdvanced
=== PAUSE TestAccSSMParameter_Tier_intelligentTieringToAdvanced
=== RUN   TestAccSSMParameter_Tier_intelligentTieringOnCreation
=== PAUSE TestAccSSMParameter_Tier_intelligentTieringOnCreation
=== RUN   TestAccSSMParameter_Tier_intelligentTieringOnUpdate
=== PAUSE TestAccSSMParameter_Tier_intelligentTieringOnUpdate
=== RUN   TestAccSSMParameter_disappears
=== PAUSE TestAccSSMParameter_disappears
=== RUN   TestAccSSMParameter_Overwrite_basic
=== PAUSE TestAccSSMParameter_Overwrite_basic
=== RUN   TestAccSSMParameter_Overwrite_cascade
=== PAUSE TestAccSSMParameter_Overwrite_cascade
=== RUN   TestAccSSMParameter_Overwrite_tags
=== PAUSE TestAccSSMParameter_Overwrite_tags
=== RUN   TestAccSSMParameter_Overwrite_noOverwriteTags
=== PAUSE TestAccSSMParameter_Overwrite_noOverwriteTags
=== RUN   TestAccSSMParameter_Overwrite_updateToTags
=== PAUSE TestAccSSMParameter_Overwrite_updateToTags
=== RUN   TestAccSSMParameter_Overwrite_removeAttribute
=== PAUSE TestAccSSMParameter_Overwrite_removeAttribute
=== RUN   TestAccSSMParameter_tags
=== PAUSE TestAccSSMParameter_tags
=== RUN   TestAccSSMParameter_updateType
=== PAUSE TestAccSSMParameter_updateType
=== RUN   TestAccSSMParameter_Overwrite_updateDescription
=== PAUSE TestAccSSMParameter_Overwrite_updateDescription
=== RUN   TestAccSSMParameter_changeNameForcesNew
=== PAUSE TestAccSSMParameter_changeNameForcesNew
=== RUN   TestAccSSMParameter_fullPath
=== PAUSE TestAccSSMParameter_fullPath
=== RUN   TestAccSSMParameter_Secure_basic
=== PAUSE TestAccSSMParameter_Secure_basic
=== RUN   TestAccSSMParameter_Secure_insecure
=== PAUSE TestAccSSMParameter_Secure_insecure
=== RUN   TestAccSSMParameter_Secure_insecureChangeSecure
=== PAUSE TestAccSSMParameter_Secure_insecureChangeSecure
=== RUN   TestAccSSMParameter_DataType_ec2Image
=== PAUSE TestAccSSMParameter_DataType_ec2Image
=== RUN   TestAccSSMParameter_DataType_ssmIntegration
=== PAUSE TestAccSSMParameter_DataType_ssmIntegration
=== RUN   TestAccSSMParameter_Secure_key
=== PAUSE TestAccSSMParameter_Secure_key
=== RUN   TestAccSSMParameter_Secure_keyUpdate
=== PAUSE TestAccSSMParameter_Secure_keyUpdate
=== CONT  TestAccSSMParameter_basic
=== CONT  TestAccSSMParameter_Overwrite_removeAttribute
--- PASS: TestAccSSMParameter_Overwrite_removeAttribute (84.88s)
=== CONT  TestAccSSMParameter_Tier_intelligentTieringOnUpdate
--- PASS: TestAccSSMParameter_basic (30.94s)
=== CONT  TestAccSSMParameter_Overwrite_updateToTags
--- PASS: TestAccSSMParameter_Tier_intelligentTieringOnUpdate (45.15s)
=== CONT  TestAccSSMParameter_Overwrite_noOverwriteTags
--- PASS: TestAccSSMParameter_Overwrite_noOverwriteTags (26.89s)
=== CONT  TestAccSSMParameter_Overwrite_tags
--- PASS: TestAccSSMParameter_Overwrite_updateToTags (45.76s)
=== CONT  TestAccSSMParameter_Overwrite_cascade
--- PASS: TestAccSSMParameter_Overwrite_tags (26.81s)
=== CONT  TestAccSSMParameter_Overwrite_basic
--- PASS: TestAccSSMParameter_Overwrite_cascade (56.67s)
=== CONT  TestAccSSMParameter_disappears
--- PASS: TestAccSSMParameter_disappears (19.06s)
=== CONT  TestAccSSMParameter_Secure_insecure
--- PASS: TestAccSSMParameter_Overwrite_basic (62.69s)
=== CONT  TestAccSSMParameter_Secure_keyUpdate
--- PASS: TestAccSSMParameter_Secure_keyUpdate (47.65s)
=== CONT  TestAccSSMParameter_Secure_key
--- PASS: TestAccSSMParameter_Secure_insecure (61.61s)
=== CONT  TestAccSSMParameter_DataType_ssmIntegration
--- PASS: TestAccSSMParameter_DataType_ssmIntegration (27.97s)
=== CONT  TestAccSSMParameter_DataType_ec2Image
--- PASS: TestAccSSMParameter_Secure_key (30.40s)
=== CONT  TestAccSSMParameter_Secure_insecureChangeSecure
--- PASS: TestAccSSMParameter_DataType_ec2Image (50.10s)
=== CONT  TestAccSSMParameter_changeNameForcesNew
--- PASS: TestAccSSMParameter_Secure_insecureChangeSecure (62.81s)
=== CONT  TestAccSSMParameter_Secure_basic
--- PASS: TestAccSSMParameter_Secure_basic (29.54s)
=== CONT  TestAccSSMParameter_fullPath
--- PASS: TestAccSSMParameter_changeNameForcesNew (49.67s)
=== CONT  TestAccSSMParameter_Tier_intelligentTieringToStandard
--- PASS: TestAccSSMParameter_fullPath (26.31s)
=== CONT  TestAccSSMParameter_Tier_intelligentTieringOnCreation
--- PASS: TestAccSSMParameter_Tier_intelligentTieringOnCreation (27.97s)
=== CONT  TestAccSSMParameter_Tier_intelligentTieringToAdvanced
--- PASS: TestAccSSMParameter_Tier_intelligentTieringToStandard (63.73s)
=== CONT  TestAccSSMParameter_updateType
--- PASS: TestAccSSMParameter_updateType (48.80s)
=== CONT  TestAccSSMParameter_Overwrite_updateDescription
--- PASS: TestAccSSMParameter_Tier_intelligentTieringToAdvanced (71.20s)
=== CONT  TestAccSSMParameter_updateDescription
--- PASS: TestAccSSMParameter_Overwrite_updateDescription (48.76s)
=== CONT  TestAccSSMParameter_tier
--- PASS: TestAccSSMParameter_updateDescription (50.06s)
=== CONT  TestAccSSMParameter_tags
--- PASS: TestAccSSMParameter_tier (64.82s)
=== CONT  TestAccSSMParameter_updateValue
--- PASS: TestAccSSMParameter_tags (64.53s)
--- PASS: TestAccSSMParameter_updateValue (48.09s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ssm	621.453s

@gdavison gdavison merged commit b2d32c8 into main Jul 5, 2023
@gdavison gdavison deleted the b-ssm-parameter-overwrite branch July 5, 2023 18:28
@github-actions github-actions bot added this to the v5.7.0 milestone Jul 5, 2023
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

This functionality has been released in v5.7.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 Aug 7, 2023

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 Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/ssm Issues and PRs that pertain to the ssm service. size/L 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
2 participants