question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWS::Serverless transform creating resources that fail W3011 (DeletionPolicy/UpdateReplacePolicy rule)

See original GitHub issue

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 https://github.com/aws-cloudformation/cfn-python-lint/pull/1232. This warning did not appear prior to version 0.26.1. What is the difference beween I3011 and W3011?

Resources:
  xxxBucket:
    Type: AWS::S3::Bucket
    DeletionPolicy: Delete
    UpdateReplacePolicy: Delete
    Properties:...

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

11reactions
hugoduraescommented, Jan 28, 2020

@PatMyron any news on this?

7reactions
forzagreencommented, Dec 23, 2019

A workaround:

cfn-lint --ignore-checks W3011 -t template.yml

The error is because SAM creates resources of type AWS::Lambda::Version for each lambda function. This Version resource has a default property "DeletionPolicy": "Retain" , but they don’t have UpdateReplacePolicy property. To see the full resources after transformation run cfn-lint with --info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::Serverless transform creating resources that fail W3011 ...
AWS::Serverless transform creating resources that fail W3011 (DeletionPolicy/UpdateReplacePolicy rule) #1265.
Read more >
UpdateReplacePolicy attribute - AWS CloudFormation
Specify how to handle resource replacement during stack update operations in AWS CloudFormation by using the UpdateReplacePolicy attribute.
Read more >
DeletionPolicy attribute - AWS CloudFormation
With the DeletionPolicy attribute you can preserve, and in some cases, backup a resource when its stack is deleted. You specify a DeletionPolicy...
Read more >
AWS::Serverless transform - AWS CloudFormation
When creating a change set from the template, CloudFormation expands the AWS SAM syntax, as defined by the transform. The processed template expands...
Read more >
AWS::Serverless::LayerVersion
Creates a Lambda LayerVersion that contains library or runtime code needed ... SAM adds a Resource attributes of DeletionPolicy: Retain to the transformed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found