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

[Enhancement]: add skip_destroy to aws_ami_copy #40130

Open springstim opened 1 week ago

springstim commented 1 week ago

Description

Request to reopen #792 to consider adding "skip_destroy" argument (optional value, defaulting to false) to aws_ami_copy resource.

The requested usability would be similar to that of aws_imagebuilder_component which implements a similarly named argument.

Use-case: (similar to OP's statement in #792 ) - AMIs copied with this resource (e.g. to another region) might still be referenced and needed by one or more aws_launch_template versions for an existing aws_autoscaling_group.

Currently there are a number of compensating workarounds that seem unnecessarily disconnected from IaC, error-prone and cumbersome; for example:

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

resource "aws_ami_copy" "cross_region" {
  # ...

  # Do not delete previous AMI & snapshot when a new copy is made:
  skip_destroy = true 
}

References

792

Would you like to implement a fix?

None

github-actions[bot] commented 1 week ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue