cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2619
Views
0
Helpful
5
Replies

UserData through CloudFormation

jdorman
Cisco Employee
Cisco Employee

Is it possible to use multiple 'ios-config" lines in the userdata section when creating a CSR with Cloudformation?  When I add multiple lines it appears that they get combined when pushed to the CSR.

There is no problem when using the userdata section in the GUI, just with CloudFormation.

I used this as the foundation for my test:

https://supportforums.cisco.com/discussion/12700076/restapi-and-automated-deployment-support

5 Replies 5

jdorman
Cisco Employee
Cisco Employee

Any help here would be appreciated!

Here is an example of providing multi-line UserData in CloudFormation. You'll notice every line contains a newline character (\n), in-line quotes are escaped, and finally the entire string is base64 encoded. Hope this helps.

"UserData" : { "Fn::Base64":
{ "Fn::Join": [ "", [
"ios-config-1=\"interface Tunnel2\"\n",
"ios-config-2=\"no shutdown\"\n",
"ios-config-3=\"exit\"\n"
] ]
}
}

Hi,

i also struggle with " in CloudFormation UserData CSR config.

and tried a workaround

As i already have access to my corporate network during the last lines of the "ios-config-xxx" i just loaded the EEM scripts via TFTP to the router

as follows ->

                "ios-config-0085=file prompt quiet\n",
                "ios-config-0086=do copy tftp://x.x.x.x/tacacs system:/running-config\n",
                "ios-config-0087=do copy tftp://x.x.x.x/aws-cloud-config system:/running-config\n"

but also failed for the moment

Finally found a solution

!
"ios-config-0071=file prompt quiet\n",
"ios-config-0072=kron policy-list SETUP\n",
"ios-config-0073= cli copy tftp://x.x.x.x/aws-cloud-setup running-config\n",
"ios-config-0074=kron occurrence SETUP in 1 oneshot\n",
"ios-config-0075=policy-list SETUP\n"

Edit:

But is not stable :( Most of the time it fails :(

dwarakbesant11
Level 1
Level 1


The user-data for an instance is available for any process on the instance to retrieve at this location:

http://169.254.169.254/latest/user-data
The DNS name "instance-data" resolves to that IP address, Pega so  if you trust DNS to be up, you can also use the easier to remember:

http://instance-data/latest/user-data


Here are the Amazon docs:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: