Skip to content

Commit f21f709

Browse files
committed
Updates during testing of TF 1.0.1
1 parent 4afa207 commit f21f709

File tree

8 files changed

+29
-64
lines changed

8 files changed

+29
-64
lines changed

.github/workflows/terraform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup Terraform
2626
uses: hashicorp/setup-terraform@v1
2727
with:
28-
terraform_version: 0.15.4
28+
terraform_version: 1.0.1
2929

3030
- name: Terraform Format
3131
id: fmt

03-basics/aws-backend/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
Steps to initialize backend in AWS and manage it with Terraform:
22

33
1) Use config from `bootstrap` (init, plan, apply) to provision s3 bucket and dynamoDB table with local state
4-
2) copy state file into import-bootstrap
5-
1) cp terraform.tfstate ../import-bootstrap
6-
3) Initialize within `import-bootstrap` using `terraform init`
7-
4) Uncomment out s3 backend provider:
8-
4+
2) Uncomment the remote backend configuration
95
```
106
backend "s3" {
117
bucket = "devops-directive-tf-state"
@@ -16,7 +12,7 @@ Steps to initialize backend in AWS and manage it with Terraform:
1612
}
1713
```
1814

19-
4) Reinitialize with `terraform init`:
15+
1) Reinitialize with `terraform init`:
2016

2117
```
2218
Do you want to copy existing state to the new backend?

03-basics/aws-backend/import-bootstrap/main.tf

Lines changed: 0 additions & 47 deletions
This file was deleted.

03-basics/aws-backend/bootstrap/main.tf renamed to 03-basics/aws-backend/main.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
terraform {
2-
# THIS BACKEND CONFIG GETS UNCOMMENTED IN IMPORT-BOOTSTRAP
2+
#############################################################
3+
## AFTER RUNNING TERRAFORM APPLY (WITH LOCAL BACKEND)
4+
## YOU WILL UNCOMMENT THIS CODE THEN RERUN TERRAFORM INIT
5+
## TO SWITCH FROM LOCAL BACKEND TO REMOTE AWS BACKEND
6+
#############################################################
37
# backend "s3" {
4-
# bucket = "devops-directive-tf-state"
8+
# bucket = "devops-directive-tf-state" # REPLACE WITH YOUR BUCKET NAME
59
# key = "03-basics/import-bootstrap/terraform.tfstate"
610
# region = "us-east-1"
711
# dynamodb_table = "terraform-state-locking"
@@ -21,7 +25,7 @@ provider "aws" {
2125
}
2226

2327
resource "aws_s3_bucket" "terraform_state" {
24-
bucket = "devops-directive-tf-state"
28+
bucket = "devops-directive-tf-state" # REPLACE WITH YOUR BUCKET NAME
2529
force_destroy = true
2630
versioning {
2731
enabled = true

06-organization-and-modules/web-app/main.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ provider "aws" {
2121
region = "us-east-1"
2222
}
2323

24-
variable "db_pass" {
25-
description = "password for database"
24+
variable "db_pass_1" {
25+
description = "password for database #2"
26+
type = string
27+
sensitive = true
28+
}
29+
30+
variable "db_pass_2" {
31+
description = "password for database #2"
2632
type = string
2733
sensitive = true
2834
}
@@ -39,7 +45,7 @@ module "web_app_1" {
3945
create_dns_zone = true
4046
db_name = "webapp1db"
4147
db_user = "foo"
42-
db_pass = var.db_pass
48+
db_pass = var.db_pass_1
4349
}
4450

4551
module "web_app_2" {
@@ -53,6 +59,6 @@ module "web_app_2" {
5359
instance_type = "t2.small"
5460
create_dns_zone = true
5561
db_name = "webapp2db"
56-
db_user = "foo"
57-
db_pass = var.db_pass
62+
db_user = "bar"
63+
db_pass = var.db_pass_2
5864
}

08-testing/tests/terratest/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
How to run this test?
2+
3+
Build, then run...
4+
5+
`go test -v timeout 10m`
6+

08-testing/tests/terratest/hello_world_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestTerraformHelloWorldExample(t *testing.T) {
2323
instanceURL := terraform.Output(t, terraformOptions, "url")
2424
tlsConfig := tls.Config{}
2525
maxRetries := 30
26-
timeBetweenRetries := 5 * time.Second
26+
timeBetweenRetries := 10 * time.Second
2727

2828
http_helper.HttpGetWithRetryWithCustomValidation(
2929
t, instanceURL, &tlsConfig, maxRetries, timeBetweenRetries, validate,

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Introduces the concepts of variables which enable Terraform configurations to be
2626

2727
## 05 - Language Features
2828

29-
Describes additional features of the Hashicorp Programming Language.
29+
Describes additional features of the Hashicorp Configuration Language (HCL).
3030

3131
## 06 - Organization and Modules
3232

0 commit comments

Comments
 (0)