Skip to content

Commit 7be95d6

Browse files
committed
Changes to Deploy and apprunner
Working to ensure that the deployment is set to the right endpoint in route53. This may be redundant as that gets set up in AppRunner, but I'm trying to make sure that we're getting as much as we can in the actual infrastructure code.
1 parent 1191845 commit 7be95d6

File tree

4 files changed

+67
-48
lines changed

4 files changed

+67
-48
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ jobs:
2222
echo "ENVIRONMENT=prod" >> $GITHUB_ENV
2323
echo "STACK_NAME=neoapi-prod" >> $GITHUB_ENV
2424
echo "RDSDB=neotoma" >> $GITHUB_ENV
25+
echo "ENDPOINT=api.neotomadb.org" >> $GITHUB_ENV
2526
else
2627
echo "ENVIRONMENT=dev" >> $GITHUB_ENV
2728
echo "STACK_NAME=neoapi-dev" >> $GITHUB_ENV
2829
echo "RDSDB=neotomatank" >> $GITHUB_ENV
30+
echo "ENDPOINT=api-dev.neotomadb.org" >> $GITHUB_ENV
2931
fi
3032
3133
- name: Configure AWS credentials
@@ -80,9 +82,6 @@ jobs:
8082
run: |
8183
echo "Deploying infrastructure with image: ${{ env.IMAGE_URI }}"
8284
83-
# The secret is formatted as `subnet-xxxx1,subnet-xxxx2` so we have to make sure the CLI recognizes
84-
# it as a comma separated list.
85-
8685
aws cloudformation deploy \
8786
--template-file infrastructure/cloudformation-template.yaml \
8887
--stack-name ${{ env.STACK_NAME }} \
@@ -95,6 +94,7 @@ jobs:
9594
"RDSPassword=${{ secrets.RDS_PASSWORD }}" \
9695
"VPCId=${{ secrets.VPC_ID }}" \
9796
"PrivateSubnets=${{ env.SUBNET_LIST }}" \
97+
"DomainName=${{ env.ENDPOINT }}" \
9898
--capabilities CAPABILITY_NAMED_IAM \
9999
--region ${{ env.AWS_REGION }} \
100100
--no-fail-on-empty-changeset

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const onlyStatus200 = (req, res) => res.statusCode === 200;
2323
const cacheSuccesses = cache('5 minutes', onlyStatus200);
2424

2525
const limiter = rateLimiter({
26-
max: 50,
26+
max: 5000,
2727
windowMS: 10000, // 1 second
2828
message: 'You can\'t make any more requests at the moment. Try again later',
2929
statusCode: 429,

infrastructure/cloudformation-template.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ Parameters:
77
AllowedValues: [dev, prod]
88
Description: Environment name
99

10+
HostedZoneId:
11+
Type: String
12+
Description: Route 53 Hosted Zone ID
13+
Default: "Z06678132YXCZ3LP39MIP"
14+
15+
DomainName:
16+
Type: String
17+
Description: Domain name for the API
18+
Default: "api-dev.neotoma.org"
19+
1020
ImageUri:
1121
Type: String
1222
Description: ECR image URI
@@ -143,6 +153,17 @@ Resources:
143153
Timeout: 5
144154
HealthyThreshold: 1
145155
UnhealthyThreshold: 5
156+
157+
ApiDNSRecord:
158+
Type: AWS::Route53::RecordSet
159+
Properties:
160+
HostedZoneId: !Ref HostedZoneId
161+
Name: !Ref DomainName
162+
Type: A
163+
AliasTarget:
164+
DNSName: !GetAtt AppRunnerService.ServiceUrl
165+
HostedZoneId: Z0548130EFKXY74PMQGW # App Runner's hosted zone (us-east-2)
166+
EvaluateTargetHealth: true
146167

147168
Outputs:
148169
ServiceUrl:
@@ -156,4 +177,8 @@ Outputs:
156177
Description: ECR Repository URI
157178
Value: !Sub '${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/neoapi-${Environment}'
158179
Export:
159-
Name: !Sub '${AWS::StackName}-ECRRepository'
180+
Name: !Sub '${AWS::StackName}-ECRRepository'
181+
182+
CustomDomainURL:
183+
Description: Custom domain URL
184+
Value: !Sub 'https://${DomainName}'

yarn.lock

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
eslint-visitor-keys "^3.4.3"
1111

1212
"@eslint-community/regexpp@^4.6.1":
13-
version "4.12.1"
14-
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0"
15-
integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==
13+
version "4.12.2"
14+
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.2.tgz#bccdf615bcf7b6e8db830ec0b8d21c9a25de597b"
15+
integrity sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==
1616

1717
"@eslint/eslintrc@^2.1.4":
1818
version "2.1.4"
@@ -114,9 +114,9 @@
114114
fastq "^1.6.0"
115115

116116
"@paralleldrive/cuid2@^2.2.2":
117-
version "2.2.2"
118-
resolved "https://registry.yarnpkg.com/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz#7f91364d53b89e2c9cb9e02e8dd0f129e834455f"
119-
integrity sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==
117+
version "2.3.1"
118+
resolved "https://registry.yarnpkg.com/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz#3d62ea9e7be867d3fa94b9897fab5b0ae187d784"
119+
integrity sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==
120120
dependencies:
121121
"@noble/hashes" "^1.1.5"
122122

@@ -161,11 +161,11 @@
161161
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
162162

163163
"@types/node@*":
164-
version "24.7.2"
165-
resolved "https://registry.yarnpkg.com/@types/node/-/node-24.7.2.tgz#5adf66b6e2ac5cab1d10a2ad3682e359cb652f4a"
166-
integrity sha512-/NbVmcGTP+lj5oa4yiYxxeBjRivKQ5Ns1eSZeB99ExsEQ6rX5XYU1Zy/gGxY/ilqtD4Etx9mKyrPxZRetiahhA==
164+
version "24.10.0"
165+
resolved "https://registry.yarnpkg.com/@types/node/-/node-24.10.0.tgz#6b79086b0dfc54e775a34ba8114dcc4e0221f31f"
166+
integrity sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A==
167167
dependencies:
168-
undici-types "~7.14.0"
168+
undici-types "~7.16.0"
169169

170170
"@types/vinyl@^2.0.9":
171171
version "2.0.12"
@@ -612,9 +612,9 @@ aws4@^1.8.0:
612612
integrity sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==
613613

614614
axios@^1.12.0:
615-
version "1.12.2"
616-
resolved "https://registry.yarnpkg.com/axios/-/axios-1.12.2.tgz#6c307390136cf7a2278d09cec63b136dfc6e6da7"
617-
integrity sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==
615+
version "1.13.2"
616+
resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.2.tgz#9ada120b7b5ab24509553ec3e40123521117f687"
617+
integrity sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==
618618
dependencies:
619619
follow-redirects "^1.15.6"
620620
form-data "^4.0.4"
@@ -655,9 +655,9 @@ balanced-match@^1.0.0:
655655
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
656656

657657
bare-events@^2.7.0:
658-
version "2.8.0"
659-
resolved "https://registry.yarnpkg.com/bare-events/-/bare-events-2.8.0.tgz#ec962fa9e2bfafd4edd444942df1ed0c7aba8e4a"
660-
integrity sha512-AOhh6Bg5QmFIXdViHbMc2tLDsBIRxdkIaIddPslJF9Z5De3APBScuqGP2uThXnIpqFrgoxMNC6km7uXNIMLHXA==
658+
version "2.8.2"
659+
resolved "https://registry.yarnpkg.com/bare-events/-/bare-events-2.8.2.tgz#7b3e10bd8e1fc80daf38bb516921678f566ab89f"
660+
integrity sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==
661661

662662
base64-js@^1.3.1:
663663
version "1.5.1"
@@ -3338,7 +3338,7 @@ is-callable@^1.2.7:
33383338
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055"
33393339
integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==
33403340

3341-
is-core-module@^2.13.0, is-core-module@^2.16.0, is-core-module@^2.16.1:
3341+
is-core-module@^2.13.0, is-core-module@^2.16.1:
33423342
version "2.16.1"
33433343
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4"
33443344
integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==
@@ -4249,9 +4249,9 @@ mocha@^10.2.0:
42494249
yargs-unparser "^2.0.0"
42504250

42514251
mocha@^11.7.1:
4252-
version "11.7.4"
4253-
resolved "https://registry.yarnpkg.com/mocha/-/mocha-11.7.4.tgz#f161b17aeccb0762484b33bdb3f7ab9410ba5c82"
4254-
integrity sha512-1jYAaY8x0kAZ0XszLWu14pzsf4KV740Gld4HXkhNTXwcHx4AUEDkPzgEHg9CM5dVcW+zv036tjpsEbLraPJj4w==
4252+
version "11.7.5"
4253+
resolved "https://registry.yarnpkg.com/mocha/-/mocha-11.7.5.tgz#58f5bbfa5e0211ce7e5ee6128107cefc2515a627"
4254+
integrity sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==
42554255
dependencies:
42564256
browser-stdout "^1.3.1"
42574257
chokidar "^4.0.1"
@@ -4276,9 +4276,9 @@ mocha@^11.7.1:
42764276
yargs-unparser "^2.0.0"
42774277

42784278
mochawesome-report-generator@^6.3.0:
4279-
version "6.3.0"
4280-
resolved "https://registry.yarnpkg.com/mochawesome-report-generator/-/mochawesome-report-generator-6.3.0.tgz#7acbda63546e40fc9f0512c14267be2b294012df"
4281-
integrity sha512-t9IOqFOymbk39YPYSPU6Z4hIhlpSdB+sI283jO+5YAEqqU79df57UrmS8ByOwrc+EVZ7fuL4e0dMWP5RofWeyg==
4279+
version "6.3.2"
4280+
resolved "https://registry.yarnpkg.com/mochawesome-report-generator/-/mochawesome-report-generator-6.3.2.tgz#a628c120eeeba05a2e38c74583c4302068c291c5"
4281+
integrity sha512-iB6iyOUMyMr8XOUYTNfrqYuZQLZka3K/Gr2GPc6CHPe7t2ZhxxfcoVkpMLOtyDKnWbY1zgu1/7VNRsigrvKnOQ==
42824282
dependencies:
42834283
chalk "^4.1.2"
42844284
dateformat "^4.5.1"
@@ -4290,7 +4290,6 @@ mochawesome-report-generator@^6.3.0:
42904290
prop-types "^15.7.2"
42914291
tcomb "^3.2.17"
42924292
tcomb-validation "^3.3.0"
4293-
validator "^13.6.0"
42944293
yargs "^17.2.1"
42954294

42964295
mochawesome@^7.1.3:
@@ -4346,9 +4345,9 @@ mute-stdout@^2.0.0:
43464345
integrity sha512-32GSKM3Wyc8dg/p39lWPKYu8zci9mJFzV1Np9Of0ZEpe6Fhssn/FbI7ywAMd40uX+p3ZKh3T5EeCFv81qS3HmQ==
43474346

43484347
nan@^2.12.1:
4349-
version "2.23.0"
4350-
resolved "https://registry.yarnpkg.com/nan/-/nan-2.23.0.tgz#24aa4ddffcc37613a2d2935b97683c1ec96093c6"
4351-
integrity sha512-1UxuyYGdoQHcGg87Lkqm3FzefucTa0NAiOcuRsDmysep3c1LVCRK2krrUDafMWtjSG04htvAmvg96+SDknOmgQ==
4348+
version "2.23.1"
4349+
resolved "https://registry.yarnpkg.com/nan/-/nan-2.23.1.tgz#6f86a31dd87e3d1eb77512bf4b9e14c8aded3975"
4350+
integrity sha512-r7bBUGKzlqk8oPBDYxt6Z0aEdF1G1rwlMcLk8LCOMbOzf0mG+JUfUzG4fIMWwHWP0iyaLWEQZJmtB7nOHEm/qw==
43524351

43534352
nanomatch@^1.2.9:
43544353
version "1.2.13"
@@ -5462,11 +5461,11 @@ resolve-url@^0.2.1:
54625461
integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==
54635462

54645463
resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.4, resolve@^1.4.0, resolve@^1.8.1:
5465-
version "1.22.10"
5466-
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39"
5467-
integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==
5464+
version "1.22.11"
5465+
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.11.tgz#aad857ce1ffb8bfa9b0b1ac29f1156383f68c262"
5466+
integrity sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==
54685467
dependencies:
5469-
is-core-module "^2.16.0"
5468+
is-core-module "^2.16.1"
54705469
path-parse "^1.0.7"
54715470
supports-preserve-symlinks-flag "^1.0.0"
54725471

@@ -6218,9 +6217,9 @@ swagger-schema-official@2.0.0-bab6bed:
62186217
integrity sha512-rCC0NWGKr/IJhtRuPq/t37qvZHI/mH4I4sxflVM+qgVe5Z2uOCivzWaVbuioJaB61kvm5UvB7b49E+oBY0M8jA==
62196218

62206219
swagger-ui-dist@>=4.11.0:
6221-
version "5.29.4"
6222-
resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-5.29.4.tgz#ba86ff7e18b6b23eecfc32a81220f032d748b468"
6223-
integrity sha512-gJFDz/gyLOCQtWwAgqs6Rk78z9ONnqTnlW11gimG9nLap8drKa3AJBKpzIQMIjl5PD2Ix+Tn+mc/tfoT2tgsng==
6220+
version "5.30.2"
6221+
resolved "https://registry.yarnpkg.com/swagger-ui-dist/-/swagger-ui-dist-5.30.2.tgz#b146c5bd92cc712340f8847b546ea64d785efeb2"
6222+
integrity sha512-HWCg1DTNE/Nmapt+0m2EPXFwNKNeKK4PwMjkwveN/zn1cV2Kxi9SURd+m0SpdcSgWEK/O64sf8bzXdtUhigtHA==
62246223
dependencies:
62256224
"@scarf/scarf" "=1.4.0"
62266225

@@ -6626,10 +6625,10 @@ undertaker@^2.0.0:
66266625
last-run "^2.0.0"
66276626
undertaker-registry "^2.0.0"
66286627

6629-
undici-types@~7.14.0:
6630-
version "7.14.0"
6631-
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.14.0.tgz#4c037b32ca4d7d62fae042174604341588bc0840"
6632-
integrity sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA==
6628+
undici-types@~7.16.0:
6629+
version "7.16.0"
6630+
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46"
6631+
integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==
66336632

66346633
union-value@^1.0.0:
66356634
version "1.0.1"
@@ -6734,11 +6733,6 @@ validator@^10.0.0:
67346733
resolved "https://registry.yarnpkg.com/validator/-/validator-10.11.0.tgz#003108ea6e9a9874d31ccc9e5006856ccd76b228"
67356734
integrity sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==
67366735

6737-
validator@^13.6.0:
6738-
version "13.15.15"
6739-
resolved "https://registry.yarnpkg.com/validator/-/validator-13.15.15.tgz#246594be5671dc09daa35caec5689fcd18c6e7e4"
6740-
integrity sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A==
6741-
67426736
value-or-function@^3.0.0:
67436737
version "3.0.0"
67446738
resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813"

0 commit comments

Comments
 (0)