-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: support DeletionPolicy #450
Comments
Thanks for the request. We'll look into it. |
As per https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-resource-attributes.html, only 'DependsOn' resource attribute is supported accross the board and DeletionPolicy is only supported for LayerVersion. It would be very useful to support it for DynamoDb tables (aka AWS::Serverless::SimpleTable), as we do not want to delete a database table for some sensitive environments. thanks |
Without supporting Without supporting aws-cloudformation/cfn-lint#1265 |
I'm not sure if this is the same issue, but it looks like Original template: AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
Bucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
Function:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs12.x
Events:
ObjectCreated:
Type: S3
Properties:
Bucket: !Ref Bucket
Events: s3:ObjectCreated:* Transformed template (just the bucket portion): AWSTemplateFormatVersion: '2010-09-09'
Resources:
Bucket:
DeletionPolicy: Retain
DependsOn:
- FunctionObjectCreatedPermission
Properties:
NotificationConfiguration:
LambdaConfigurations:
- Event: s3:ObjectCreated:*
Function:
Fn::GetAtt:
- Function
- Arn
Type: AWS::S3::Bucket Note the Let me know if I should file a separate issue for this. |
How can I add |
Closing this issue since it is been released with SAM v1.36.0 and SAM CLI v1.24.0. You can read more about how resource level attributes are handled in SAM via our updated documentation; https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-resource-attributes.html Thanks! |
This is a feature request to cover the implementation of support to using DeletionPolicy statements on AWS SAM resources. The result of specifying a DeletionPolicy attribute on a SAM resource should be the resulting CloudFormation resources also having that attribute
The text was updated successfully, but these errors were encountered: