Add a skip_destroy
parameter to aws_lambda_layer_version_permission
#23547
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
service/lambda
Issues and PRs that pertain to the lambda service.
Milestone
Community Note
Description
The aws_lambda_layer_version resource has a
skip_destroy
parameter, which allows you to keep old versions of the layer when you create new ones.However, the aws_lambda_layer_version_permission resource does not have a corresponding parameter. When this resource is replaced due to a change in the
version_number
parameter, it removes the policy from the old version and creates the policy for the new version.There is no way, as far as I can tell, to create a new layer version and new corresponding permission without deleting the permission from the old layer version. The workaround for this is to remove the
aws_lambda_layer_version_permission
resources from the state file prior to running the apply with the new layer version, but clearly that's not a great approach.New or Affected Resource(s)
Potential Terraform Configuration
The text was updated successfully, but these errors were encountered: