-
Notifications
You must be signed in to change notification settings - Fork 602
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
AWS::Serverless transform creating resources that fail W3011 (DeletionPolicy/UpdateReplacePolicy rule) #1265
AWS::Serverless transform creating resources that fail W3011 (DeletionPolicy/UpdateReplacePolicy rule) #1265
Comments
cfn-lint/src/cfnlint/rules/resources/UpdateReplacePolicyDeletionPolicyOnStatefulResourceTypes.py Lines 22 to 39 in c3d1645
@TLaue are you comfortable sharing the template that is generating the warning? I wasn't able to produce output with either of these templates: Resources:
Bucket:
Type: AWS::S3::Bucket
DeletionPolicy: Delete
UpdateReplacePolicy: Delete Resources:
Bucket:
Type: AWS::S3::Bucket
DeletionPolicy: Delete
UpdateReplacePolicy: Delete
Properties:
BucketName: bucket @TLaue @kddejong some of the confusion might be coming from the 3011 messages lacking the resource logical ID that other rules provide. I can add that. In the meantime, rules give the line number of the violation and the Visual Studio Code extension should show them in context |
May I send the template via email to you? Can you provide an email address? |
It is on the way. |
@TLaue I believe the |
In my template, I've got |
#1266 should make what's happening clearer @keetonian @praneetap any thoughts on which https://github.com/awslabs/serverless-application-model/blob/a9388b64147e12426ba585482ee96f81db2dd25a/samtranslator/model/sam_resources.py#L415 |
* adding resource path to W3011/I3011 messages #1265 * adding resource path to W3011/I3011 messages in test results
A workaround: cfn-lint --ignore-checks W3011 -t template.yml The error is because SAM creates resources of type |
New version of cfn-lint has a new warning rule (W3011) that broke the build. We can ignore this warning as suggested in issue aws-cloudformation/cfn-lint#1265
@PatMyron any news on this? |
This comment has been minimized.
This comment has been minimized.
The explicit UpdateReplacePolicy changes have been merged into AWS::Serverless transform's develop branch, but still haven't made it into a release yet. Will update once those changes have been released |
…etionPolicy but not UpdateReplacePolicy from W3011 (#1529) #1265 https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html
Taking longer than expected for Sorry for delays and thanks for waiting |
I'm still getting this with the below 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:*
EDIT: Looking at the transformed template, it seems there's still the same issue with SAM – it removes the 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
# ... Commented on the SAM repo over at: aws/serverless-application-model#450 (comment) |
cfn-lint version: (
cfn-lint --version
)0.26.01
Description of issue.
The latest version of cfn-lint creates a warning in case of missing Deletion and UpdateReplace policy. This complain appears even though both properties are set for an S3 bucket which is the only resource in our stack wich requires these properties according to #1232. This warning did not appear prior to version 0.26.1. What is the difference beween I3011 and W3011?
The text was updated successfully, but these errors were encountered: