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
@@ -104,17 +98,21 @@ Back at Terraform Enterprise, you’ll see that it’s connected.
104
98
105
99
Finally, we’re ready to fully create a Terraform Enterprise workspace. Go to https://app.terraform.io and click the "New Workspace" button at the top right.
106
100
107
-
Give it a name such as "training-demo".
101
+
Give it a name such as "training-lab01".
108
102
109
-
GitHub is our only VCS connection. Click the "Repository" field and you’ll see a list of available repositories in an auto-complete menu. Find the `demo-terraform-101` repo. If yours isn’t here, refresh the page.
103
+
- Choose GitHub as VCS connection.
104
+
- Click the "Repository" field and you’ll see a list of available repositories in an auto-complete menu. Find the `aws-terraform-workshop` repo. If yours isn’t here, refresh the page.
110
105
111
-

106
+

112
107
113
-
Terraform Enterprise can deploy from any branch. We'll use the `after-tfe` branch which has been minimally modified to work with Terraform Enterprise.
108
+
- Click the "More Options" link
109
+
-**TERRAFORM WORKING DIRECTORY:** By default Terraform will use repository root directory. In this case we will specify `lab01-gettingstarted`.
114
110
115
-

111
+
-**VCS BRANCH:** Terraform Enterprise can deploy from any branch. We'll use the default branch; alternatively you can specify `master`.
116
112
117
-
Click the "More Options" link and scroll down to "VCS Branch." Type `after-tfe` to use that branch.
113
+

114
+
115
+
- Click the **Create Workspace** button.
118
116
119
117
You’ll see a screen showing that a Terraform Enterprise workspace is connected to your GitHub repository. But we still need to provide Terraform with our secret key, access key, and other variables defined in the Terraform code as variables.
120
118
@@ -125,9 +123,11 @@ Go to the "Variables" tab. On the variables page, you'll see there are two kind
125
123
- Terraform variables: these are fed into Terraform, similar to `terraform.tfvars`
126
124
- Environment variables: these are populated in the runtime environment where Terraform executes
127
125
128
-
In the top "Terraform Variables" section, click "Edit" and add keys and values for all the variables in the project's `variables.tf` file. The only one you'll need initially is `identity` which is your unique animal name.
126
+
### Step 2.2: Enter Terraform Variables
127
+
128
+
In the top "Terraform Variables" section, click "Edit" and add keys and values for all the variables in the project's `variables.tf` file. The only one you'll need initially is `identity` which is a your username.
129
129
130
-
### Step 2.1: Enter AWS Credentials
130
+
### Step 2.3: Enter AWS Credentials as Environment Variables
131
131
132
132
There is also a section for environment variables. We'll use these to store AWS credentials.
133
133
@@ -136,10 +136,11 @@ Click "Edit" and add variables for your AWS credentials.
136
136
```bash
137
137
AWS_ACCESS_KEY_ID="AAAA"
138
138
AWS_SECRET_ACCESS_KEY="AAAA"
139
-
AWS_DEFAULT_REGION="us-west-2"
140
139
```
141
140
142
-
Click the "Save" button.
141
+
Click the "Save Variable" button. Optionally you can mark these variables as Sensitive, which will make them write-only.
@@ -153,52 +154,11 @@ Go to the "Runs" tab, or "Latest Run". Find the most recent one (there will prob
153
154
154
155
Scroll down to where it shows the plan. Click the button to "View Plan." You’ll see the same kind of output that you are used to seeing on the command line.
155
156
156
-
We'll make another change from GitHub before running this plan, so click "Discard Plan."
157
-
158
-
## Task 4: Edit Code on GitHub to Upgrade the AWS Provider Version
159
-
160
-
Edit code on GitHub to upgrade the AWS provider version to `>= 1.20.0`.
161
-
162
-
You'll make a pull request with these changes and observe the status of the pull request on GitHub.
163
-
164
-
### Step 4.1
165
-
166
-
On GitHub, find the "Branch" pulldown and switch to the `after-tfe` branch.
167
-
168
-
Navigate to `main.tf`. Find the pencil icon. Click to edit this file directly in the browser.
169
-
170
-

171
-
172
-
Edit the code to match the lines below.
173
-
174
-
```bash
175
-
provider "aws" {
176
-
# MODIFY this line to look for 1.20.0 or greater
177
-
version = ">= 1.20.0"
178
-
}
179
-
```
180
-
181
-
Scroll to the bottom and select the option to "Create a new branch and start a pull request."
182
-
183
-

184
-
185
-
You’ll be taken to a screen to create a pull request. Click the green "Propose file change" button. The page will be pre-populated with your commit message. Click "Create pull request."
186
-
187
157
After a few seconds, you'll see that Terraform Enterprise checked the plan and that it passed.
188
158
189
-

190
-
191
-
To see what was checked, click "Show all checks" and click "Details" next to the line that says "Terraform plan has changes."
192
-
193
-
Merge the pull request to the `after-tfe` branch with the big green "Merge pull request" button. Click the "Confirm merge" button.
194
-
195
-
## Task 5: Confirm and Apply the Plan
196
-
197
-
### Step 5.1: Confirm and `apply`
198
-
199
-
Back at Terraform Enterprise, find the "Current Run" tab. Click it and you’ll see the merge commit has triggered a plan and it needs confirmation.
159
+
## Task 4: Confirm and Apply the Plan
200
160
201
-

161
+
### Step 4.1: Confirm and `apply`
202
162
203
163
Scroll to the bottom of the run and confirm the `plan`. At the bottom of the page you’ll see a place to comment (optional) and click "Confirm & Apply."
204
164
@@ -210,11 +170,11 @@ Examine the output of `apply` and find the IP address of the new instance. The o
210
170
211
171

212
172
213
-
## Task 6: Destroy
173
+
## Task 5: Destroy
214
174
215
175
To clean up, destroy the infrastructure you've just created.
216
176
217
-
### Step 6.1: Configure CONFIRM_DESTROY variable
177
+
### Step 5.1: Configure CONFIRM_DESTROY variable
218
178
219
179
Go to the "Settings" tab in Terraform Enterprise and scroll to the bottom. Note the instructions under "Workspace Delete." We want to destroy the infrastructure but not necessarily the workspace.
220
180
@@ -226,7 +186,7 @@ Go to the "Variables" tab and do that.
226
186
227
187
Click "Add" and "Save".
228
188
229
-
### Step 6.2: Queue destroy plan
189
+
### Step 5.2: Queue destroy plan
230
190
231
191
It's sometimes necessary to queue a normal plan and then queue the destroy plan.
0 commit comments