Skip to content
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

E3035 Strict checking for DeletionPolicy that includes JINJA2 #793

Closed
jitesh88 opened this issue Apr 3, 2019 · 2 comments
Closed

E3035 Strict checking for DeletionPolicy that includes JINJA2 #793

jitesh88 opened this issue Apr 3, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@jitesh88
Copy link

jitesh88 commented Apr 3, 2019

*cfn-lint version: 0.14

Description of issue.
There is a bug with the DeletionPolicy for RDS where you cannot pass in parameter reference or do any substitutions. It expects hardcoded static values i.e. Delete, Retain

https://forums.aws.amazon.com/thread.jspa?start=25&threadID=152800&tstart=0

This doesn't serve us well when trying to deploy the same template across different environments i.e. dev/stg/prd

to address this problem, we use Jinja2 Templating as below:

  RDSDBInstance:
    Type: AWS::RDS::DBInstance
    DeletionPolicy: "{{ Deletion_Policy }}"
    Properties:

Since the release of version 0.14 E3035 rule was added to check for deletion policy values.

it fails to validate our template with the below error:

E3035 DeletionPolicy should be only one of Delete, Retain, Snapshot at Resources/RDSDBInstance/DeletionPolicy

@cmmeyer cmmeyer self-assigned this Apr 4, 2019
@cmmeyer cmmeyer added the enhancement New feature or request label Apr 4, 2019
@cmmeyer
Copy link
Contributor

cmmeyer commented Apr 4, 2019

cfn-lint isn't aware of JINJA2, mustache or other template wrappers beyond CloudFormation JSON/YAML.

I'm going to flag this as an enhancement in case we ever decide to incorporate JINJA2 pre-processing, but for now you'll want to run your templates through the JINJA2 pre-processor before validating with cfn--lint.

@cmmeyer cmmeyer changed the title E3035 Strict checking for DeletionPolicy E3035 Strict checking for DeletionPolicy that includes JINJA2 Apr 4, 2019
@PatMyron
Copy link
Contributor

Closing this with Chuck's recommendation as it won't be feasible for the Linter to handle all pre-processing intentions

tracking here for official CloudFormation support for non-literal DeletionPolicy/UpdateReplacePolicy

@PatMyron PatMyron added the wontfix This will not be worked on label Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants