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.76k stars 9.12k forks source link

[Bug]: Impossible to update autoscaling_configuration on AWS AppRunner #38534

Open academiaresf opened 2 months ago

academiaresf commented 2 months ago

Terraform Core Version

1.9.2

AWS Provider Version

5.59.0

Affected Resource(s)

aws_apprunner_auto_scaling_configuration_version

Expected Behavior

When i change a parameter of the resource that is versionated, Terraform must creates a new version of the resource and sets the version as default. Nothing more.

Actual Behavior

When i change a paramter on the resource terraform apply fails because is trying to delete a resource that his natural behavior is the versioning. A new version of the AppRunner AutpScaler is created when terraform apply, and i can select this new version on the AWS Console UI but this also creates an undefined state. After creating the new version of the resource, Terraform tries to remove the resource (with all the versions, think).

Relevant Error/Panic Output Snippet

Error: deleting App Runner AutoScaling Configuration Version: operation error AppRunner: DeleteAutoScalingConfiguration, https response error StatusCode: 400, , InvalidRequestException: You can't delete the auto scaling configuration. It's used by one or more services. To delete it, update the services to use other auto scaling configurations.

Terraform Configuration Files

resource "aws_apprunner_auto_scaling_configuration_version" "api" {
  auto_scaling_configuration_name = "ServerApiAppRunnerAutoScaling"

  max_concurrency = 100
  max_size        = 2
  min_size        = 1

  tags = {
    Name = "ServerApiAppRunnerAutoScaling"
  }

  lifecycle {
    create_before_destroy = false
  }
}

Steps to Reproduce

Change the max_concurrency from X to Y.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 2 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue