CloudFormation Components
Define CloudFormation stacks in stack manifests when you want Atmos to
deploy them alongside Terraform, Helm, Kubernetes, Helmfile, Packer, and
Ansible components. A CloudFormation component describes which template to
deploy, which parameters and capabilities to pass, and how the stack should
behave for each environment — all deployed directly through the AWS SDK for
Go v2, with no aws CLI or cfn/sam/Rain binary dependency.
Available Configuration Sections
CloudFormation components use the same stack sections as other Atmos components, so the stack can inherit values, run hooks, use Auth, declare dependencies, and be included in affected runs.
metadata- Component behavior, inheritance, and base component selection.
vars- Variables available to stack template rendering.
env- Environment variables applied before CloudFormation operations run.
settingsIntegration metadata and legacy dependency settings, including
settings.aws_cloudformation.region(see Region Resolution).hooksLifecycle event handlers. Only
diff/plan,apply/deploy, anddeletefirebefore/afterevents (before.aws/cloudformation.diff,after.aws/cloudformation.apply, and so on) — every other verb, includingrender,validate,output,fmt,tree,logs,watch,changeset *,drift *,get *,stackset *,list,backend *, andsource *, does not fire hook events.sourceJIT provisioning of a remote template before operations run — see Source Provisioning below.
provisionDelivery targets: the account/region direct-deploy default,
kind: aws/s3(template packaging), orkind: git(a Git deployment repository) — all selectable viaapply --target. A fourth kind,kind: aws/stackset, is not selected throughapply --target; it's used exclusively by thestacksetverb group. See Delivery Targets below for the full picture, includingprovision.backend.enabledauto-provisioning.auth- Component-level Atmos Auth providers, identities, and integrations.
dependencies- Cross-component ordering for
--alland--affectedruns.
CloudFormation components do not support a generate: section — there is
no codegen-artifact output the way Terraform generates backend/provider files.
They also do not support a plugins: section — there is no chart-style plugin
system, unlike native Helm.
CloudFormation-Specific Sections
template/path(one required)The CloudFormation template, provided one of two mutually exclusive ways:
template— an inline template body, either a literal string (a|block scalar, YAML or JSON) or a structured YAML map. Because it's inline stack config, it flows through Atmos's own{{ }}templating pipeline before being sent to CloudFormation — file-based templates (path:) do not get this.path— a file reference: the path to a template file, relative to the component's base path.
Setting both is an error.
stack_name- The explicit CloudFormation stack name. There is no legacy name-pattern interpolation — set the name you want directly (Go templates are supported, like any other stack field).
parametersCloudFormation template parameters as a YAML map. Values are normalized at the API boundary: scalars are stringified, and list values are comma-joined to match CloudFormation's
List<Type>/CommaDelimitedListwire format (the API only accepts strings).UsePreviousValueis not expressible — Atmos config is the source of truth for every parameter on every deploy, the same declarative stance the Terraform component takes toward variables.capabilities- Acknowledged IAM capabilities, e.g.
CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND. tags- A map of
key: valuetags applied to the CloudFormation stack (not to be confused with Atmos's own componenttags/--tagsselection, which is separate). stack_policyProtects specific resources from update during
UpdateStack. Setstack_policy.fileto a stack policy JSON document path, relative to the component's base path. Applied after a successfulapply.role_arn- IAM role ARN that CloudFormation assumes to deploy the stack.
notification_arns- SNS topic ARNs that CloudFormation publishes stack events to.
disable_rollback- Prevents automatic rollback on stack creation failure.
termination_protectionPrevents the stack from being deleted.
atmos aws cloudformation deleterespects this and fails with an actionable hint instead of silently disabling it — pass--disable-termination-protectionto delete anyway. Setting this tofalseand re-applying does not disable protection: apply only ever turns protection on, never off.timeout_in_minutes- Bounds how long stack creation may run before CloudFormation rolls back.
Example
Inline templates skip the on-disk file entirely and support two forms — a literal string body, or a structured map:
Component Directory Structure
CloudFormation components are located under
components."aws/cloudformation".base_path from atmos.yaml (defaults to
components/cloudformation):
components/cloudformation/
└── vpc/
├── template.yaml
└── stack-policy.json
Source Provisioning
Point a component at a remote template through the top-level source:
section — the same JIT vendoring used by other component types — instead of
committing the template to your infrastructure repository. Two shapes are
supported:
- Directory/subdirectory source
Any go-getter URI (Git, HTTP archive, S3, OCI) pointing at a directory. The component directory (template, stack policy, and any local assets) is vendored, and
path:resolves relative to it, exactly like other component types'source:behavior.components:"aws/cloudformation":vpc:source:uri: github.com/acme/cfn-templates.git//vpc?ref={{ .Version }}version: 1.2.0path: template.yaml- Single-file source
When the
source.uriresolves to exactly one file — a bare template URI, with no surrounding directory structure — Atmos fetches it directly as the component'spath:file. A CloudFormation component is often exactly one file, and demanding a directory structure around it would be ceremony.components:"aws/cloudformation":dns:source:uri: https://raw.githubusercontent.com/acme/cfn-templates/v1.2.0/dns.yamlpath:does not need to be set in the single-file case — Atmos names the vendored file after the source URI's basename and uses it directly.
aws/cloudformation components cannot be vendored through a vendor.yaml
manifest (atmos vendor pull) — only the source:-based JIT provisioning
described above, the same restriction native Helm and Kubernetes components
have. Use source: for every CloudFormation component that isn't authored
directly in your infrastructure repository.
Delivery Targets
By default, apply/deploy deploy directly to the account/region resolved
for the component (see
Region Resolution)
via CreateChangeSet/ExecuteChangeSet — this is the implicit behavior when
--target is omitted and no provision.default is set. A component can
declare additional named targets under provision.targets, selected with
--target:
kind: aws/s3Uploads the template to S3 and stops — a publish-only target, useful for a review step or a template too large to pass inline. This same target is also used automatically to package (upload) any template that exceeds CloudFormation's 51,200-byte inline size limit, whichever target is selected for the deploy.
bucketandregionare both required:regionbuilds thehttps://S3 URL passed asCreateChangeSet'sTemplateURL(AWS rejects a bares3://URI there), so it can't be left to be inferred later.components:"aws/cloudformation":vpc:provision:targets:packaged:kind: aws/s3bucket: my-cfn-artifactsprefix: templatesregion: us-east-1The bucket must exist before
apply/deployuploads to it — either provision it explicitly withatmos aws cloudformation backend create, or setprovision.backend.enabled: true(a sibling oftargets, not nested under a target) to haveapply/deploycreate it automatically the first time it's missing. Auto-provisioning only runs the existence check up front — it never reconciles a bucket that already exists, unlikebackend create/updaterun explicitly, which always re-applies the secure defaults (versioning, encryption, public access blocking, tags).components:"aws/cloudformation":vpc:provision:backend:enabled: truetargets:packaged:kind: aws/s3bucket: my-cfn-artifactsregion: us-east-1kind: gitCommits the template YAML to a Git repository (declared in
git.repositories) instead of deploying it — for example, a review or GitOps-style pipeline that applies from the committed template separately. Follows the sameprovision.targetsshape used by native Helm and Kubernetes components.kind: aws/stacksetDelivers to a multi-account/multi-region CloudFormation StackSet instead of a single-account/region stack. Unlike
kind: aws/s3andkind: git, anaws/stacksettarget is not selected throughapply --target— it is used exclusively by theatmos aws cloudformation stacksetverb group, and only bycreate/update, which resolve it to learn the target accounts/regions/permission model.deleteandinstancesact directly onstack_name(the StackSet's own name) and don't resolve or require aprovision.targetsentry.components:"aws/cloudformation":vpc:provision:targets:multi-account:kind: aws/stacksetaccounts:- "111111111111"- "222222222222"regions:- us-east-1- us-west-2permission_model: SELF_MANAGEDadministration_role_arn: arn:aws:iam::111111111111:role/AWSCloudFormationStackSetAdministrationRoleexecution_role_name: AWSCloudFormationStackSetExecutionRoleaccounts- Target AWS account IDs for stack instances.
regions- Target AWS regions for stack instances.
permission_modelSELF_MANAGED(default) orSERVICE_MANAGED.administration_role_arn- IAM role ARN CloudFormation assumes to create/manage the StackSet (self-managed permissions).
execution_role_name- IAM role name CloudFormation assumes in each target account (self-managed permissions).
stackset createcreates the StackSet's initial stack instances only when bothaccountsandregionsare set;stackset updateupdates the template/parameters/capabilities and propagates the change to every existing instance, without changing which accounts/regions have one.
Related
atmos aws cloudformationcommand referenceatmos aws cloudformation stacksetcommand reference- CloudFormation
atmos.yamlconfiguration - Component dependencies