Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Consider using Golang templates to augment Cloudformation #128

@joerocklin

Description

@joerocklin

While researching a solution for #126 I discovered a few restrictions with CloudFormation which make me wonder if it would be better to use golang templates to perform variable substitution in addition to (or perhaps in place of) CloudFormation parameters.

Specifically, I'm hitting an issue where the DeletionPolicy MUST be a string and cannot be a parameter which includes a string (see this AWS forum post about the issue which was created in May 2014). The workarounds for this may make sense for someone working with CloudFormation directly, though that debate is outside the scope of this tool.

In the case ot the Service Operator, where the tempalte is being read in from a file before being sent to AWS, there is an opportunity to perform variable substition or do anything other processing. In the case of the DeletionPolicy, performing a quick template substitution with the data already provided from the k8s manifest would yield a clean solution presented to CloudFormation - no workarounds needed.

I'm not incredibly familiar with CloudFormation, but in this case it seems like more of a means to an end of abstracting the lifecycle of resources in AWS away from users of a kubernetes cluster. Because of the DeletionPolicy scenario (and the limit of 60 parameters - not something which would easily be hit, but I could foresee the possibility with more complex abstractions), I would like to propse the consideration of adding a phase to the processing of the CloudFormation template file to perform golang template substitution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions