hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.73k stars 9.09k forks source link

[Bug]: Creation with, and then removal of, cname_prefix from aws_elastic_beanstalk_environment results in NO CHANGES #31308

Open michaelsmoody opened 1 year ago

michaelsmoody commented 1 year ago

Terraform Core Version

1.3.9

AWS Provider Version

4.58.0

Affected Resource(s)

aws_elastic_beanstalk_environment

Expected Behavior

Re-creation OR Modification of the aws_elastic_beanstalk_environment resource

Actual Behavior

Nothing. Creating an aws_elastic_beanstalk_environment resource with cname_prefix and then removing (commenting out or deleting the attribute) results in "Matched Configuration"

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_elastic_beanstalk_environment" "production_elasticbeanstalk_environment" {

  depends_on = [
    aws_ssm_document.enable_elastic_beanstalk,
    aws_elastic_beanstalk_application.production_elasticbeanstalk_application
  ]

  wait_for_ready_timeout = "60m"

  name                = "${local.cust}-${local.env}-APP-Environment"
  description         = "ElasticBeanstalk - Hardened Amazon Linux 2 CIS 5.10 Kernel - PHP 8.1 - SELinux Enabled"
  application         = aws_elastic_beanstalk_application.production_elasticbeanstalk_application.name
  version_label       = aws_elastic_beanstalk_application_version.default_elasticbeanstalk_php_application.name

  cname_prefix        = "${local.cust}-${local.env}-APP-Environment"

  tier                = "WebServer"

  template_name       = aws_elastic_beanstalk_configuration_template.production_elasticbeanstalk_environment.name

}

Steps to Reproduce

Remove Attribute: cname_prefix = "${local.cust}-${local.env}-APP-Environment"

Debug Output

No response

Panic Output

No response

Important Factoids

ElasticBeanstalk's resource has a number of "bugs" and "issues", and we've had to work around quite a few of them. Name being modified on every apply (well, which fails), etc.

EDIT: Added code block to relevant resource. Assumed it would automatically by the form.

References

19679 is also happening. There I removed the cname_prefix attribute and was expecting a re-creation/replacement of the resource, or at least a modification of the resource.

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue