Terraform
terraform stacks create reference
Use the terraform stacks create
command to create a new Stack in HCP Terraform.
Usage
$ terraform stacks <global-stacks-flags> create -organization-name <value> -project-name <value> -stack-name <value> <options>
Description
The terraform stacks create
command creates a new Terraform Stack in the specified organization and project. You can optionally generate boilerplate configuration using the -with-template
flag.
Options
-organization-name
: The name of the organization to target.- Required.
- String.
- Overrides the ENV VAR
TF_STACKS_ORGANIZATION_NAME
if provided.
-project-name
: The name of the project to target.- Required.
- String.
- Overrides the ENV VAR
TF_STACKS_PROJECT_NAME
if provided.
-stack-name
: The name of the stack to target.- Required.
- String.
- Overrides the ENV VAR
TF_STACKS_STACK_NAME
if provided.
-with-template
: Generate boilerplate configuration.- Optional.
- Boolean flag.
- Default: false.
-json
: Output results in JSON format instead of the default human-readable text format.- Optional.
- Boolean flag.
- Default: false.
Examples
The following command creates a new Stack named "my-stack" in the "my-org" organization and "my-project" project:
$ terraform stacks create -organization-name my-org -project-name my-project -stack-name my-stack
The following command creates a new Stack with boilerplate configuration:
$ terraform stacks create -organization-name my-org -project-name my-project -stack-name my-stack -with-template
The following command creates a new Stack and outputs the result in JSON format:
$ terraform stacks create -organization-name my-org -project-name my-project -stack-name my-stack -json
Global flags
Refer to Global flags reference for information about flags you can use with all commands.