Request to reopen #792 to consider adding "skip_destroy" argument (optional value, defaulting to false) to aws_ami_copyresource.
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:
leveraging aws_rbin_rule to rely upon AWS to retain the deleted AMIs and snapshots for some period of time (365 day limit)... and then manually recovering those AMIs that are still needed and possibly re-sharing them.
use AWS CLI to perform the copy instead of using aws_ami_copy in the first place.
triggering some Lambda logic
others...
Affected Resource(s) and/or Data Source(s)
aws_ami_copy
Potential Terraform Configuration
resource "aws_ami_copy" "cross_region" {
# ...
# Do not delete previous AMI & snapshot when a new copy is made:
skip_destroy = true
}
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
Request to reopen #792 to consider adding "skip_destroy" argument (optional value, defaulting to
false
) toaws_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 existingaws_autoscaling_group
.Currently there are a number of compensating workarounds that seem unnecessarily disconnected from IaC, error-prone and cumbersome; for example:
aws_rbin_rule
to rely upon AWS to retain the deleted AMIs and snapshots for some period of time (365 day limit)... and then manually recovering those AMIs that are still needed and possibly re-sharing them.aws_ami_copy
in the first place.Affected Resource(s) and/or Data Source(s)
Potential Terraform Configuration
References
792
Would you like to implement a fix?
None