This file contains hidden or 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: my-service | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
functions: | |
getSecret: | |
handler: handler.getSecret | |
environment: |
This file contains hidden or 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
// DEV/TEST | |
{ | |
"message" : "this is a static message / this is a dynamic DEV/TEST message" | |
} | |
// PROD | |
{ | |
"message" : "this is a static message / this is a dynamic PROD message" |
This file contains hidden or 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
// foo function | |
module.exports.handler = async (event, context) => { | |
return { | |
statusCode: 200, | |
body: JSON.stringify({ | |
message: `${process.env.staticMessage} / ${process.env.dynamicMessage}`, | |
}) | |
}; | |
}; |
This file contains hidden or 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: my-service | |
plugins: | |
- serverless-plugin-ifelse | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
stage: ${opt:stage, "dev"} | |
environment: |
This file contains hidden or 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: my-service | |
plugins: | |
- serverless-plugin-ifelse | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
stage: ${opt:stage, "dev"} |
This file contains hidden or 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
{ | |
"name": "implement-if-then-logic-in-your-serverless.yml-file", | |
"devDependencies": { | |
"serverless-plugin-ifelse": "^1.0.5" | |
} | |
} |
This file contains hidden or 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: my-other-service | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
stage: ${opt:stage, "dev"} | |
region: us-east-1 | |
environment: | |
UserPoolId: !ImportValue UserPoolId-my-user-pool-${self:provider.stage} | |
UserPoolClientId: !ImportValue UserPoolClientId-my-user-pool-${self:provider.stage} |
This file contains hidden or 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: my-user-pool | |
provider: | |
name: aws | |
stage: ${opt:stage, "dev"} | |
custom: | |
COGNITO_USER_POOL: ${self:service.name}-${self:provider.stage} | |
COGNITO_CLIENT: ${self:service.name}-cognito-client-${self:provider.stage} |
This file contains hidden or 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: my-user-pool | |
provider: | |
name: aws | |
stage: ${opt:stage, "dev"} | |
custom: | |
COGNITO_USER_POOL: ${self:service.name}-${self:provider.stage} | |
COGNITO_CLIENT: ${self:service.name}-cognito-client-${self:provider.stage} |
This file contains hidden or 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: my-user-pool | |
provider: | |
name: aws | |
stage: ${opt:stage, "dev"} | |
custom: | |
COGNITO_USER_POOL: ${self:service.name}-${self:provider.stage} | |
COGNITO_CLIENT: ${self:service.name}-cognito-client-${self:provider.stage} |