You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/terraform-docs-common/docs/cloud-docs/stacks/create.mdx
+75-10Lines changed: 75 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,26 +10,32 @@ Stacks enable you to provision and coordinate your infrastructure lifecycle at s
10
10
11
11
> **Hands-on**: Try out the [Deploy a Stack with HCP Terraform](/terraform/tutorials/cloud/stacks-deploy) tutorial to get started with Stacks quickly.
12
12
13
-
This article explains how to create a Stack in HCP Terraform using component and deployment configuration files.
13
+
Before creating a Stack in HCP Terraform, write a [component configuration file](/terraform/language/stacks/component/config) to define your Stack's infrastructure, and a [deployment configuration file](/terraform/language/stacks/deploy/config) to tell HCP Terraform how to deploy your Stack.
14
14
15
15
## Requirements
16
16
17
+
<Note>
18
+
17
19
Stacks are not available for users on legacy HCP Terraform team plans. Learn more about [migrating to current HCP Terraform plans](/terraform/cloud-docs/overview/migrate-teams-standard).
18
20
19
-
To create a Stack in HCP Terraform, you must set up the following:
20
-
must also be a member of a team in your organization with one of the following permissions:
21
-
*[Organization-level **Manage all projects**](/terraform/cloud-docs/users-teams-organizations/permissions#manage-all-projects)
22
-
*[Project-level **Maintain**](/terraform/cloud-docs/users-teams-organizations/permissions#maintain) or higher
21
+
</Note>
22
+
23
+
To create a Stack in HCP Terraform, you must be a member of a team in your organization with one of the following permissions:
24
+
-[Organization-level **Manage all projects**](/terraform/cloud-docs/users-teams-organizations/permissions#manage-all-projects)
25
+
-[Project-level **Maintain**](/terraform/cloud-docs/users-teams-organizations/permissions#maintain) or higher
23
26
24
27
## Create a Stack
25
28
26
-
You can create a Stack
29
+
You can create a Stack using any of the following methods:
30
+
- The [HCP Terraform API](/terraform/cloud-docs/api-docs/stacks)
31
+
- The HCP Terraform UI
32
+
- The Terraform CLI
27
33
28
-
<!--TODO:isthisstilltruepastGA?-->
34
+
If you are creating a Stack in an organization for the first time, you must enable Stacks for your organization. Navigate to your organization’s **Settings** page, and in the **General** settings, check the box next to **Stacks**.
Stacks live alongside workspaces in a project. To create a new Stack in HCP Terraform UI, perform the following steps:
33
39
34
40
1. Sign in to [HCP Terraform](https://app.terraform.io), and select the organization that contains your Stack.
35
41
1. In the navigation menu, click **Projects** under **Manage**.
@@ -47,6 +53,65 @@ Stacks live alongside workspaces in a project. To create a new Stack in HCP Terr
47
53
* By default, HCP Terraform fetches your Stack's configuration after creating your Stack. To fetch your Stack configuration manually, uncheck **Fetch configuration after HCP Terraform creates stack.**
48
54
1. Click **Create Stack**.
49
55
56
+
### Terraform CLI workflow
57
+
58
+
Stacks live alongside workspaces in an HCP Terraform project. To create a new Stack using the Terraform CLI, perform the following steps:
59
+
60
+
1. Create an account or sign in to [HCP Terraform](https://app.terraform.io).
61
+
1. Run `terraform login` to authenticate with HCP Terraform. Alternatively, you can manually configure credentials in the CLI config file or through environment variables. Refer to [CLI Configuration](/terraform/cli/config/config-file#environment-variable-credentials) for details.
62
+
1. Run the `terraform stacks create` command, replacing the placeholders with your organization name, project name, and desired Stack name:
A Stack name must be unique within the project and can include letters, numbers, dashes (`-`), and underscores (`_`). We recommend using 90 characters or less for the name of your Stack.
69
+
70
+
After running the command, you can view your new Stack in the HCP Terraform UI, or by running the `terraform stacks list` command:
71
+
72
+
```shell-session
73
+
$ terraform stacks list -organization <ORGANIZATION_NAME> -project <PROJECT_NAME>
74
+
```
75
+
76
+
After creating your Stack, you can push up your Stack component and deployment configuration files to create a new configuration version. Use the `terraform stacks configuration upload` command to manually upload your configuration files:
The Terraform CLI uploads the configuration files, and returns a new configuration version ID and sequence number:
83
+
84
+
```shell-session
85
+
Uploading stack configuration...
86
+
87
+
Configuration for Stack (id: 'st-MLQLSJVrdtGazA4aU') was uploaded
88
+
Configuration ID: stc-6fSRO81hOzTPKMM
89
+
Sequence Number: 1
90
+
91
+
See run at: <URL>
92
+
```
93
+
94
+
A Stack configuration version is a snapshot of all of the pieces that make up your Stack. Each configuration version creates a deployment run for every deployment of your Stack in order to implement the changes in that version. To learn more, refer to [Stack deployment runs](/terraform/cloud-docs/stacks/runs).
95
+
96
+
After uploading your configuration, you can watch your Stack's configuration roll out using `terraform stacks configuration watch` to review a list of the deployment groups in your configuration:
You can continue to use the `terraform stacks` CLI commands to directly approve deployment runs, review configuration versions, and manage your Stack. To learn more, refer to the [`terraform stacks` commands](/terraform/cli/commands/stacks).
112
+
113
+
Note that though you can create a Stack from the Terraform CLI, you cannot deploy a Stack locally. You can only deploy a Stack remotely in HCP Terraform, or by running your a Stack on a custom HCP Terraform agent. To learn more, refer to [Stack deployment runs](/terraform/cloud-docs/stacks/runs).
After creating your Stack, you can continue to iterate on your configuration and [review configuration versions](/terraform/cloud-docs/stacks/deploy/configuration-versions) or learn how to [review your Stack’s deployment runs](/terraform/cloud-docs/stacks/deploy/runs).
Copy file name to clipboardExpand all lines: content/terraform-docs-common/docs/cloud-docs/stacks/deploy/runs.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,11 @@ description: Learn how to review deployment plans in HCP Terraform Stacks.
4
4
tfc_only: true
5
5
---
6
6
7
-
# Review deployment plans
7
+
# Review deployment runs
8
8
9
-
Deployment plans are a combination of an individual configuration version and one of your Stack's deployments. As in the traditional Terraform workflow, HCP Terraform creates plans every time a new configuration version introduces potential changes for a deployment.
9
+
Deployment runs are a combination of an individual configuration version and one of your Stack's deployments. As in the traditional Terraform workflow, HCP Terraform creates runs every time a new configuration version introduces potential changes for a deployment.
10
10
11
-
This guide explains how to review and approve deployment plans in HCP Terraform.
11
+
This guide explains how to review and approve deployment runs in HCP Terraform.
Copy file name to clipboardExpand all lines: content/terraform-docs-common/docs/cloud-docs/stacks/runs.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: |-
5
5
tfc_only: true
6
6
---
7
7
8
-
# Stack runs
8
+
# Stack deployment runs
9
9
10
10
HCP Terraform is the interface for keeping track of your Stack configuration over time and the corresponding deployments for each version of your configuration. Learn how HCP Terraform executes Terraform runs to keep Stack deployments up to date.
0 commit comments