This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## all other serverless.yml configuration | |
functions: | |
# your functions | |
provider: | |
name: aws | |
# your provider config | |
resources: | |
Resources: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# deploy to eu-central-1 | |
export ROUTE53_NAME=sls-latency.example.com | |
export ROUTE53_HOSTED_ZONE_ID= #<hosted zone id> | |
export DOMAIN_CERT= #<certificate id in euc1> | |
export ACCOUNT_ID= #<account id> | |
serverless deploy -s dev -r eu-central-1 | |
# deploy to us-east-1 | |
export ROUTE53_NAME=sls-latency.example.com | |
export ROUTE53_HOSTED_ZONE_ID= #<hosted zone id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Resources: | |
CustomDomain: | |
Type: AWS::ApiGateway::DomainName | |
Properties: | |
RegionalCertificateArn: arn:aws:acm:${opt:region}:${env:ACCOUNT_ID}:certificate/${env:DOMAIN_CERT} | |
DomainName: ${env:ROUTE53_NAME} | |
EndpointConfiguration: | |
Types: | |
- REGIONAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: ${self:custom.serviceName} | |
frameworkVersion: ">=1.36.1" | |
custom: | |
packageJson: ${file(./package.json)} | |
serviceName: ${self:custom.packageJson.name} | |
provider: | |
name: aws |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports.handler = (event, context, cb) => { | |
return cb(null, { | |
statusCode: 200, | |
headers: { | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify({ | |
status: 'OK' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports.handler = (event, context, cb) => { | |
return cb(null, { | |
statusCode: 200, | |
headers: { | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify({ | |
region: process.env.LAMBDA_REGION |