Deploy stacks
Deploy stacks within the given command path.
Takomo also deploys stacks that the stacks within the command path depend on, even if they are outside the given command path. Takomo arranges the stacks in deployment order by stack dependencies, ensuring that it deploys the stacks in the correct order and in parallel when possible.
Takomo deletes stacks whose creation have failed earlier and then recreates them. Such failed stacks can't be updated, and deleting them is the only possible operation.

Usage

1
tkm stacks deploy [command-path] \
2
[--ignore-dependencies] \
3
[--interactive|-i] \
4
[--expect-no-changes] \
5
[--output <format>]
Copied!

Positional arguments

  • command-path
    • Command path to select which stacks to deploy.
    • Optional, by default, Takomo deploys all stacks.

Options

In addition to the common options, this command has the following options.
  • --ignore-dependencies
    • Ignore stack dependencies. By default, when a stack is deployed, its dependencies are deployed first, and then the stack itself. In some exceptional cases, you might want to deploy just one stack and skip its dependencies.
    • Bear in mind that this option is supported only when exactly one stack is deployed. Ignoring dependencies may lead into unexpected results, so you should use this option only in exceptional circumstances.
  • --interactive, -i
    • Choose the command path using autocompleting search.
  • --expect-no-changes
    • Fail the deployment if at least one stack has changes.
  • --output <format>
    • Print the command result using this format
    • Supported values: text, json, yaml

IAM permissions

These are the minimum IAM permissions required to run this command.
1
# Minimum permissions. Additional permissions are needed to actually
2
# modify resources defined in the CloudFormation templates.
3
Statement:
4
- Sid: CloudFormation
5
Effect: Allow
6
Action:
7
- cloudformation:CancelUpdateStack
8
- cloudformation:DescribeStackEvents
9
- cloudformation:CreateStack
10
- cloudformation:GetTemplate
11
- cloudformation:DeleteStack
12
- cloudformation:UpdateStack
13
- cloudformation:CreateChangeSet
14
- cloudformation:DescribeChangeSet
15
- cloudformation:DeleteChangeSet
16
- cloudformation:ValidateTemplate
17
- cloudformation:DescribeStacks
18
- cloudformation:GetTemplateSummary
19
- cloudformation:UpdateTerminationProtection
20
Resource: "*"
21
22
# S3 permissions needed only if a template bucket is used.
23
# Specify resource to restrict access to specific buckets.
24
- Sid: S3
25
Effect: Allow
26
Action:
27
- s3:PutObject
28
Resource: "*"
29
30
# IAM permissions needed only if command roles are used
31
# Specify resource to restrict access to specific roles.
32
- Sid: IAM
33
Effect: Allow
34
Action:
35
- sts:AssumeRole
36
Resource: "*"
Copied!

Examples

Deploy all stacks:
1
tkm stacks deploy
Copied!
Deploy stacks within the given command path:
1
tkm stacks deploy /prod
Copied!
Deploy only /dev/vpc.yml stack and its dependencies:
1
tkm stacks deploy /dev/vpc.yml
Copied!
The region part must be specified if the stack has more than one region and you want to deploy it to only one region.
1
tkm stacks deploy /dev/vpc.yml/eu-west-1
Copied!
Deploy exactly one stack and skip its dependencies:
1
tkm stacks deploy /cloudtrail.yml --ignore-dependencies
Copied!
Last modified 2mo ago