Bayer-Group / cloudformation-template-generator

A type-safe Scala DSL for generating CloudFormation templates
BSD 3-Clause "New" or "Revised" License
210 stars 71 forks source link

Added UNSAFEFunctionCallToken to represent cloudformation functions t… #274

Closed zomboc0m closed 5 years ago

zomboc0m commented 5 years ago

…hat return strings which are assumed to conform to be the proper string representation of a stricter type, such as a CIDR block.

The motivation for this change is that using Fn::GetAtt to get the results of a custom resource is essentially a Token[String], which cannot be used with more specific type requirements, such as a Token[CidrBlock] needed for a VPC or Subnet.

This change allows for a custom resource to output a value as a string, which can be retrieved with a Fn::GetAtt, wrapped in UNSAFEFunctionCallToken, and used as a parameter for a another resource. This change is backwards compatable and will not break any existing cftg code.