Closed jseiser closed 7 years ago
We have a github repo for our templates that is in progress, but it is not yet the clearest of documentation, and looking at it I did not documented creating instance with an elastic ip and then tagging it.
Here is an example of such a template to run with awless run
:
inst = create instance subnet=mysubnet image=myimage type=t2.micro keypair=awskeyname name=myinstance securitygroup=mysecgroup
create tag resource=$inst key=Env value=Staging
create tag resource=$int key=Type value=Broker
If you want to add a tag to an existing instance named myinstance
, on the command line you can do:
awless create tag resource=@myinstance key=Env value=Production
First quick reminder on how you can manage your public IPs:
awless ls elasticips
(list)
awless create elasticip domain=vpc
aw delete elasticip id=ID
Here is an example on how to attach an existing IP to an instance:
attach elasticip id=eipalloc-ddfbf3e7 instance=@my-instance-name
@jseiser If that does not answer your question let me know.
I added a full template on our repo
Im attempting to convert some of my cli scripts, to awless templates and I do not seem to find anything in the documentation on tagging an instance or associating a public IP. Specifically, trying to replicate the following options when creating a new instance.
--tag-specifications 'ResourceType=instance,Tags=[{Key=keyname,Value=value}, {Key=keyname,Value=value}, {Key=keyname,Value=value}, ]'
and
--associate-public-ip-address