Can anyone assist me with info about how to pull in an ssm parameter in troposphere?

164 views
Skip to first unread message

Skip

unread,
May 3, 2019, 7:07:22 PM5/3/19
to cloudtools-dev
Hi,

I wasn't able to find documentation or an example for this, but I'm using sceptre and Service Catalog, with my normal yaml template I can do:

Parameters:
SecurityGroup:
Type: AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>
Description: SSM parameter referencing the private security group ID
Default: /Params/VPC/PrivateSG

Then !Ref SecurityGroup for the value will contain the value from the parameter store. Any tips on doing this in troposphere?

Thanks in advance!
-Skip

Mark Peek

unread,
May 3, 2019, 7:16:59 PM5/3/19
to Skip, cloudtools-dev
Try something like this:

from troposphere import Template, Parameter

t = Template()
t.add_parameter(Parameter(
    "SecurityGroup",
    Type="AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>",
    Description="SSM parameter referencing the private security group ID",
    Default="/Params/VPC/PrivateSG",
))

print t.to_yaml()

--
You received this message because you are subscribed to the Google Groups "cloudtools-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudtools-de...@googlegroups.com.
To post to this group, send email to cloudto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudtools-dev/c3fab1e1-453d-4709-aaa3-1bf1e125cccb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Skip

unread,
May 3, 2019, 8:14:11 PM5/3/19
to cloudtools-dev
Yes, that works, thanks!


On Friday, May 3, 2019 at 4:16:59 PM UTC-7, mark wrote:
Try something like this:

from troposphere import Template, Parameter

t = Template()
t.add_parameter(Parameter(
    "SecurityGroup",
    Type="AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>",
    Description="SSM parameter referencing the private security group ID",
    Default="/Params/VPC/PrivateSG",
))

print t.to_yaml()

On Fri, May 3, 2019 at 4:09 PM Skip <gmo...@godaddy.com> wrote:
Hi,

I wasn't able to find documentation or an example for this, but I'm using sceptre and Service Catalog, with my normal yaml template I can do:

Parameters:
SecurityGroup:
Type: AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>
Description: SSM parameter referencing the private security group ID
Default: /Params/VPC/PrivateSG

Then !Ref SecurityGroup for the value will contain the value from the parameter store. Any tips on doing this in troposphere?

Thanks in advance!
-Skip

--
You received this message because you are subscribed to the Google Groups "cloudtools-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudto...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages