File tree Expand file tree Collapse file tree 9 files changed +183
-1
lines changed Expand file tree Collapse file tree 9 files changed +183
-1
lines changed Original file line number Diff line number Diff line change 20
20
env :
21
21
HUSKY : " 0"
22
22
23
+ - name : Setup Terraform
24
+ uses : hashicorp/setup-terraform@v2
25
+ with :
26
+ terraform_version : 1.12.2
27
+
28
+
23
29
- name : Set up Node
24
30
uses : actions/setup-node@v4
25
31
with :
@@ -102,6 +108,11 @@ jobs:
102
108
node-version : 22.x
103
109
cache : " yarn"
104
110
111
+ - name : Setup Terraform
112
+ uses : hashicorp/setup-terraform@v2
113
+ with :
114
+ terraform_version : 1.12.2
115
+
105
116
- name : Restore Yarn Cache
106
117
uses : actions/cache@v4
107
118
with :
Original file line number Diff line number Diff line change 4
4
" rvest.vs-code-prettier-eslint" ,
5
5
" eamodio.gitlens" ,
6
6
" ms-vscode.makefile-tools" ,
7
- " amazonwebservices.aws-toolkit-vscode"
7
+ " amazonwebservices.aws-toolkit-vscode" ,
8
+ " hashicorp.terraform"
8
9
]
9
10
}
Original file line number Diff line number Diff line change @@ -90,12 +90,17 @@ postdeploy:
90
90
91
91
deploy_prod : check_account_prod
92
92
@echo " Deploying CloudFormation stack..."
93
+ terraform -chdir=terraform/envs/prod apply -auto-approve
94
+ terraform -chdir=terraform/envs/prod init
93
95
sam deploy $(common_params ) --parameter-overrides $(run_env ) =prod $(set_application_prefix ) =$(application_key ) $(set_application_name ) =" $( application_name) " S3BucketPrefix=" $( s3_bucket_prefix) "
94
96
make postdeploy
95
97
96
98
deploy_dev : check_account_dev
97
99
@echo " Deploying CloudFormation stack..."
98
100
sam deploy $(common_params ) --parameter-overrides $(run_env ) =dev $(set_application_prefix ) =$(application_key ) $(set_application_name ) =" $( application_name) " S3BucketPrefix=" $( s3_bucket_prefix) "
101
+ @echo " Deploying Terraform..."
102
+ terraform -chdir=terraform/envs/qa init
103
+ terraform -chdir=terraform/envs/qa apply -auto-approve
99
104
make postdeploy
100
105
101
106
invalidate_cloudfront :
@@ -114,13 +119,19 @@ invalidate_cloudfront:
114
119
install :
115
120
yarn -D
116
121
pip install cfn-lint
122
+ terraform -chdir=terraform/envs/qa init
123
+ terraform -chdir=terraform/envs/prod init
117
124
118
125
test_live_integration : install
119
126
yarn test:live
120
127
121
128
test_unit : install
122
129
yarn lint
123
130
cfn-lint cloudformation/** /*
131
+ terraform -chdir=terraform/envs/qa fmt -check
132
+ terraform -chdir=terraform/envs/prod fmt -check
133
+ terraform -chdir=terraform/envs/qa validate
134
+ terraform -chdir=terraform/envs/prod validate
124
135
yarn prettier
125
136
yarn test:unit
126
137
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ Parameters:
10
10
Resources :
11
11
AppApiLambdaLogGroup :
12
12
Type : AWS::Logs::LogGroup
13
+ DeletionPolicy : Retain
14
+ UpdateReplacePolicy : Retain
13
15
Properties :
14
16
LogGroupName :
15
17
Fn::Sub : /aws/lambda/${LambdaFunctionName}
Original file line number Diff line number Diff line change
1
+ # OSX leaves these everywhere on SMB shares
2
+ ._ *
3
+
4
+ # OSX trash
5
+ .DS_Store
6
+
7
+ # Python
8
+ * .pyc
9
+
10
+ # Emacs save files
11
+ * ~
12
+ \# * \#
13
+ . \# *
14
+
15
+ # Vim-related files
16
+ [._ ]* .s [a-w ][a-z ]
17
+ [._ ]s [a-w ][a-z ]
18
+ * .un~
19
+ Session.vim
20
+ .netrwhist
21
+
22
+ # ## https://raw.github.com/github/gitignore/90f149de451a5433aebd94d02d11b0e28843a1af/Terraform.gitignore
23
+
24
+ # Local .terraform directories
25
+ ** /.terraform *
26
+
27
+ # .tfstate files
28
+ * .tfstate
29
+ * .tfstate. *
30
+
31
+ # Local tfvars terraform.tfvars
32
+ ** /* .tfvars
33
+
34
+ # tf lock file
35
+ ** /.terraform.lock.hcl
36
+
37
+ # Crash log files
38
+ crash.log
39
+
40
+ # Ignore any .tfvars files that are generated automatically for each Terraform run. Most
41
+ # .tfvars files are managed as part of configuration and so should be included in
42
+ # version control.
43
+ #
44
+ # example.tfvars
45
+
46
+ # Ignore override files as they are usually used to override resources locally and so
47
+ # are not checked in
48
+ override.tf
49
+ override.tf.json
50
+ * _override.tf
51
+ * _override.tf.json
52
+ .idea /
53
+ .vscode /
54
+ # Kitchen files
55
+ ** /inspec.lock
56
+ ** .gem
57
+ ** /.kitchen
58
+ ** /.kitchen.local.yml
59
+ ** /Gemfile.lock
60
+ # Plan files
61
+ ** /tmp_plan
62
+ ** /.tmp
63
+ ** /tmp
64
+
65
+ test /fixtures /shared /terraform.tfvars
66
+
67
+ test /integration /gcloud /config.sh
68
+ test /integration /tmp
69
+
70
+ credentials.json
71
+
72
+ helpers /foundation-deployer /foundation-deployer
73
+ helpers /foundation-deployer /.steps.json
74
+
75
+ # File to populate env vars used by Docker test runs
76
+ .envrc
77
+
78
+ # Handle files generated on sed command by old (2013-) MacOS versions
79
+ * .tf-e
80
+
81
+ # Go multi-module workspace sum
82
+ go.work.sum
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_providers {
3
+ aws = {
4
+ source = " hashicorp/aws"
5
+ version = " ~> 5.92"
6
+ }
7
+ }
8
+
9
+ required_version = " >= 1.2"
10
+ }
11
+
12
+ provider "aws" {
13
+ region = " us-east-1"
14
+ default_tags {
15
+ tags = {
16
+ project = var.ProjectId
17
+ }
18
+ }
19
+ }
20
+
21
+ import {
22
+ to = aws_cloudwatch_log_group. main_app_logs
23
+ id = " /aws/lambda/${ var . ProjectId } -lambda"
24
+ }
25
+ resource "aws_cloudwatch_log_group" "main_app_logs" {
26
+ name = " /aws/lambda/${ var . ProjectId } -lambda"
27
+ retention_in_days = var. LogRetentionDays
28
+ }
Original file line number Diff line number Diff line change
1
+ variable "LogRetentionDays" {
2
+ type = number
3
+ default = 90
4
+ }
5
+
6
+ variable "ProjectId" {
7
+ type = string
8
+ default = " infra-core-api"
9
+ }
10
+
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_providers {
3
+ aws = {
4
+ source = " hashicorp/aws"
5
+ version = " ~> 5.92"
6
+ }
7
+ }
8
+
9
+ required_version = " >= 1.2"
10
+ }
11
+
12
+ provider "aws" {
13
+ region = " us-east-1"
14
+ default_tags {
15
+ tags = {
16
+ project = var.ProjectId
17
+ }
18
+ }
19
+ }
20
+
21
+ import {
22
+ to = aws_cloudwatch_log_group. main_app_logs
23
+ id = " /aws/lambda/${ var . ProjectId } -lambda"
24
+ }
25
+ resource "aws_cloudwatch_log_group" "main_app_logs" {
26
+ name = " /aws/lambda/${ var . ProjectId } -lambda"
27
+ retention_in_days = var. LogRetentionDays
28
+ }
Original file line number Diff line number Diff line change
1
+ variable "LogRetentionDays" {
2
+ type = number
3
+ default = 7
4
+ }
5
+
6
+ variable "ProjectId" {
7
+ type = string
8
+ default = " infra-core-api"
9
+ }
You can’t perform that action at this time.
0 commit comments