AppConfig hosted configuration version resource recreating the same versionA


I am trying to set up AWS AppConfig using terraform. To create a new hosted configuration version, I am using the aws_appconfig_hosted_configuration_version resource. For the first terraform apply, it works fine and creates configuration version 1 in the configuration profile.

Later on, in case of any changes in content, it destroys the v1 of configuration and recreates v1 with updated content.

Ideally it should create a new configuration version, where the version number gets incremented by 1, in case of a content update. Following is how I have defined the resource in IaC where I am using the file() function to get content that is stored locally.

Following are the apply logs when the configuration content got changed.

module.appconfig.aws_appconfig_application.application: Refreshing state... [id=app_id]

module.appconfig.aws_appconfig_deployment_strategy.strategy: Refreshing state... [id=deploy_strategy_id]

module.appconfig.aws_appconfig_environment.environment: Refreshing state... [id=env_id:app_id]

module.appconfig.aws_appconfig_configuration_profile.profile["test"]: Refreshing state... [id=config_profile_id:app_id]

module.appconfig.aws_appconfig_hosted_configuration_version.configuration["test"]: Refreshing state... [id=app_id/config_profile_id/1]

module.appconfig.aws_appconfig_hosted_configuration_version.configuration["test"]: Destroying... [id=app_id/config_profile_id/1]

module.appconfig.aws_appconfig_hosted_configuration_version.configuration["test"]: Destruction complete after 2s

module.appconfig.aws_appconfig_hosted_configuration_version.configuration["test"]: Creating...

module.appconfig.aws_appconfig_hosted_configuration_version.configuration["test"]: Creation complete after 3s [id=app_id/config_profile_id/1]

In the above logs, you can see that both the version(destroyed and recreated) are the same, i.e. 1.

Is there a way in Terraform to overcome this issue? Following are the versions that I am using.

Terraform - 0.14.10
AWS provider - 3.50.0

1 Like

I have the same issue with TF 1.0.6, aws 3.58.0
It seems “aws_appconfig_hosted_configuration_version” support is broken.


Did anyone find a solution to this issue? I am also facing same issue.

I created a terraform module where we could create an app config application, environment, profile, hosted version, and deployment.

When we create deployment we pass the hosted version number to it. On each edit of this hosted version, it destroys the current one and creates a new one with the same version number. due to this deployment resource doesn’t detect the change in value and is pointed to the same old value.

For EX, on the first run, we create a hosted version 1 and deploys(app config deployment) 1
on the second run, it deletes hosted version and while running the deployment part it doesn’t detect change since hosted version 1 is already deployed.

Isn’t this the same issue, am I missing something