Skip to content

Instantly share code, notes, and snippets.

@DavidDeCoding
Created May 2, 2022 17:55
Show Gist options
  • Save DavidDeCoding/94935f2dc008a0f795cb487127e70054 to your computer and use it in GitHub Desktop.
Save DavidDeCoding/94935f2dc008a0f795cb487127e70054 to your computer and use it in GitHub Desktop.
CustomDomainAPIGateway
frameworkVersion: "3"
provider:
name: aws
stage: dev
runtime: nodejs12.x
custom:
STAGE: ${opt:stage, 'dev'}
stagedCustomDomainProps:
domainName:
prod: 'webhooks.<custom-domain>.com'
staged: 'stage-webhooks.<custom-domain>.com'
basePath:
prod: ''
staged: ${self:custom.STAGE}
provisionedConcurrency:
prod: 3
staged: 0
customDomain:
domainName: ${self:custom.stagedCustomDomainProps.domainName.${self:custom.STAGE}, self:custom.stagedCustomDomainProps.domainName.staged}
basePath: ${self:custom.stagedCustomDomainProps.basePath.${self:custom.STAGE}, self:custom.stagedCustomDomainProps.basePath.staged}
stage: ${self:custom.STAGE}
createRoute53Record: true
endpointType: regional
apiType: http
securityPolicy: tls_1_2
plugins:
- serverless-domain-manager
functions:
prospect-api:
handler: webhooks/index.prospect
timeout: 30
provisionedConcurrency: ${self:custom.stagedCustomDomainProps.provisionedConcurrency.${self:custom.STAGE}, self:custom.stagedCustomDomainProps.provisionedConcurrency.staged}
events:
- httpApi:
path: /prospect
method: post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment