Terraform
terraform stacks configuration fetch reference
Use the terraform stacks configuration fetch
command to fetch the latest Stack configuration from VCS.
Usage
$ terraform stacks <global-stacks-flags> configuration fetch <options>
Description
The terraform stacks configuration fetch
command retrieves the latest configuration from a version control system (VCS) for a Stack connected to a VCS repository. You can identify the target Stack either by providing a Stack ID directly, or by specifying the organization name, project name, and Stack name combination.
Options
-organization-name
: The name of the organization to target.- Optional when using
-stack-id
, required when using name-based targeting. - String data type.
- Overrides the ENV VAR
TF_STACKS_ORGANIZATION_NAME
if provided.
- Optional when using
-project-name
: The name of the project to target.- Optional when using
-stack-id
, required when using name-based targeting. - String data type.
- Overrides the ENV VAR
TF_STACKS_PROJECT_NAME
if provided.
- Optional when using
-stack-name
: The name of the stack to target.- Optional when using
-stack-id
, required when using name-based targeting. - String data type.
- Overrides the ENV VAR
TF_STACKS_STACK_NAME
if provided.
- Optional when using
-stack-id
: The ID of the stack to fetch for.- Optional (but required if not using
-stack-name
). - String data type.
- Has precedence over the
-stack-name
if both are provided.
- Optional (but required if not using
-json
: Output results in JSON format.- Optional.
- Boolean flag.
- Default is false (human-readable output).
Examples
The following command fetches configuration for a Stack using organization, project, and Stack names:
$ terraform stacks configuration fetch -organization-name my-org -project-name my-project -stack-name my-stack
The following command fetches configuration for a Stack using the Stack ID:
$ terraform stacks configuration fetch -stack-id stack-abc123def456
The following command fetches configuration and outputs the result in JSON format:
$ terraform stacks configuration fetch -stack-id stack-abc123def456 -json
Global flags
Refer to Global flags reference for information about flags you can use with all commands.