File tree Expand file tree Collapse file tree 19 files changed +209
-26
lines changed
Expand file tree Collapse file tree 19 files changed +209
-26
lines changed Original file line number Diff line number Diff line change 88 required : true
99 type : string
1010 outputs :
11- web_bucket :
12- description : " Bucket containing static website files"
13- value : ${{ jobs.infra.outputs.web_bucket_name }}
1411 lambda_bucket :
1512 description : " Bucket containing lambda zips"
1613 value : ${{ jobs.infra.outputs.lambda_bucket_name }}
14+ lambda_version :
15+ description : " Valid lambda version"
16+ value : ${{ inputs.version }}
1717
1818concurrency : # only run one instance of workflow at any one time
1919 group : ${{ github.workflow }}-${{inputs.environment}}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ permissions:
2828 contents : write
2929
3030env :
31- TF_VAR_deploy_version : ${{ inputs.lambda_version }}
31+ TF_VAR_lambda_version : ${{ inputs.lambda_version }}
3232 AWS_OIDC_ROLE_ARN : arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/aws-serverless-github-deploy-${{ inputs.environment }}-github-oidc-role
3333
3434jobs :
6161 with :
6262 aws_oidc_role_arn : ${{ env.AWS_OIDC_ROLE_ARN }}
6363 just_action : check-version
64+
65+ api :
66+ needs :
67+ - oidc
68+ runs-on : ubuntu-latest
69+ steps :
70+ - uses : actions/checkout@v4
71+ with :
72+ ref : ${{ inputs.infra_version }}
73+
74+ - name : Deploy API
75+ uses : chrispsheehan/terragrunt-aws-oidc-action@0.4.0
76+ with :
77+ aws_oidc_role_arn : ${{ env.AWS_OIDC_ROLE_ARN }}
78+ tg_directory : infra/live/${{ inputs.environment }}/aws/api
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ permissions:
1919 contents : write
2020
2121env :
22- TF_VAR_deploy_version : this
22+ TF_VAR_lambda_version : this
2323 AWS_OIDC_ROLE_ARN : arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/aws-serverless-github-deploy-${{ inputs.environment }}-github-oidc-role
2424
2525jobs :
26- backend :
26+ api :
2727 runs-on : ubuntu-latest
2828 steps :
2929 - uses : actions/checkout@v4
@@ -32,12 +32,12 @@ jobs:
3232 uses : chrispsheehan/terragrunt-aws-oidc-action@0.4.0
3333 with :
3434 aws_oidc_role_arn : ${{ env.AWS_OIDC_ROLE_ARN }}
35- tg_directory : infra/live/${{ inputs.environment }}/aws/jobs
35+ tg_directory : infra/live/${{ inputs.environment }}/aws/api
3636 tg_action : destroy
3737
3838 build :
3939 needs :
40- - backend
40+ - api
4141 runs-on : ubuntu-latest
4242 steps :
4343 - uses : actions/checkout@v4
Original file line number Diff line number Diff line change @@ -14,18 +14,11 @@ jobs:
1414 environment : dev
1515 version : ${{ github.sha }}
1616
17- get :
18- needs : build
19- uses : ./.github/workflows/get_build.yml
20- with :
21- environment : dev
22- version : ${{ github.sha }}
23-
2417 dev :
2518 uses : ./.github/workflows/deploy.yml
26- needs : get
19+ needs : build
2720 with :
2821 environment : dev
2922 infra_version : ${{ github.sha }}
30- lambda_bucket : ${{ needs.get .outputs.lambda_bucket }}
31- lambda_version : ${{ needs.get .outputs.lambda_version }}
23+ lambda_bucket : ${{ needs.build .outputs.lambda_bucket }}
24+ lambda_version : ${{ needs.build .outputs.lambda_version }}
Original file line number Diff line number Diff line change 1- # aws-serverless-github-deploy
1+ # aws-serverless-github-deploy
2+
3+ ## setup roles for ci
4+
5+ ``` sh
6+ just tg ci aws/oidc apply
7+ just tg dev aws/oidc apply
8+ just tg prod aws/oidc apply
9+ ```
10+
11+ ## local plan some infra
12+
13+ Given a terragrunt file is found at ` infra/live/dev/aws/api/terragrunt.hcl `
14+
15+ ``` sh
16+ just tg dev aws/api plan
17+ ```
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ include {
33}
44
55terraform {
6- source = " ../../../../modules/aws/code_bucket"
6+ source = " ../../../../modules// aws/ /code_bucket"
77}
Original file line number Diff line number Diff line change 1+ include {
2+ path = find_in_parent_folders (" root.hcl" )
3+ }
4+
5+ terraform {
6+ source = " ../../../../modules//aws//api"
7+ }
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ include {
33}
44
55terraform {
6- source = " ../../../../modules/aws/code_bucket"
6+ source = " ../../../../modules// aws/ /code_bucket"
77}
Original file line number Diff line number Diff line change 44 " s3:*" ,
55 " iam:*" ,
66 " lambda:*" ,
7- " logs:*"
7+ " logs:*" ,
8+ " apigateway:*"
89 ]
910}
1011
Original file line number Diff line number Diff line change 1+ include {
2+ path = find_in_parent_folders (" root.hcl" )
3+ }
4+
5+ terraform {
6+ source = " ../../../../modules//aws//api"
7+ }
You can’t perform that action at this time.
0 commit comments