CloudFormation does not have a "pictures" feature, and it has no built-in naming scheme either: the stack name is whatever string you type when you create the stack, and any visual diagram or image of your template has to come from an external tool or from the template itself. If you have seen screenshots of CloudFormation architecture diagrams, those were generated with a design tool or an AWS feature other than the CloudFormation console, not saved inside the stack. This guide covers how to choose stack names that stay manageable, how to label the resources inside a template so the console reads clearly, and how to produce a picture or diagram of what a stack deploys.
What You Will Need
- An AWS account with permission to create and describe CloudFormation stacks (the relevant IAM actions are CreateStack, DescribeStacks, UpdateStack and DescribeStackResources).
- The AWS Management Console, or the AWS CLI configured with credentials, if you prefer templates from the command line.
- A template file in JSON or YAML, or a sample template you intend to adapt.
- Optional but useful: a diagram or architecture tool, or a text-based diagram tool, if you want a picture of the stack outside the AWS console.
Step-by-Step
- Decide on a naming convention before you create anything. A practical pattern is
project-environment-stackrole, for exampleshop-prod-networkorshop-dev-web. Because the stack name becomes part of the physical names CloudFormation derives for resources, a readable, stable prefix saves you work later when you are hunting for a resource in the console. Note that menu labels in the console can differ slightly by region and by console version, but the stack creation flow has stayed broadly the same for years. - Check the character rules. Stack names must be alphanumeric or hyphens, must start with a letter, and must be unique within the account and region. Length limits apply, so keep names short: a long project name plus environment plus role can push you over the limit before you notice. Avoid underscores, dots and spaces; they will be rejected.
- Open the CloudFormation console in the correct region and choose Create stack, then the option to build from a template. Upload your template file or paste it in. This is also where you name the stack, so make sure you are in the region you intended: a stack created in the wrong region will not appear where your other resources live.
- Fill in the stack name using the convention from step 1. If your convention includes an environment, be consistent: environments such as dev, staging and prod should differ only in that segment, so that sorting stacks in the console groups them together.
- Give the template parameters and resources clear logical IDs. Logical IDs are the names you write inside the template, such as
WebServerSecurityGrouporDatabaseSubnetGroup. These appear in the console on the Resources tab and in error messages. They cannot contain hyphens and must be alphanumeric, but they can be descriptive; a template full ofResource1andResource2is impossible to troubleshoot. - Set the
Descriptionfield at the top of the template to a single sentence explaining what the stack deploys. The description shows in the stack details, and it is the closest thing CloudFormation has to a built-in caption for the stack. - Use stack tags for anything else you want visible at a glance: owner, cost centre, application, environment. Tags propagate to supported resources and show in the console's stack list, so a reader can tell what a stack is for without opening it.
- Create the stack and wait for it to reach a completed state. Open the Resources tab: this is the authoritative inventory of what the stack actually built, with physical IDs for each resource. Use it as the source for any picture you draw.
- To get a picture, use one of these routes. The first is to export the current template (Template tab, then view or download the template) and open it in a diagram tool that reads CloudFormation or draw your own architecture diagram from the Resources tab. The second is to use AWS's own tooling where it is available in your account and region, since availability varies; check the official documentation for the current service name and region support before relying on it. The third, and the most reliable for documentation, is a manually drawn architecture diagram built from the Resources tab, which is guaranteed to match reality after the stack finishes.
- Capture the picture after every meaningful change. A diagram drawn before an update is a lie once the update adds a load balancer or a queue. Export the template and the resource list at the same time so the picture and the inventory match.
- If you are version-controlling templates (recommended), keep the diagram file next to the template in the same repository and include the stack name and region in the file name, for example
shop-prod-web-us-east-1.png. That way finding the picture for a stack is as quick as finding the stack itself.
Common Mistakes
The most frequent problem is assuming the stack name and the resource names are the same thing. CloudFormation often derives physical names from the stack name plus a logical ID plus a random suffix, so a stack named shop-prod-web may contain a bucket with a long auto-generated name. Never hard-code assumptions about physical names elsewhere.
Second, people reuse the same stack name across regions and then get confused when the delete or update acts on the wrong one. The stack identity is account plus region plus name; the name alone is not unique.
Third, diagrams get drawn from memory rather than from the Resources tab, so they show resources the template does not actually create, or omit ones added by nested stacks. Nested stacks in particular appear as a single resource in the parent, and their contents are only visible by opening the child stack.
Fourth, logical IDs with hyphens or overly generic names cause confusing failures and unreadable output sections. Keep logical IDs descriptive and alphanumeric.
Tips
Prefix stack names with the environment, not the project, if you usually filter by environment: prod-shop-web sorts and groups better than shop-prod-web when you have many environments.
Put the stack name at the top of any diagram, along with the region and the date it was captured. A picture without that context is nearly useless six months later.
Use outputs to surface the handful of things a reader actually needs: the load balancer URL, the database endpoint, the bucket name. Outputs are the machine-readable equivalent of labels on a diagram, and they save anyone reading the stack from digging through the Resources tab.
For templates with many resources, split into nested stacks by concern (network, data, application). Each nested stack gets its own name and its own diagram, and the parent diagram stays small and readable.
Troubleshooting
If stack creation fails with a naming error, check the events list first; the failure message usually names the exact constraint you broke. If the error says the stack name already exists, you may be in a different region than you think, or the stack exists in another account.
If a resource fails because a name is already taken, remember that some services require globally unique names, such as S3 bucket names. Add a naming pattern with an account or random suffix, or let CloudFormation generate the name by omitting the name property.
If your diagram does not match the console, trust the console's Resources tab and redraw. If the Resources tab is empty for what appears to be a missing resource, check whether it lives in a nested stack and open the child stack by following the link in the parent's Resources tab.
If you cannot see a stack at all, confirm your region selector. Stacks are regional and do not follow you across regions. If you see a partial stack stuck in a failed state, review the events from the bottom up, since the earliest failure is the root cause; then roll back and fix the template before retrying rather than repeating the same create.
If a delete or update asked for confirmation and you are unsure what will be removed, check the change set preview before proceeding. Some resources are retained rather than deleted depending on their deletion policy, so verify rather than assume.
Frequently Asked Questions
Does CloudFormation save a picture of my stack?
No. There is no built-in image or diagram stored with a stack. Any picture is generated by you or by an external design or documentation tool.
Can I rename a stack after it is created?
No, a stack cannot be renamed in place. You create a new stack with the new name and the same template, then delete the old one after verifying the new one works.
Are stack names unique across AWS?
No. Names are unique within an account and region only. The same name can exist in another region or another account.
How do I find the physical name of a resource in a stack?
Open the stack in the console and look at the Resources tab, which lists each logical ID with its physical ID. The same information is available from the CLI with describe-stack-resources.
Why do some resources have random suffixes in their names?
When you do not specify a name explicitly in the template, CloudFormation generates one to avoid collisions. This is usually what you want for anything that must be globally unique.
Can I put a diagram inside the template file?
Not as an image. You can include a Description and Metadata, but the template is code and text, so diagrams belong alongside it in your repository rather than inside it.