Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/terraform-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'Terraform-ci'

on: [push, pull_request]

defaults:
run:
shell: sh

jobs:
# Terraform validate configuration
terraform-validate:
name: 'Terraform-validate'
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:0.14.6
env:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Terraform Init l1
working-directory: ./terraform/layer1-aws
run: terraform init -backend=false
- name: Terraform Init l2
working-directory: ./terraform/layer2-k8s
run: terraform init -backend=false
- name: Terraform Validate l1
working-directory: ./terraform/layer1-aws
run: terraform validate -no-color .
- name: Terraform Validate l2
working-directory: ./terraform/layer2-k8s
run: terraform validate -no-color .

# Checks that all Terraform configuration files format
terraform-format:
name: 'Terraform-format'
runs-on: ubuntu-latest
container:
image: hashicorp/terraform:0.14.6
env:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Terraform Format
run: terraform fmt -recursive -write=false -check .

# Checks that all Terraform configuration files tflint
terraform-tflint:
name: 'Terraform-tflint'
runs-on: ubuntu-latest
container:
image: wata727/tflint
env:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Terraform tflint l1
working-directory: ./terraform/layer1-aws
run: tflint --no-color
- name: Terraform tflint l2
working-directory: ./terraform/layer2-k8s
run: tflint --no-color
6 changes: 3 additions & 3 deletions terraform/modules/aws-ec2-pritunl/efs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ resource "aws_efs_file_system" "this" {
kms_key_id = var.kms_key_id

tags = {
"Name" = var.name
}
"Name" = var.name
}
lifecycle {
ignore_changes = [
tags,
Expand All @@ -17,7 +17,7 @@ resource "aws_efs_file_system" "this" {
}

resource "aws_efs_mount_target" "this" {
count = length(var.public_subnets)
count = length(var.public_subnets)
file_system_id = aws_efs_file_system.this.id
subnet_id = var.public_subnets[count.index]
security_groups = [
Expand Down