Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodejs upgrade, npm modules upgrade, and 5 enhancements on 2024 #461

Open
wants to merge 204 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
6793017
update the page layout
chloe-yuu Oct 4, 2023
b7a594e
remove download and view buttons for ha
chloe-yuu Oct 6, 2023
6dfe418
minor change
chloe-yuu Oct 6, 2023
6b3c4b2
Merge pull request #329 from bcgov/FEATURE/sales_report_menu_for_ha
chloe-yuu Oct 6, 2023
af39c1e
Merge pull request #331 from bcgov/main
ahoplock Oct 6, 2023
f3a4181
Merge pull request #332 from bcgov/dev-env
ahoplock Oct 6, 2023
4341052
remove the under-19 other option when add a physical/both location
chloe-yuu Oct 16, 2023
5f68413
Force redeployment on apply
ahoplock Oct 18, 2023
8411897
Merge branch 'FEATURE/aws' of https://github.com/bcgov/moh-bcer into …
ahoplock Oct 18, 2023
55ffeae
Changes from GIS to trigger ECS to redeploy builds when no task chang…
ahoplock Oct 24, 2023
c087c98
Attempt to resolve warning
ahoplock Oct 24, 2023
10a99a9
make under-19 question editable in view location page and update cypr…
chloe-yuu Oct 24, 2023
c2d6ec5
update cypress test
chloe-yuu Nov 1, 2023
1c4a5a0
Merge pull request #334 from bcgov/FEATURE/retailer_noi
chloe-yuu Nov 1, 2023
67a7f61
Merge pull request #335 from bcgov/dev-env
ahoplock Nov 1, 2023
0553092
Split zap_scan job into separate workflow
ahoplock Nov 1, 2023
74497ac
Merge branch 'FEATURE/aws' of https://github.com/bcgov/moh-bcer into …
ahoplock Nov 1, 2023
8203e73
remove comments and set Feb1 2024 as a const
chloe-yuu Nov 6, 2023
bad4ac3
Merge pull request #337 from bcgov/FEATURE/retailer_noi
chloe-yuu Nov 6, 2023
304fed5
Merge pull request #338 from bcgov/dev-env
ahoplock Nov 6, 2023
278fb50
fix the noi update feature for online location
chloe-yuu Nov 7, 2023
83b5cae
Merge pull request #339 from bcgov/FEATURE/retailer_noi
chloe-yuu Nov 7, 2023
d7b9aa4
Merge pull request #341 from bcgov/dev-env
ahoplock Nov 7, 2023
e038d28
minor fix
chloe-yuu Nov 7, 2023
8b8c77a
Merge pull request #342 from bcgov/FEATURE/retailer_noi
chloe-yuu Nov 7, 2023
c7893ed
Merge pull request #344 from bcgov/dev-env
ahoplock Nov 7, 2023
8a46a00
for locations that has not renew NOI, set the under-19 question to ye…
chloe-yuu Nov 7, 2023
7629c73
Merge pull request #345 from bcgov/FEATURE/retailer_noi
chloe-yuu Nov 7, 2023
ae50cb5
update cypress test
chloe-yuu Nov 9, 2023
48882bf
avoid the timeout
chloe-yuu Nov 9, 2023
9281902
add timeout
chloe-yuu Nov 9, 2023
5c52adc
Merge pull request #347 from bcgov/FEATURE/retailer_noi
chloe-yuu Nov 9, 2023
7221504
Merge pull request #349 from bcgov/dev-env
ahoplock Nov 9, 2023
d7e7756
Adding paramterization for Aurora ACUs and configuring test and dev v…
Nov 16, 2023
8753576
Update .env.aws.test
ahoplock Nov 30, 2023
7c8658c
Update .env.aws.test
ahoplock Nov 30, 2023
0cb1172
Update aws-deploy.yml
ahoplock Dec 6, 2023
b306407
Update terragrunt.hcl
nathanielcx Dec 7, 2023
ddbe8c7
Update terragrunt.hcl
nathanielcx Dec 7, 2023
2fb7559
Update terragrunt.hcl
nathanielcx Dec 7, 2023
8be3290
Certificate fix with Terragrunt variables
Dec 7, 2023
8a26901
Update aws-deploy.yml
ahoplock Dec 13, 2023
89799fd
Update aws-deploy.yml
ahoplock Dec 13, 2023
98ff50b
Update aws-deploy.yml
ahoplock Dec 13, 2023
cd9d719
Update aws-deploy.yml
ahoplock Dec 13, 2023
aaa4517
Update aws-deploy.yml
ahoplock Dec 13, 2023
3c506c6
Update aws-deploy.yml
ahoplock Dec 13, 2023
cfaa227
Update aws-deploy.yml
ahoplock Dec 13, 2023
c7013e8
Update aws-deploy.yml
ahoplock Dec 13, 2023
aa4c334
Update terragrunt.hcl
nathanielcx Jan 15, 2024
0eec64d
Update terragrunt.hcl
nathanielcx Jan 15, 2024
247e0ca
Set application port to 4000 as per Local/Dev/Test for consistency; F…
ahoplock Jan 16, 2024
68b4f1b
Update terragrunt.hcl
nathanielcx Jan 16, 2024
f3a88aa
Merge remote-tracking branch 'remotes/origin/b785eb3' into FEATURE/aws
ahoplock Jan 16, 2024
e8e3d19
Merge branch 'FEATURE/aws' of https://github.com/bcgov/moh-bcer into …
ahoplock Jan 16, 2024
b2d7bd6
Change port to match changes to portal
ahoplock Jan 17, 2024
9433c02
Temporarily add e2etest for FEATURE/aws changes
ahoplock Jan 17, 2024
dd90c9a
Update business.service.ts
nathanielcx Jan 19, 2024
08084f0
Update business.service.ts
nathanielcx Jan 19, 2024
b76e791
Update business.service.ts
nathanielcx Jan 19, 2024
1c7b6da
Update business.service.ts
nathanielcx Jan 19, 2024
86eef1e
Testing pagination
ahoplock Jan 19, 2024
52bdadd
Merge pull request #407 from bcgov/main
chloe-yuu Jan 25, 2024
9935b47
Merge pull request #408 from bcgov/main
chloe-yuu Jan 25, 2024
d484431
Revert "Testing pagination"
ahoplock Feb 20, 2024
8935d3c
Revert "Update business.service.ts"
ahoplock Feb 20, 2024
b594593
Revert "Update business.service.ts"
ahoplock Feb 20, 2024
000bb8b
Revert "Update business.service.ts"
ahoplock Feb 20, 2024
255b485
Revert "Update business.service.ts"
ahoplock Feb 20, 2024
de5c561
Revert "Temporarily add e2etest for FEATURE/aws changes"
ahoplock Feb 20, 2024
ccba4e7
still in progress
chloe-yuu Feb 23, 2024
fcbd095
bcer-shared-components done
chloe-yuu Feb 27, 2024
2e99419
removed @types/yup and resolved all the vulnerability issue for bcer-…
chloe-yuu Mar 2, 2024
4e82ff1
Update terragrunt.hcl
nathanielcx Mar 5, 2024
20b25ce
Pagination for business table (#423)
tristancusiCGI Mar 7, 2024
00a8c05
HOTFIX: adding A couple of missed imports
tristancusiCGI Mar 7, 2024
77af1b6
HOTFIX: removed LOWER() function from sql sort to make it case insens…
tristancusiCGI Mar 12, 2024
875f26e
Perfomance fix for overview endpoint: changed db query to use the new…
tristancusiCGI Mar 21, 2024
84661b6
* fixed a bug where pageNum wasnt reset to 1 after searching a
tristancusiCGI Mar 25, 2024
96c24f0
Update aurora-v2.tf
nathanielcx Mar 25, 2024
a841e2f
Update aurora-v2.tf
nathanielcx Mar 25, 2024
6e856bd
Update aurora-v2.tf
nathanielcx Mar 25, 2024
a010918
Update aurora-v2.tf
nathanielcx Mar 25, 2024
9109cac
Update aurora-v2.tf
nathanielcx Mar 25, 2024
5bca4de
Update aurora-v2.tf
nathanielcx Mar 25, 2024
3f18958
Update secretsmanager.tf
nathanielcx Mar 25, 2024
8a2f4f6
Update api-gateway.tf
nathanielcx Mar 26, 2024
a141f60
Update aurora-v2.tf
nathanielcx Mar 26, 2024
e2ec6fa
Update aurora-v2.tf
nathanielcx Mar 27, 2024
b497f45
API upgrade and refactor
chloe-yuu Apr 9, 2024
5adcdfa
save the progress
chloe-yuu May 24, 2024
f385a2b
update keycloak setting
chloe-yuu May 24, 2024
7164f42
Merge pull request #424 from bcgov/FIX/safari_keycloak_cross_site_tra…
chloe-yuu May 24, 2024
f815911
remove onload setting
chloe-yuu May 24, 2024
9d93e6c
Merge pull request #426 from bcgov/FIX/safari_keycloak_cross_site_tra…
chloe-yuu May 24, 2024
8a3385f
add back
chloe-yuu May 25, 2024
188a95a
update keycloak config
chloe-yuu May 30, 2024
721645e
update cypress record key
chloe-yuu May 30, 2024
fb5e140
update cypress project id
chloe-yuu May 30, 2024
e8d9a7c
Merge branch 'FIX/safari_keycloak_cross_site_tracking_issue' of githu…
chloe-yuu May 30, 2024
c4720e7
update cypress record key"
chloe-yuu May 30, 2024
9bae35a
upgrade keycloak adaptor and update cypress keycloak config
chloe-yuu Jun 4, 2024
cc4c061
Update keycloak-js version
ahoplock Jun 5, 2024
2e70e53
Update keycloak-js version
ahoplock Jun 6, 2024
d986635
Updating Keycloak references
ahoplock Jun 6, 2024
5369b5b
Fix for "Error: Cannot find module 'core-js/modules/es.string.replace…
ahoplock Jun 26, 2024
955f21c
Fix for "Error: Cannot find module 'core-js/modules/es.string.replace…
ahoplock Jun 26, 2024
8a3874b
Fix for "Error: Cannot find module 'core-js/modules/es.string.replace…
ahoplock Jun 26, 2024
16815d3
retailer site code refactor
chloe-yuu Jul 1, 2024
b50a848
merge changes from FEATURE/aws and resolve merge conflicts
chloe-yuu Jul 1, 2024
a18b29b
package update
chloe-yuu Jul 3, 2024
67a046e
code refactor
chloe-yuu Jul 8, 2024
efb945c
uncomment the locationtable
chloe-yuu Jul 8, 2024
3448352
upgrade npm module versions of bcer-share-components and fix the uniq…
chloe-yuu Jul 9, 2024
422a20e
fix the autocomplete issue
chloe-yuu Jul 11, 2024
873b4b6
update autocomplete functionality
chloe-yuu Jul 14, 2024
efd1393
fixing css and fixing the axios patch auto cancel issue on retailer site
chloe-yuu Jul 14, 2024
830cc08
fix sorting
chloe-yuu Jul 15, 2024
b3627b2
fix the location edit errors
chloe-yuu Jul 16, 2024
bc34492
fixing the noi table
chloe-yuu Jul 19, 2024
50b89dc
fixing noi pdf download functionality
chloe-yuu Jul 20, 2024
e1b9510
fix noi route
chloe-yuu Jul 22, 2024
a182df2
fixing routes for sales report and product report
chloe-yuu Jul 22, 2024
847c467
fix product report
chloe-yuu Jul 24, 2024
07daeb2
fix manufacturing reports
chloe-yuu Jul 24, 2024
a9b8308
fix sales reports style, and user guide download functionality
chloe-yuu Jul 27, 2024
6972433
fix the sales report download functionality on retailer
chloe-yuu Jul 29, 2024
6877820
tsconfig fix and code refactor for api and portal site
chloe-yuu Aug 19, 2024
e499f3b
Merge branch 'dev-env' into Nodejs_upgrade
chloe-yuu Aug 19, 2024
ace4900
Merge pull request #422 from bcgov/Nodejs_upgrade
chloe-yuu Aug 19, 2024
9863403
update public file path
chloe-yuu Aug 19, 2024
1e0c283
update cypress test and aws deployment nodejs version
chloe-yuu Aug 20, 2024
8fd12b5
Merge branch 'Nodejs_upgrade' of github.com:bcgov/moh-bcer into Nodej…
chloe-yuu Aug 20, 2024
55cd98e
Merge pull request #429 from bcgov/Nodejs_upgrade
chloe-yuu Aug 20, 2024
79ec7b3
update aws-deploy.yml
chloe-yuu Aug 20, 2024
78f3b47
Merge pull request #430 from bcgov/Nodejs_upgrade
chloe-yuu Aug 20, 2024
ecc2281
fixing the bundle.js not found error on the webpack config of both re…
chloe-yuu Aug 22, 2024
cc476e9
Merge pull request #431 from bcgov/Nodejs_upgrade
chloe-yuu Aug 22, 2024
25b977f
log NODE_ENV to troubleshoot
chloe-yuu Aug 22, 2024
ba531a8
Merge pull request #432 from bcgov/Nodejs_upgrade
chloe-yuu Aug 22, 2024
95b308d
update env config on package.json for retailer and portal
chloe-yuu Aug 22, 2024
9959bd1
Merge pull request #433 from bcgov/Nodejs_upgrade
chloe-yuu Aug 22, 2024
071c6a8
update default mode config
chloe-yuu Aug 22, 2024
fa976ff
Merge pull request #434 from bcgov/Nodejs_upgrade
chloe-yuu Aug 22, 2024
4e585f0
update webpack fixing the syntax error
chloe-yuu Aug 22, 2024
1d12d9d
Merge pull request #435 from bcgov/Nodejs_upgrade
chloe-yuu Aug 22, 2024
58631d6
add log
chloe-yuu Aug 22, 2024
1dd7cc9
Merge pull request #436 from bcgov/Nodejs_upgrade
chloe-yuu Aug 22, 2024
565a6b1
fix syntax on docker files and update webpack config files to resolve…
chloe-yuu Aug 23, 2024
7c052ae
change back the docker intall libl1 -y
chloe-yuu Aug 23, 2024
cc6df05
Merge pull request #437 from bcgov/Nodejs_upgrade
chloe-yuu Aug 23, 2024
8c00079
fixing asset missing issue
chloe-yuu Aug 23, 2024
cc83caa
Merge pull request #438 from bcgov/Nodejs_upgrade
chloe-yuu Aug 23, 2024
008191e
webpack svg file loader config update
chloe-yuu Aug 23, 2024
80e073f
Merge pull request #439 from bcgov/Nodejs_upgrade
chloe-yuu Aug 23, 2024
8fe9953
update webpack config on data portal
chloe-yuu Aug 23, 2024
d69e837
Merge pull request #440 from bcgov/Nodejs_upgrade
chloe-yuu Aug 23, 2024
88b14d4
cypress update
chloe-yuu Aug 26, 2024
5807a10
Merge pull request #441 from bcgov/Nodejs_upgrade
chloe-yuu Aug 26, 2024
6e231f2
fix the existing location edit (location type) issue on retailer site…
chloe-yuu Aug 28, 2024
8ab1c55
Merge pull request #442 from bcgov/Nodejs_upgrade
chloe-yuu Aug 28, 2024
556194d
add logging against bcer-api for aws deployment
chloe-yuu Aug 28, 2024
12b3558
Merge pull request #443 from bcgov/Nodejs_upgrade
chloe-yuu Aug 28, 2024
1e0aeb0
revert
chloe-yuu Aug 28, 2024
e1752a5
update the typeorm config for bcer-api on test env and aws
chloe-yuu Aug 28, 2024
dbc9052
datasource config fix
chloe-yuu Aug 29, 2024
57819aa
Import and Use AppDataSource in AppModule
chloe-yuu Aug 29, 2024
d9f4e5c
roll back DatabaseModule
chloe-yuu Aug 29, 2024
4c231e9
update the DatabaseModule so that the db config isn't reset to empty …
chloe-yuu Aug 29, 2024
0364af7
Merge pull request #444 from bcgov/Nodejs_upgrade
chloe-yuu Aug 29, 2024
6e98265
Merge pull request #445 from bcgov/dev-env
chloe-yuu Aug 29, 2024
91fed64
fixing full screen and product report view functionality
chloe-yuu Aug 30, 2024
f23bedc
Wording Change Persons Under 19
chloe-yuu Sep 4, 2024
0cda68b
fix location csv files, and fix autocomplete for address change
chloe-yuu Sep 11, 2024
a8e7f72
update migration scripts and fix address auto fill issue
chloe-yuu Sep 11, 2024
04b9e81
fix the address edit functionality
chloe-yuu Sep 19, 2024
b82ba8a
enhancement #1
chloe-yuu Sep 24, 2024
b3242ed
fix the cancel error of the post method sending out emails
chloe-yuu Sep 25, 2024
cdb567d
fix the notification functionality of csv entry and and warning messa…
chloe-yuu Sep 26, 2024
c102dc2
resolve the authentication error on the PATCH request of submitssions…
chloe-yuu Oct 2, 2024
e677ae8
Merge pull request #446 from bcgov/Nodejs_upgrade
chloe-yuu Oct 2, 2024
f4e8209
Merge pull request #447 from bcgov/dev-env
chloe-yuu Oct 2, 2024
0eaec27
enhancement#4 add tooltips for business legal name and location doing…
chloe-yuu Oct 3, 2024
60c571f
Merge pull request #448 from bcgov/Nodejs_upgrade
chloe-yuu Oct 3, 2024
99bce59
fix the user authentication issue on MyBusinessNav.tsx
chloe-yuu Oct 3, 2024
098e5ec
Merge pull request #449 from bcgov/Nodejs_upgrade
chloe-yuu Oct 3, 2024
4987464
cypress test update for enhancement #4 and fix the redirect issue on …
chloe-yuu Oct 4, 2024
7b5aa2a
Merge pull request #450 from bcgov/Nodejs_upgrade
chloe-yuu Oct 4, 2024
171fbe0
Merge pull request #451 from bcgov/dev-env
chloe-yuu Oct 4, 2024
11457d8
enhancement 1&4 update based on the UAT test result
chloe-yuu Oct 7, 2024
b97ec9c
Merge pull request #452 from bcgov/Nodejs_upgrade
chloe-yuu Oct 7, 2024
c5e74f1
Merge pull request #453 from bcgov/dev-env
chloe-yuu Oct 7, 2024
41a774e
doing business as word change
chloe-yuu Oct 7, 2024
d6edad4
Merge pull request #454 from bcgov/Nodejs_upgrade
chloe-yuu Oct 7, 2024
f25ea91
Merge pull request #455 from bcgov/dev-env
chloe-yuu Oct 7, 2024
f89c395
add "Doing Business as" column to the product reports "locations with…
Oct 7, 2024
5b567a5
Merge pull request #456 from bcgov/tristan/add_column_to_product_tables
tristancusiCGI Oct 7, 2024
b341104
Merge pull request #457 from bcgov/dev-env
chloe-yuu Oct 8, 2024
12de52b
remove sorting on retailer tables
chloe-yuu Oct 8, 2024
83d9cc6
Merge pull request #458 from bcgov/Nodejs_upgrade
chloe-yuu Oct 8, 2024
44db044
* added new StyledEditableDropdown component
tristancusiCGI Oct 8, 2024
218107a
add back comments
tristancusiCGI Oct 8, 2024
4b07ba5
Merge pull request #459 from bcgov/tristan/add_dropdown_to_location_i…
chloe-yuu Oct 8, 2024
45bb8e1
Merge pull request #460 from bcgov/dev-env
chloe-yuu Oct 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions .github/workflows/aws-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
ref: FEATURE/aws
ref: ${{ github.event.workflow_run.head_branch }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down Expand Up @@ -144,10 +144,10 @@ jobs:
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Use Node.js 14
- name: Use Node.js 22
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 22

- name: Build project shared components
run: |
Expand Down Expand Up @@ -186,9 +186,9 @@ jobs:

- name: Build project data portal frontend
run: |
cd packages/bcer-data-portal/app
npm install
npm run build
cd packages/bcer-data-portal/app
npm install
npm run build

- name: Upload to S3 bucket data portal
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2etest-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '17'
node-version: '22'

- name: Install deps
run: npm install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2etest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '17'
node-version: '22.0.0'

- name: Install deps
run: npm install
Expand All @@ -37,8 +37,8 @@ jobs:
uses: cypress-io/github-action@v2
with:
wait-on-timeout: 200
wait-on: 'http://localhost:3000/retailer, http://localhost:3000/portal'
wait-on: 'http://localhost:3000/retailer, http://localhost:3001/portal'
record: true
env:
CYPRESS_RECORD_KEY: 'd6703994-08d4-4421-b52f-d7f02ee5cff0'
CYPRESS_RECORD_KEY: '11b57a63-2d0d-42ab-95f4-a6f9cbfc5a8e'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.17.6'
node-version: '22.0.0'
- name: Package App
run: VERSION=${{ github.event.inputs.version }} ENVIRONMENT=${{ github.event.inputs.environment }} make package-build
- name: Create Github Release
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ cypress/videos/
# .tfstate files
*.tfstate
*.tfstate.*
.terraform.lock.hcl
**/.terragrunt-cache/**

# Crash log files
crash.log
Expand Down
7 changes: 5 additions & 2 deletions .nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ upstream retailer {
}

upstream portal {
server data-portal:3000;
server data-portal:3000;
}


server {
listen 80;

Expand All @@ -19,4 +18,8 @@ server {
rewrite /portal/(.*) /$1 break;
proxy_pass http://portal;
}
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}
11 changes: 11 additions & 0 deletions Database Scripts/aurora_create_db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--As Postgres User
CREATE USER bcer_proxy WITH PASSWORD 'bcer';
--RDS handles the CREATE DATABASE bcer step
--CREATE DATABASE bcer WITH OWNER = bcer ENCODING = 'UTF8' CONNECTION LIMIT = -1 IS_TEMPLATE = False;
GRANT ALL PRIVILEGES on database bcer to bcer_proxy;

--Switch to bcer_proxy user
--Use the BCER database
CREATE SCHEMA bcer;
GRANT ALL ON ALL TABLES IN SCHEMA bcer TO bcer_proxy;
GRANT ALL ON SCHEMA bcer TO bcer_proxy;
10 changes: 4 additions & 6 deletions Infrastructure/alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ data "aws_alb_listener" "front_end" {
}

resource "aws_alb_target_group" "app" {
name = "bcer-dev-target-group"
name = "${var.application}-${var.target_env}-target-group"
port = var.app_port
protocol = "HTTP"
vpc_id = data.aws_vpc.main.id
target_type = "ip"
deregistration_delay = 30
lifecycle {
create_before_destroy = true
ignore_changes = [name]
}
stickiness {
type = "lb_cookie"

}

health_check {
Expand All @@ -37,7 +36,7 @@ resource "aws_alb_target_group" "app" {
unhealthy_threshold = "2"
}

tags = local.common_tags
tags = local.common_tags
}

resource "aws_lb_listener_rule" "host_based_weighted_routing" {
Expand All @@ -49,10 +48,9 @@ resource "aws_lb_listener_rule" "host_based_weighted_routing" {
type = "forward"
target_group_arn = aws_alb_target_group.app.arn
}
#figure out what to place here
condition {
path_pattern {
values = ["/*"]
}
}
}
}
41 changes: 41 additions & 0 deletions Infrastructure/api-gateway.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
data "aws_acm_certificate" "bcer_api_certificate" {
domain = var.api_url
statuses = ["ISSUED"]
most_recent = true
}

module "api_gateway" {
source = "terraform-aws-modules/apigateway-v2/aws"
version = "2.2.2"

name = "${var.application}-http-api"
description = "HTTP API Gateway"
protocol_type = "HTTP"
create_api_domain_name = false

domain_name = var.api_url
domain_name_certificate_arn = data.aws_acm_certificate.bcer_api_certificate.arn

integrations = {
"ANY /{proxy+}" = {
connection_type = "VPC_LINK"
vpc_link = "bcer-vpc"
integration_uri = data.aws_alb_listener.front_end.arn
integration_type = "HTTP_PROXY"
integration_method = "ANY"

request_parameters = {
"append:header.SourceIp" = "$request.header.X-Forwarded-For"
"append:header.clientSourceIP" = "$context.identity.sourceIp"
}
}
}

vpc_links = {
bcer-vpc = {
name = "${var.application}-vpc-link"
security_group_ids = [data.aws_security_group.web.id]
subnet_ids = data.aws_subnets.web.ids
}
}
}
36 changes: 21 additions & 15 deletions Infrastructure/aurora-v2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ resource "random_pet" "bcer_subnet_group_name" {
length = 2
}


resource "random_password" "bcer_master_password" {
length = 16
special = true
Expand All @@ -30,24 +29,19 @@ resource "aws_db_subnet_group" "bcer_subnet_group" {
tags = {
managed-by = "terraform"
}

tags_all = {
managed-by = "terraform"
}
}

data "aws_rds_engine_version" "postgresql" {
engine = "aurora-postgresql"
version = "13.8"
}

module "aurora_postgresql_v2" {
source = "terraform-aws-modules/rds-aurora/aws"
source = "terraform-aws-modules/rds-aurora/aws"
version = "7.7.1"

name = "${var.bcer_cluster_name}-${var.target_env}"
engine = data.aws_rds_engine_version.postgresql.engine
engine = "aurora-postgresql"
engine_mode = "provisioned"
engine_version = data.aws_rds_engine_version.postgresql.version
engine_version = "13.12"
storage_encrypted = true
database_name = var.bcer_database_name

Expand All @@ -71,8 +65,8 @@ module "aurora_postgresql_v2" {
db_cluster_parameter_group_name = aws_rds_cluster_parameter_group.bcer_postgresql13.id

serverlessv2_scaling_configuration = {
min_capacity = 0.5
max_capacity = 1
min_capacity = var.aurora_acu_min
max_capacity = var.aurora_acu_max
}

instance_class = "db.serverless"
Expand Down Expand Up @@ -104,6 +98,15 @@ resource "aws_rds_cluster_parameter_group" "bcer_postgresql13" {
tags = {
managed-by = "terraform"
}
parameter {
name = "timezone"
value = var.timezone
}
parameter {
apply_method = "pending-reboot"
name = "shared_preload_libraries"
value = "pg_stat_statements,pg_cron"
}
}

resource "random_pet" "master_creds_secret_name" {
Expand All @@ -113,7 +116,6 @@ resource "random_pet" "master_creds_secret_name" {

resource "aws_secretsmanager_secret" "bcer_mastercreds_secret" {
name = random_pet.master_creds_secret_name.id

tags = {
managed-by = "terraform"
}
Expand All @@ -127,6 +129,9 @@ resource "aws_secretsmanager_secret_version" "bcer_mastercreds_secret_version" {
"password": "${random_password.bcer_master_password.result}"
}
EOF
lifecycle {
ignore_changes = [secret_string]
}
}

resource "random_password" "bcer_api_password" {
Expand All @@ -142,15 +147,13 @@ variable "bcer_api_username" {
sensitive = true
}


resource "random_pet" "api_creds_secret_name" {
prefix = "bcer-api-creds"
length = 2
}

resource "aws_secretsmanager_secret" "bcer_apicreds_secret" {
name = random_pet.api_creds_secret_name.id

tags = {
managed-by = "terraform"
}
Expand All @@ -164,4 +167,7 @@ resource "aws_secretsmanager_secret_version" "bcer_apicreds_secret_version" {
"password": "${random_password.bcer_api_password.result}"
}
EOF
lifecycle {
ignore_changes = [secret_string]
}
}
Loading
Loading