Open
Description
Terraform and AWS Provider Version
AWS provider 6.0.0-beta3
$ tofu --version
OpenTofu v1.9.1
on linux_amd64
Affected Resource(s) or Data Source(s)
aws_appstream_fleet_stack_association
aws_appstream_fleet
Expected Behavior
When making a change to the aws_appstream_fleet that causes it to be replaced e.g. changing from ALWAYS_ON to ON_DEMAND the stack association also needs to be deleted first and re-created.
Actual Behavior
No changes planned for the stack association, appstream fleet change fails
Relevant Error/Panic Output
│ Error: deleting AppStream Fleet (XXXXXXXXX): operation error AppStream: DeleteFleet, https response error StatusCode: 400, RequestID: 486ebffc-b549-4743-b58f-eb93146b3e26, ResourceInUseException: The fleet XXXXXXXXXXX is associated with a stack. To delete the fleet, you must dissociate it from the stack.
Sample Terraform Configuration
Click to expand configuration
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "6.0.0-beta3"
}
}
}
variable "on_demand" {
type = bool
}
resource "aws_appstream_stack" "stack" {
...
}
resource "aws_appstream_fleet" "fleet" {
...
fleet_type = var.on_demand ? "ON_DEMAND" : "ALWAYS_ON"
}
resource "aws_appstream_fleet_stack_association" "fs" {
fleet_name = aws_appstream_fleet.fleet.name
stack_name = aws_appstream_stack.stack.name
}
Steps to Reproduce
- Apply with on_demand = false
- Apply with on_demand = true
Debug Logging
Click to expand log output
GenAI / LLM Assisted Development
n/a
Important Facts and References
WORKAROUND: taint the association
Would you like to implement a fix?
No