Skip to content

Feature Request: Add ability to substitute using Rain::Embed and Rain::IncludeΒ #720

@cmckni3

Description

@cmckni3

I need to substitute some variables in an external file and embed/include the content in the CloudFormation template.

Current Use Cases

  • Substitute CloudFormation pseudoparameters, such as AWS::Region and AWS::AccountId in external JSON IAM policy documents.
  • Substitute the domain name in the HTML email template

What I tried that doesn't work

nil error

...
PolicyDocument: !Sub "${Rain::Include my-iam-policy.json}"
...

Invalid YAML

...
PolicyDocument: !Sub !Rain::Include my-iam-policy.json
...

Fn::Sub is removed

PolicyDocument: !Sub |
  Rain::Include my-iam-policy.json

My current workaround is to continue using Fn::Sub and/or Fn::Join for the portion I need to be dynamic. I preprocess the content, and rain embeds the preprocessed file into the email template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions