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

Fix state machine update bug #38657

Merged
merged 4 commits into from
Aug 2, 2024
Merged

Conversation

AnitaErnszt
Copy link
Contributor

Description

State Machine resource is currently unaware that the version_arn and revision_id attributes will be updated when the resource is updated. This result in resources that depend on the new version only getting updated on subsequent terraform runs.

Took inspiration from how Lambda and CloudFormation resources are handling the updates.

Relations

Closes #36272

References

Output from Acceptance Testing

% make testacc PKG=sfn

=== RUN   TestAccSFNActivityDataSource_basic
=== PAUSE TestAccSFNActivityDataSource_basic
=== RUN   TestAccSFNActivity_basic
=== PAUSE TestAccSFNActivity_basic
=== RUN   TestAccSFNActivity_disappears
=== PAUSE TestAccSFNActivity_disappears
=== RUN   TestAccSFNActivity_tags
=== PAUSE TestAccSFNActivity_tags
=== RUN   TestAccSFNActivity_encryptionConfigurationCustomerManagedKMSKey
--- PASS: TestAccSFNActivity_encryptionConfigurationCustomerManagedKMSKey (76.60s)
=== RUN   TestAccSFNActivity_encryptionConfigurationServiceOwnedKey
--- PASS: TestAccSFNActivity_encryptionConfigurationServiceOwnedKey (72.55s)
=== RUN   TestAccSFNAliasDataSource_basic
=== PAUSE TestAccSFNAliasDataSource_basic
=== RUN   TestAccSFNAlias_basic
=== PAUSE TestAccSFNAlias_basic
=== RUN   TestAccSFNAlias_disappears
=== PAUSE TestAccSFNAlias_disappears
=== RUN   TestEndpointConfiguration
=== RUN   TestEndpointConfiguration/service_aws_envvar_overrides_base_config_file
=== RUN   TestEndpointConfiguration/base_endpoint_envvar_overrides_base_config_file
=== RUN   TestEndpointConfiguration/no_config
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_aws_service_envvar
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_service_config_file
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_service_config_file
=== RUN   TestEndpointConfiguration/service_aws_envvar_overrides_base_envvar
=== RUN   TestEndpointConfiguration/service_config_file
=== RUN   TestEndpointConfiguration/service_config_file_overrides_base_config_file
=== RUN   TestEndpointConfiguration/base_endpoint_config_file
=== RUN   TestEndpointConfiguration/service_aws_envvar_overrides_service_config_file
=== RUN   TestEndpointConfiguration/use_fips_config
=== RUN   TestEndpointConfiguration/package_name_endpoint_config
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_base_envvar
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_aws_service_envvar
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_base_envvar
=== RUN   TestEndpointConfiguration/service_aws_envvar
=== RUN   TestEndpointConfiguration/base_endpoint_envvar
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_alias_name_0_config
=== RUN   TestEndpointConfiguration/package_name_endpoint_config_overrides_base_config_file
=== RUN   TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_base_config_file
=== RUN   TestEndpointConfiguration/base_endpoint_envvar_overrides_service_config_file
=== RUN   TestEndpointConfiguration/use_fips_config_with_package_name_endpoint_config
--- PASS: TestEndpointConfiguration (0.81s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_base_config_file (0.06s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/no_config (0.02s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_aws_service_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_service_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_service_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_base_envvar (0.02s)
    --- PASS: TestEndpointConfiguration/service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/service_config_file_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_config_file (0.02s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_service_config_file (0.02s)
    --- PASS: TestEndpointConfiguration/use_fips_config (0.02s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config (0.04s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_base_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_aws_service_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_base_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar (0.02s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_alias_name_0_config (0.04s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_base_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/alias_name_0_endpoint_config_overrides_base_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar_overrides_service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/use_fips_config_with_package_name_endpoint_config (0.04s)
=== RUN   TestAccSFNStateMachineDataSource_basic
=== PAUSE TestAccSFNStateMachineDataSource_basic
=== RUN   TestAccSFNStateMachine_createUpdate
=== PAUSE TestAccSFNStateMachine_createUpdate
=== RUN   TestAccSFNStateMachine_expressUpdate
=== PAUSE TestAccSFNStateMachine_expressUpdate
=== RUN   TestAccSFNStateMachine_standardUpdate
=== PAUSE TestAccSFNStateMachine_standardUpdate
=== RUN   TestAccSFNStateMachine_nameGenerated
=== PAUSE TestAccSFNStateMachine_nameGenerated
=== RUN   TestAccSFNStateMachine_namePrefix
=== PAUSE TestAccSFNStateMachine_namePrefix
=== RUN   TestAccSFNStateMachine_publish
=== PAUSE TestAccSFNStateMachine_publish
=== RUN   TestAccSFNStateMachine_tags
=== PAUSE TestAccSFNStateMachine_tags
=== RUN   TestAccSFNStateMachine_tracing
=== PAUSE TestAccSFNStateMachine_tracing
=== RUN   TestAccSFNStateMachine_disappears
=== PAUSE TestAccSFNStateMachine_disappears
=== RUN   TestAccSFNStateMachine_expressLogging
=== PAUSE TestAccSFNStateMachine_expressLogging
=== RUN   TestAccSFNStateMachine_encryptionConfigurationCustomerManagedKMSKey
--- PASS: TestAccSFNStateMachine_encryptionConfigurationCustomerManagedKMSKey (137.50s)
=== RUN   TestAccSFNStateMachine_encryptionConfigurationServiceOwnedKey
--- PASS: TestAccSFNStateMachine_encryptionConfigurationServiceOwnedKey (123.27s)
=== RUN   TestAccSFNStateMachineVersionsDataSource_basic
=== PAUSE TestAccSFNStateMachineVersionsDataSource_basic
=== CONT  TestAccSFNActivityDataSource_basic
=== CONT  TestAccSFNStateMachine_standardUpdate
=== CONT  TestAccSFNStateMachine_tracing
=== CONT  TestAccSFNAlias_basic
=== CONT  TestAccSFNActivity_tags
=== CONT  TestAccSFNStateMachine_expressLogging
=== CONT  TestAccSFNStateMachine_createUpdate
=== CONT  TestAccSFNStateMachine_tags
=== CONT  TestAccSFNAliasDataSource_basic
=== CONT  TestAccSFNStateMachine_expressUpdate
=== CONT  TestAccSFNStateMachine_disappears
=== CONT  TestAccSFNActivity_basic
=== CONT  TestAccSFNAlias_disappears
=== CONT  TestAccSFNActivity_disappears
=== CONT  TestAccSFNStateMachineVersionsDataSource_basic
=== CONT  TestAccSFNStateMachine_publish
=== CONT  TestAccSFNStateMachine_namePrefix
=== CONT  TestAccSFNStateMachine_nameGenerated
=== CONT  TestAccSFNStateMachineDataSource_basic
--- PASS: TestAccSFNActivityDataSource_basic (23.20s)
--- PASS: TestAccSFNActivity_disappears (23.35s)
--- PASS: TestAccSFNActivity_basic (25.47s)
--- PASS: TestAccSFNStateMachine_disappears (51.56s)
--- PASS: TestAccSFNStateMachine_namePrefix (61.46s)
--- PASS: TestAccSFNActivity_tags (72.28s)
--- PASS: TestAccSFNStateMachine_createUpdate (91.05s)
--- PASS: TestAccSFNStateMachineDataSource_basic (103.03s)
--- PASS: TestAccSFNAliasDataSource_basic (110.08s)
--- PASS: TestAccSFNStateMachine_expressUpdate (113.50s)
--- PASS: TestAccSFNStateMachine_publish (115.52s)
--- PASS: TestAccSFNAlias_basic (130.60s)
--- PASS: TestAccSFNStateMachineVersionsDataSource_basic (131.91s)
--- PASS: TestAccSFNStateMachine_expressLogging (159.73s)
--- PASS: TestAccSFNAlias_disappears (169.92s)
--- PASS: TestAccSFNStateMachine_tags (174.63s)
--- PASS: TestAccSFNStateMachine_tracing (174.80s)
--- PASS: TestAccSFNStateMachine_standardUpdate (185.16s)
--- PASS: TestAccSFNStateMachine_nameGenerated (188.13s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/sfn	603.118s

...

@AnitaErnszt AnitaErnszt requested a review from a team as a code owner August 2, 2024 11:38
Copy link

github-actions bot commented Aug 2, 2024

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 service/sfn Issues and PRs that pertain to the sfn service. needs-triage Waiting for first response or review from a maintainer. labels Aug 2, 2024
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 @AnitaErnszt 👋

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 CONTRIBUTOR 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! 😃

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 2, 2024
@ewbankkit ewbankkit self-assigned this Aug 2, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 2, 2024
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=TestAccSFNStateMachine_' PKG=sfn
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/sfn/... -v -count 1 -parallel 20  -run=TestAccSFNStateMachine_ -timeout 360m
=== RUN   TestAccSFNStateMachine_createUpdate
=== PAUSE TestAccSFNStateMachine_createUpdate
=== RUN   TestAccSFNStateMachine_expressUpdate
=== PAUSE TestAccSFNStateMachine_expressUpdate
=== RUN   TestAccSFNStateMachine_standardUpdate
=== PAUSE TestAccSFNStateMachine_standardUpdate
=== RUN   TestAccSFNStateMachine_nameGenerated
=== PAUSE TestAccSFNStateMachine_nameGenerated
=== RUN   TestAccSFNStateMachine_namePrefix
=== PAUSE TestAccSFNStateMachine_namePrefix
=== RUN   TestAccSFNStateMachine_publish
=== PAUSE TestAccSFNStateMachine_publish
=== RUN   TestAccSFNStateMachine_tags
=== PAUSE TestAccSFNStateMachine_tags
=== RUN   TestAccSFNStateMachine_tracing
=== PAUSE TestAccSFNStateMachine_tracing
=== RUN   TestAccSFNStateMachine_disappears
=== PAUSE TestAccSFNStateMachine_disappears
=== RUN   TestAccSFNStateMachine_expressLogging
=== PAUSE TestAccSFNStateMachine_expressLogging
=== RUN   TestAccSFNStateMachine_encryptionConfigurationCustomerManagedKMSKey
--- PASS: TestAccSFNStateMachine_encryptionConfigurationCustomerManagedKMSKey (67.81s)
=== RUN   TestAccSFNStateMachine_encryptionConfigurationServiceOwnedKey
--- PASS: TestAccSFNStateMachine_encryptionConfigurationServiceOwnedKey (43.79s)
=== CONT  TestAccSFNStateMachine_createUpdate
=== CONT  TestAccSFNStateMachine_publish
=== CONT  TestAccSFNStateMachine_expressLogging
=== CONT  TestAccSFNStateMachine_disappears
=== CONT  TestAccSFNStateMachine_tracing
=== CONT  TestAccSFNStateMachine_tags
=== CONT  TestAccSFNStateMachine_nameGenerated
=== CONT  TestAccSFNStateMachine_namePrefix
=== CONT  TestAccSFNStateMachine_standardUpdate
=== CONT  TestAccSFNStateMachine_expressUpdate
--- PASS: TestAccSFNStateMachine_createUpdate (58.04s)
--- PASS: TestAccSFNStateMachine_expressUpdate (77.38s)
--- PASS: TestAccSFNStateMachine_standardUpdate (80.22s)
--- PASS: TestAccSFNStateMachine_disappears (91.41s)
--- PASS: TestAccSFNStateMachine_nameGenerated (95.53s)
--- PASS: TestAccSFNStateMachine_publish (99.47s)
--- PASS: TestAccSFNStateMachine_namePrefix (121.38s)
--- PASS: TestAccSFNStateMachine_tracing (126.60s)
--- PASS: TestAccSFNStateMachine_tags (144.25s)
--- PASS: TestAccSFNStateMachine_expressLogging (145.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/sfn	261.364s

@ewbankkit
Copy link
Contributor

@AnitaErnszt Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit d302de3 into hashicorp:main Aug 2, 2024
37 checks passed
@github-actions github-actions bot added this to the v5.62.0 milestone Aug 2, 2024
@AnitaErnszt AnitaErnszt deleted the b-state-machie-fix branch August 2, 2024 14:04
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 9, 2024
Copy link

github-actions bot commented Aug 9, 2024

This functionality has been released in v5.62.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!

Copy link

github-actions bot commented Sep 9, 2024

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 Sep 9, 2024
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/sfn Issues and PRs that pertain to the sfn service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: AWS SFN Alias not triggering when SFN code or configuration is updated.
2 participants