File tree 3 files changed +17
-11
lines changed
3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 5
5
branches :
6
6
- develop
7
7
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
+
8
13
permissions :
9
14
id-token : write
10
15
contents : read
31
36
with :
32
37
role-to-assume : arn:aws:iam::179916804929:role/BuildRun-GithubActions-Role
33
38
role-session-name : GitHub_to_AWS_via_FederatedOIDC
34
- aws-region : ${{ vars .AWS_REGION }}
39
+ aws-region : ${{ env .AWS_REGION }}
35
40
36
41
- name : Read destroy configuration
37
42
id : read-destroy-config
@@ -42,10 +47,10 @@ jobs:
42
47
- name : Terraform Init
43
48
run : |
44
49
cd infra && terraform init \
45
- -backend-config="bucket=${{ vars .TERRAFORM_S3_STATEFILE_BUCKET }}" \
50
+ -backend-config="bucket=${{ env .TERRAFORM_S3_STATEFILE_BUCKET }}" \
46
51
-backend-config="key=${{ github.event.repository.name }}" \
47
52
-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 }}"
49
54
50
55
- name : Terraform Validate
51
56
run : terraform validate
Original file line number Diff line number Diff line change 1
1
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" {}
10
3
}
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments