Skip to main content

atmos terraform deploy

purpose

Use this command to execute terraform apply -auto-approve on an Atmos component in an Atmos stack.

Usage

Execute the terraform deploy subcommand like this:

atmos terraform deploy <component> -s <stack>
  • atmos terraform deploy command supports --deploy-run-init=true|false flag to enable/disable running terraform init before executing the command

  • atmos terraform deploy command automatically sets -auto-approve flag when running terraform apply

  • atmos terraform deploy command supports --from-plan flag. If the flag is specified, the command will use the planfile previously generated by atmos terraform plan command instead of generating a new planfile, e.g. atmos terraform deploy <component> -s <stack> --from-plan. Note that in this case, the planfile name is in the format supported by Atmos and is saved to the component's folder

  • atmos terraform deploy command supports --planfile flag to specify the path to a planfile. The --planfile flag should be used instead of the planfile argument in the native terraform apply <planfile> command. For example, you can execute the command atmos terraform plan <component> -s <stack> -out=<FILE>, which will save the generated plan to a file on disk, and then execute the command atmos terraform deploy <component> -s <stack> --planfile <FILE> to apply the previously generated planfile

See all flags.


tip

Run atmos terraform deploy --help to see all the available options

Examples

atmos terraform deploy top-level-component1 --stack tenant1-ue2-dev
atmos terraform deploy top-level-component1 -s tenant1-ue2-dev --from-plan
atmos terraform deploy top-level-component1 -s tenant1-ue2-dev --planfile <path_to_planfile>
atmos terraform deploy infra/vpc -s tenant1-ue2-staging
atmos terraform deploy test/test-component -s tenant1-ue2-dev
atmos terraform deploy test/test-component-override-2 -s tenant2-ue2-prod
atmos terraform deploy test/test-component-override-3 -s tenant1-ue2-dev

Arguments

ArgumentDescriptionRequired
componentAtmos terraform componentyes

Flags

FlagDescriptionAliasRequired
--stackAtmos stack-syes
--dry-runDry runno
--deploy-run-initEnable/disable running terraform init before executing the commandno
--from-planIf the flag is specified, use the planfile previously generated by Atmos instead of
generating a new planfile. The planfile name is in the format supported by Atmos
and is saved to the component's folder
no
--planfileThe path to a planfile. The --planfile flag should be used instead of the planfile
argument in the native terraform apply <planfile> command
no

note

The atmos terraform deploy command supports all native terraform apply options described in Terraform apply options, with the exception that a planfile argument can't be provided on the command line. To use a previously generated planfile, use the --from-plan or --planfile command-line flags