CloudFormation is an AWS service allowing the definition of <i>stacks</i>. These stacks describe a series of AWS services
using a domain-specific language and allow for the easy creation of a number of interconnected resources. All resources
in a stack are tagged with the stack name which allows for tracking of costs per project. Each stack can also have all
resources terminated together easily, allowing stacks to exist for only as long as they are needed.
</p>
<p>
The CloudFormation templates used in the framework can be found in the <ahref="https://gitweb.torproject.org/metrics-cloud.git/tree/cloudformation">cloudformation</a> folder of the repository.
</p>
<p>
It may be that for some services the templates are very simple, and others may be more complex. No matter the level of
complexity we still want to use the templates to ensure we are meeting the key goals of the framework and also to simplify
tracking of spending in the billing portal through the tags.
</p>
<p>
Documentation for CloudFormation, including an API reference, can be found at: <ahref="https://docs.aws.amazon.com/cloudformation/">https://docs.aws.amazon.com/cloudformation/</a>.
You'll notice that the command includes a call to <code>whoami</code> to prefix the stack name with your current username, and also
that the <code>identify_user.sh</code> script is used to determine which SSH key to use for new instances.
You do not need to modify this command line before running it.
</p>
<p>
Once the stack has been deployed from the template, you can view its resources and delete it through
the <ahref="https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks?filteringText=&filteringStatus=active&viewNested=true&hideStacks=false">CloudFormation management console</a>.
The <ahref="https://gitweb.torproject.org/metrics-cloud.git/tree/cloudformation/identify_user.sh">identify_user.sh</a> script prints out the name of the SSH public key to be used based on either:
The environment variable takes precedence over the username to key mapping.
</p>
<p>
If you change the default key you would like to use, update the mapping in this shell script.
</p>
<p>
SSH keys are managed through the <ahref="https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#KeyPairs:">EC2 management console</a> and are not (currently) managed by a CloudFormation template.