Skip to content

Commit a0773db

Browse files
authored
Merge pull request #5 from buildrun-tech/develop
Develop
2 parents 15b7e4c + ae5a45d commit a0773db

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

.github/workflows/terraform-dev.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
branches:
66
- develop
77

8+
env:
9+
AWS_REGION: "sa-east-1"
10+
TERRAFORM_DYNAMODB_LOCK_TABLE: "buildrun-terraform-state-lock"
11+
TERRAFORM_S3_STATEFILE_BUCKET: "buildrun-sa-east-1-terraform-s3-statefile"
12+
813
permissions:
914
id-token: write
1015
contents: read
@@ -31,7 +36,7 @@ jobs:
3136
with:
3237
role-to-assume: arn:aws:iam::179916804929:role/BuildRun-GithubActions-Role
3338
role-session-name: GitHub_to_AWS_via_FederatedOIDC
34-
aws-region: ${{ vars.AWS_REGION }}
39+
aws-region: ${{ env.AWS_REGION }}
3540

3641
- name: Read destroy configuration
3742
id: read-destroy-config
@@ -42,10 +47,10 @@ jobs:
4247
- name: Terraform Init
4348
run: |
4449
cd infra && terraform init \
45-
-backend-config="bucket=${{ vars.TERRAFORM_S3_STATEFILE_BUCKET }}" \
50+
-backend-config="bucket=${{ env.TERRAFORM_S3_STATEFILE_BUCKET }}" \
4651
-backend-config="key=${{ github.event.repository.name }}" \
4752
-backend-config="region=${{ env.AWS_REGION }}" \
48-
-backend-config="dynamodb_table=${{ vars.TERRAFORM_DYNAMODB_LOCK_TABLE }}"
53+
-backend-config="dynamodb_table=${{ env.TERRAFORM_DYNAMODB_LOCK_TABLE }}"
4954
5055
- name: Terraform Validate
5156
run: terraform validate

infra/backend.tf

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
terraform {
2-
backend "s3" {
3-
# bucket = "buildrun-sa-east-1-terraform-s3-statefile"
4-
# dynamodb_table = "buildrun-terraform-state-lock"
5-
# key = "buildrun-infra-terraform-pipeline"
6-
# region = "sa-east-1"
7-
# profile = "terraform"
8-
# shared_credentials_file = "~/.aws/credentials"
9-
}
2+
backend "s3" {}
103
}

readme.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Pipeline Infra (AWS + Terraform + Github Actions + Multi Env)
2+
3+
## Getting Started
4+
5+
- Create Github Actions IAM Role in your AWS Account (one-time-only-manual-config)
6+
- Create S3 Bucket in your AWS Account (one-time-per-region-manual-config)
7+
- Create DynamoDB table in your AWS Account (one-time-per-region-manual-config)
8+
- Clone this repo and start your project with a fully functional terraform pipeline

0 commit comments

Comments
 (0)