Skip to content

Commit

Permalink
ci to test terraform 12 and 13 versions
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshutch committed Oct 6, 2020
1 parent 46e811d commit 88004bb
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
pull_request:
branches: [master]
types: [opened, reopened, synchronize, edited]
env:
tf_version: "0.12.26" # must match value in examples/ci/ci.tf

jobs:
env:
Expand All @@ -18,7 +16,14 @@ jobs:
matrix='{
"env":[
{
"tf_working_dir":"./examples/ci",
"tf_version":"0.13.2",
"tf_working_dir":"./examples/ci-13",
"aws_key_name":"byu_oit_terraform_dev_key",
"aws_secret_name":"byu_oit_terraform_dev_secret"
},
{
"tf_version":"0.12.26",
"tf_working_dir":"./examples/ci-12",
"aws_key_name":"byu_oit_terraform_dev_key",
"aws_secret_name":"byu_oit_terraform_dev_secret"
}
Expand All @@ -41,7 +46,7 @@ jobs:
- name: Terraform Setup
uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ env.tf_version }}
terraform_version: ${{ matrix.env.tf_version }}

- name: Terraform Format
working-directory: "./"
Expand All @@ -66,7 +71,7 @@ jobs:
- name: Terraform Setup
uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ env.tf_version }}
terraform_version: ${{ matrix.env.tf_version }}

- name: Terraform Init
working-directory: ${{ matrix.env.tf_working_dir }}
Expand Down
2 changes: 1 addition & 1 deletion examples/ci/ci.tf → examples/ci-12/ci.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
}

provider "aws" {
version = ">= 2.42"
version = "~> 3.0"
region = "us-west-2"
}

Expand Down
32 changes: 32 additions & 0 deletions examples/ci-13/ci.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
terraform {
required_version = "0.13.2"
}

provider "aws" {
version = "~> 3.0"
region = "us-west-2"
}

module "bastion" {
source = "../../"
env = "dev"
vpc_vpn_to_campus = false
netid = "githubac"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwWVPlHpRiXGBmB/VG6PUeJ/Ev+Y39n5PBI4DW3ZMDT1g32nEUjzKtxK6KwVzYFQBhReMO2ry4uSTiNIzuOtHk/OCfcdPc8wbW3RlHBgbqs6p7DfYRJAXJCnWEjovijaVY0lyL4+7/YuprZwBaA2NfUIRN8UwVxZck3ULMnCK6BKog0UAE9NQZ9Z0vAtgLYPo9eVJEuGrxEszN29X+4Fl6u3T8x0XQ9EoMWU4YNwKfzBIof3th9Cbv4+FlEKpOFYuCc5vB2NPotalN8phEUqnvtsDkmCLAop6+MrUlnNNYIzmh2RLeqDF+M/ZnX8xb+V/mT9vARVcdcYCxKYeyXLvT example"
}

output "connect" {
value = module.bastion.connect
}

output "ec2_instance" {
value = module.bastion.ec2_instance
}

output "security_group" {
value = module.bastion.security_group
}

output "key_pair" {
value = module.bastion.key_pair
}

0 comments on commit 88004bb

Please sign in to comment.