Skip to content

Commit 17db88d

Browse files
hootiebenantonbabenko
authored andcommitted
Output var.name (#303)
1 parent 979f591 commit 17db88d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.circleci/config.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,22 @@ terraform: &terraform
88
jobs:
99
validate:
1010
<<: *terraform
11+
environment:
12+
AWS_DEFAULT_REGION: us-east-1
1113
steps:
1214
- checkout
15+
- run:
16+
name: Install curl
17+
command: apk add --update curl
1318
# - run:
1419
# name: Add github.com to ~/.ssh/known_hosts
1520
# command: mkdir ~/.ssh && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
1621
- run:
1722
name: terraform init
18-
command: terraform init -input=false
23+
command: find . -type f -name "*.tf" -exec dirname {} \;|sort -u | while read m; do (cd "$m" && terraform init -input=false -backend=false) || exit 1; done
1924
- run:
2025
name: Validate Terraform configurations
21-
command: find . -type f -name "*.tf" -exec dirname {} \;|sort -u | while read m; do (terraform validate -check-variables=false "$m" && echo "√ $m") || exit 1 ; done
26+
command: find . -name ".terraform" -prune -o -type f -name "*.tf" -exec dirname {} \;|sort -u | while read m; do (cd "$m" && terraform validate && echo "√ $m") || exit 1 ; done
2227
- run:
2328
name: Check if Terraform configurations are properly formatted
2429
command: if [[ -n "$(terraform fmt -write=false)" ]]; then echo "Some terraform files need be formatted, run 'terraform fmt' to fix"; exit 1; fi

outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,3 +624,7 @@ output "azs" {
624624
value = var.azs
625625
}
626626

627+
output "name" {
628+
description = "The name of the VPC"
629+
value = var.name
630+
}

0 commit comments

Comments
 (0)