Skip to content

userdata - interpolate stack variables into file #677

@brettswift

Description

@brettswift

It'd be great if we could interpolate variables within an external userdata file.

Problem statement:

given this:
UserData=userdata.from_file('./templates/userdata/userdata.sh'),

and a requirement to drop in a cfn-signal that contains parameters at the end of the script:

    "cfn-signal -e 0",
        "    --resource AutoscalingGroup",
        "    --stack ", Ref("AWS::StackName"),
        "    --region ", Ref("AWS::Region"), "\n"

I'd like to have a way to drop params and have them replaced within the external file. :)

Maybe there's a magical way I haven't come across?

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