Skip to content

Conversation

@KyMidd
Copy link
Contributor

@KyMidd KyMidd commented Oct 28, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Description

Fixes persistent drift detection in aws_appconfig_hosted_configuration_version when using AppConfig feature flags. AWS AppConfig automatically injects _createdAt and _updatedAt timestamp metadata fields into feature flag configurations at the flags.* and values.* levels, which are not present in the Terraform configuration. This causes Terraform to incorrectly detect drift on every plan/apply cycle, even when no actual changes have been made.

Example Drift Scenario (Before Fix)

  resource "aws_appconfig_hosted_configuration_version" "example" {
    application_id           = aws_appconfig_application.example.id
    configuration_profile_id = aws_appconfig_configuration_profile.example.id
    content_type             = "application/json"

    content = jsonencode({
      flags = {
        feature_flag = {
          name = "featureFlag"
        }
      }
      values = {
        feature_flag = {
          _variants = [
            { enabled = true, name = "Default" }
          ]
        }
      }
    })
  }

After initial apply, subsequent terraform plan would show drift due to AWS adding:

  "flags": {
    "feature_flag": {
      "_createdAt": "2025-10-28T19:14:35.761Z",  // Injected by AWS
      "_updatedAt": "2025-10-28T19:09:00.981Z",  // Injected by AWS
      "name": "featureFlag"
    }
  }

Relations

n/a

References

n/a

Output from Acceptance Testing

Acceptance tests pass:
>  make testacc TESTS=TestAccAppConfigHostedConfigurationVersion PKG=appconfig
  === RUN   TestAccAppConfigHostedConfigurationVersion_basic
  --- PASS: TestAccAppConfigHostedConfigurationVersion_basic (24.25s)
  === RUN   TestAccAppConfigHostedConfigurationVersion_disappears
  --- PASS: TestAccAppConfigHostedConfigurationVersion_disappears (21.48s)
  === RUN   TestAccAppConfigHostedConfigurationVersion_featureFlagsNoDrift
  --- PASS: TestAccAppConfigHostedConfigurationVersion_featureFlagsNoDrift (30.35s)
  PASS
  ok  	github.com/hashicorp/terraform-provider-aws/internal/service/appconfig	63.710s

@KyMidd KyMidd requested a review from a team as a code owner October 28, 2025 21:14
@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions
Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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 needs-triage Waiting for first response or review from a maintainer. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/appconfig Issues and PRs that pertain to the appconfig service. size/M Managed by automation to categorize the size of a PR. labels Oct 28, 2025
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Addresses a defect in current functionality. service/appconfig Issues and PRs that pertain to the appconfig service. size/M 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

Development

Successfully merging this pull request may close these issues.

2 participants