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.85k stars 9.2k forks source link

aws_elastic_beanstalk_environment with multiple `setting{}` block reports changes every time, even when there aren't any #18393

Closed briandilley closed 10 months ago

briandilley commented 3 years ago

Community Note

Terraform CLI and Terraform AWS Provider Version

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_elastic_beanstalk_environment" "platform_worker_server" {
  tags = {
    Environment = var.environment_name
    ManagedBy   = "Terraform"
  }

  name                = "${var.environment_name}-platform-workerserver"
  application         = var.aws_elastic_beanstalk_application
  solution_stack_name = "64bit Amazon Linux 2 v3.1.6 running Corretto 11"
  tier                = "Worker"

  setting {
    namespace = "aws:elasticbeanstalk:command"
    name      = "BatchSize"
    value     = var.deployment_batch_size_percent
    resource = ""
  }

  setting {
    namespace = "aws:autoscaling:trigger"
    name      = "BreachDuration"
    value     = var.scaling_trigger_breach_duration
    resource = ""
  }

  setting {
    namespace = "aws:autoscaling:asg"
    name      = "Cooldown"
    value     = "30"
    resource = ""
  }

  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name      = "InstanceType"
    value     = var.instance_type
    resource = ""
  }

  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name      = "EC2KeyName"
    value     = var.ssh_key_name
    resource = ""
  }

  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name      = "IamInstanceProfile"
    value     = var.instance_profile_name
    resource = ""
  }

  setting {
    namespace = "aws:autoscaling:launchconfiguration"
    name      = "MonitoringInterval"
    value     = var.monitoring_interval
    resource = ""
  }
...
}

Expected Behavior

Don't show changes when there are none

Actual Behavior

Shows changes when there are none

Steps to Reproduce

  1. terraform apply (apply changes)
  2. terraform apply (run immediately, it shows changes in settings blocks)
svenlito commented 3 years ago

settings blocks take a resource argument, setting it to "" will resolve this.

briandilley commented 3 years ago

@svenlito sorry - that didn't help.

miguelaferreira commented 3 years ago

@briandilley could your issue be a duplicate of https://github.com/hashicorp/terraform-provider-aws/issues/12889 and/or https://github.com/hashicorp/terraform-provider-aws/issues/1471?

github-actions[bot] commented 11 months ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

github-actions[bot] commented 9 months ago

I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.