Skip to content

Commit

Permalink
template API Domain Name
Browse files Browse the repository at this point in the history
  • Loading branch information
devksingh4 committed Oct 3, 2023
1 parent 073bec0 commit 7ee6724
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_DEV_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEV_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- run: ./deploy.sh
- run: ./deploy-dev.sh
12 changes: 8 additions & 4 deletions cloudformation/lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ Parameters:
Type: String
AllowedPattern: ^[a-zA-Z0-9]+[a-zA-Z0-9-]+[a-zA-Z0-9]+$
Default: infra-resume-book-auth-data

ApiDomainName:
Type: String
Default: resume-api.acm.illinois.edu
ApiCertificateArn:
Type: String
Default: !Sub arn:aws:acm:${AWS::Region}:${AWS::AccountId}:certificate/4ba7200a-cfc7-4234-b242-0281030df5f5

Resources:
# API Lambda
Expand Down Expand Up @@ -162,9 +167,8 @@ Resources:
CombinedAuthorizer:
FunctionArn: !GetAtt ResumeBookAuthLambdaFunction.Arn
Domain:
DomainName: resume-api.acm.illinois.edu
CertificateArn: >-
arn:aws:acm:us-east-1:298118738376:certificate/4ba7200a-cfc7-4234-b242-0281030df5f5
DomainName: !Sub ApiDomainName
CertificateArn: !Sub ApiCertificateArn
StageName: default

AadAuthorizerPermission:
Expand Down
3 changes: 3 additions & 0 deletions deploy-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
sam build --template-file cloudformation/lambda.yml --parameter-overrides ParameterKey=ApiDomainName,ParameterValue=resume-api-dev.acm.illinois.edu ParameterKey=ApiCertificateArn,ParameterValue=arn:aws:acm:us-east-1:427040638965:certificate/07a0f957-15ae-4330-be14-25814728b981
sam deploy --no-confirm-changeset --no-fail-on-empty-changeset
3 changes: 2 additions & 1 deletion docs/swagger-resume-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ info:
email: [email protected]

servers:
- url: api.resumes.acm.illinois.edu
- url:
Fn::Sub: ${ApiDomainName}

tags:
- name: Student
Expand Down

0 comments on commit 7ee6724

Please sign in to comment.