I am trying to not provision concurrency for development stage.
I have tried setting provisionedConcurrency to 0 or null or ~ or 1 but nothings works.
I think the issue is two fold:
- enviroment variable is being read in as a string and not integer. In the cloud formation template below I tested the difference between PROVISIONED_LIMIT=1 (in .ENV) and setting provisionedConcurrency: 1 in YAML - there was a difference. The value from .env is read is “1” where as when set in YAML directly it is 1
- cloudformation does not like null in the template - therefore there is no way to exclude provisioning. I tested this by putting in null directly into the YAML and this didn’t work.
The error recieved is - for development or production stage
Serverless: DOTENV: Loading environment variables from .env.development:
Serverless: - PROVISIONED_LIMIT
Serverless: Configuration warning:
Serverless: at 'functions.create.provisionedConcurrency': should be integer
Serverless: at 'functions.get.provisionedConcurrency': should be integer
Serverless: at 'functions.list.provisionedConcurrency': should be integer
Serverless: at 'functions.update.provisionedConcurrency': should be integer
Serverless: Validating template...
Error --------------------------------------------------
Error: The CloudFormation template is invalid: [/Resources/CreateProvConcLambdaAlias/Type/ProvisionedConcurrencyConfig/ProvisionedConcurrentExecutions] 'null' values are not allowed in templates
.dev.development
PROVISIONED_LIMIT=null
I have also tried ~ and 0 and 1 but nothing works.
.dev.production
PROVISIONED_LIMIT=1
serverless.yaml extract
custom:
provisionedLimit: ${env:PROVISIONED_LIMIT}
functions:
create:
handler: create.main
provisionedConcurrency: provisionedLimit
events:
- http:
path: events
method: post
cors: true
authorizer: aws_iam
get:
handler: get.main
provisionedConcurrency: provisionedLimit
events:
- http:
path: 'events/{id}'
method: get
cors: true
authorizer: aws_iam
list:
handler: list.main
provisionedConcurrency: provisionedLimit
events:
- http:
path: events
method: get
cors: true
authorizer: aws_iam
update:
handler: update.main
provisionedConcurrency: provisionedLimit
events:
- http:
path: 'events/{id}'
method: put
cors: true
authorizer: aws_iam
delete:
handler: delete.main
events:
- http:
path: 'events/{id}'
method: delete
cors: true
authorizer: aws_iam
packages.json extract
"devDependencies": {
"aws-sdk": "latest",
"jest": "latest",
"serverless-bundle": "latest",
"serverless-dotenv-plugin": "latest",
"serverless-offline": "latest"
},
cloud formation template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "The AWS CloudFormation template for this Serverless application",
"Resources": {
"ServerlessDeploymentBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketEncryption": {
"ServerSideEncryptionConfiguration": [
{
"ServerSideEncryptionByDefault": {
"SSEAlgorithm": "AES256"
}
}
]
}
}
},
"ServerlessDeploymentBucketPolicy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"PolicyDocument": {
"Statement": [
{
"Action": "s3:*",
"Effect": "Deny",
"Principal": "*",
"Resource": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":s3:::",
{
"Ref": "ServerlessDeploymentBucket"
},
"/*"
]
]
}
],
"Condition": {
"Bool": {
"aws:SecureTransport": false
}
}
}
]
}
}
},
"CreateLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"LogGroupName": "/aws/lambda/events-dev-create"
}
},
"GetLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"LogGroupName": "/aws/lambda/events-dev-get"
}
},
"ListLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"LogGroupName": "/aws/lambda/events-dev-list"
}
},
"UpdateLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"LogGroupName": "/aws/lambda/events-dev-update"
}
},
"DeleteLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"LogGroupName": "/aws/lambda/events-dev-delete"
}
},
"IamRoleLambdaExecution": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": [
"lambda.amazonaws.com"
]
},
"Action": [
"sts:AssumeRole"
]
}
]
},
"Policies": [
{
"PolicyName": {
"Fn::Join": [
"-",
[
"events",
"dev",
"lambda"
]
]
},
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:CreateLogGroup"
],
"Resource": [
{
"Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/events-dev*:*"
}
]
},
{
"Effect": "Allow",
"Action": [
"logs:PutLogEvents"
],
"Resource": [
{
"Fn::Sub": "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/events-dev*:*:*"
}
]
},
{
"Effect": "Allow",
"Action": [
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
"dynamodb:DescribeTable"
],
"Resource": [
{
"Fn::ImportValue": "dev-rememberwhen-infra-TableArn"
}
]
}
]
}
}
],
"Path": "/",
"RoleName": {
"Fn::Join": [
"-",
[
"events",
"dev",
{
"Ref": "AWS::Region"
},
"lambdaRole"
]
]
}
}
},
"CreateLambdaFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"S3Key": "serverless/events/dev/1603806948318-2020-10-27T13:55:48.318Z/create.zip"
},
"FunctionName": "events-dev-create",
"Handler": "create.main",
"MemorySize": 128,
"Role": {
"Fn::GetAtt": [
"IamRoleLambdaExecution",
"Arn"
]
},
"Runtime": "nodejs12.x",
"Timeout": 6,
"Environment": {
"Variables": {
"tableName": {
"Fn::ImportValue": "dev-rememberwhen-infra-TableName"
},
"PROVISIONED_LIMIT": "1"
}
}
},
"DependsOn": [
"CreateLogGroup"
]
},
"CreateLambdaVersionoobpEDbikA0tFLhMwMT5uHSJCeZmZ3B9vtHLqXS05E": {
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
"Ref": "CreateLambdaFunction"
},
"CodeSha256": "Z5YpRxSzGKn/PYRzCjB2q7kTB/mMSf72OzhYXEkeK1s="
}
},
"CreateProvConcLambdaAlias": {
"Type": "AWS::Lambda::Alias",
"Properties": {
"FunctionName": {
"Ref": "CreateLambdaFunction"
},
"FunctionVersion": {
"Fn::GetAtt": [
"CreateLambdaVersionoobpEDbikA0tFLhMwMT5uHSJCeZmZ3B9vtHLqXS05E",
"Version"
]
},
"Name": "provisioned",
"ProvisionedConcurrencyConfig": {
"ProvisionedConcurrentExecutions": 1
}
},
"DependsOn": "CreateLambdaFunction"
},
"GetLambdaFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"S3Key": "serverless/events/dev/1603806948318-2020-10-27T13:55:48.318Z/get.zip"
},
"FunctionName": "events-dev-get",
"Handler": "get.main",
"MemorySize": 128,
"Role": {
"Fn::GetAtt": [
"IamRoleLambdaExecution",
"Arn"
]
},
"Runtime": "nodejs12.x",
"Timeout": 6,
"Environment": {
"Variables": {
"tableName": {
"Fn::ImportValue": "dev-rememberwhen-infra-TableName"
},
"PROVISIONED_LIMIT": "1"
}
}
},
"DependsOn": [
"GetLogGroup"
]
},
"GetLambdaVersionGqemDQz2HdigHhCf4Yg4QPlFaIFBRgncLgxWPzRg": {
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
"Ref": "GetLambdaFunction"
},
"CodeSha256": "h6uZ7gEIn8U9LO2U/4rOn5ndli0ADk2Bm6pC8U2GTIM="
}
},
"GetProvConcLambdaAlias": {
"Type": "AWS::Lambda::Alias",
"Properties": {
"FunctionName": {
"Ref": "GetLambdaFunction"
},
"FunctionVersion": {
"Fn::GetAtt": [
"GetLambdaVersionGqemDQz2HdigHhCf4Yg4QPlFaIFBRgncLgxWPzRg",
"Version"
]
},
"Name": "provisioned",
"ProvisionedConcurrencyConfig": {
"ProvisionedConcurrentExecutions": null
}
},
"DependsOn": "GetLambdaFunction"
},
"ListLambdaFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"S3Key": "serverless/events/dev/1603806948318-2020-10-27T13:55:48.318Z/list.zip"
},
"FunctionName": "events-dev-list",
"Handler": "list.main",
"MemorySize": 128,
"Role": {
"Fn::GetAtt": [
"IamRoleLambdaExecution",
"Arn"
]
},
"Runtime": "nodejs12.x",
"Timeout": 6,
"Environment": {
"Variables": {
"tableName": {
"Fn::ImportValue": "dev-rememberwhen-infra-TableName"
},
"PROVISIONED_LIMIT": "1"
}
}
},
"DependsOn": [
"ListLogGroup"
]
},
"ListLambdaVersion6IIzc5IpANySjcqoegxn9VQbi4NFmXRSZm5n8kCs2k": {
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
"Ref": "ListLambdaFunction"
},
"CodeSha256": "NUjxQEs0mG0GMWjbo2+E1w8Oc2jfkLi4qKUnXG00wnw="
}
},
"ListProvConcLambdaAlias": {
"Type": "AWS::Lambda::Alias",
"Properties": {
"FunctionName": {
"Ref": "ListLambdaFunction"
},
"FunctionVersion": {
"Fn::GetAtt": [
"ListLambdaVersion6IIzc5IpANySjcqoegxn9VQbi4NFmXRSZm5n8kCs2k",
"Version"
]
},
"Name": "provisioned",
"ProvisionedConcurrencyConfig": {
"ProvisionedConcurrentExecutions": null
}
},
"DependsOn": "ListLambdaFunction"
},
"UpdateLambdaFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"S3Key": "serverless/events/dev/1603806948318-2020-10-27T13:55:48.318Z/update.zip"
},
"FunctionName": "events-dev-update",
"Handler": "update.main",
"MemorySize": 128,
"Role": {
"Fn::GetAtt": [
"IamRoleLambdaExecution",
"Arn"
]
},
"Runtime": "nodejs12.x",
"Timeout": 6,
"Environment": {
"Variables": {
"tableName": {
"Fn::ImportValue": "dev-rememberwhen-infra-TableName"
},
"PROVISIONED_LIMIT": "1"
}
}
},
"DependsOn": [
"UpdateLogGroup"
]
},
"UpdateLambdaVersioneDdLAXAlK618kSwUr5R1W7EBHROqNspzVcfwT7jSrM": {
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
"Ref": "UpdateLambdaFunction"
},
"CodeSha256": "LrXuJNCWiFGd6D8cZoJz+Q8NnO+qBtUUQvth6NzSZ9w="
}
},
"UpdateProvConcLambdaAlias": {
"Type": "AWS::Lambda::Alias",
"Properties": {
"FunctionName": {
"Ref": "UpdateLambdaFunction"
},
"FunctionVersion": {
"Fn::GetAtt": [
"UpdateLambdaVersioneDdLAXAlK618kSwUr5R1W7EBHROqNspzVcfwT7jSrM",
"Version"
]
},
"Name": "provisioned",
"ProvisionedConcurrencyConfig": {
"ProvisionedConcurrentExecutions": null
}
},
"DependsOn": "UpdateLambdaFunction"
},
"DeleteLambdaFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "ServerlessDeploymentBucket"
},
"S3Key": "serverless/events/dev/1603806948318-2020-10-27T13:55:48.318Z/delete.zip"
},
"FunctionName": "events-dev-delete",
"Handler": "delete.main",
"MemorySize": 128,
"Role": {
"Fn::GetAtt": [
"IamRoleLambdaExecution",
"Arn"
]
},
"Runtime": "nodejs12.x",
"Timeout": 6,
"Environment": {
"Variables": {
"tableName": {
"Fn::ImportValue": "dev-rememberwhen-infra-TableName"
},
"PROVISIONED_LIMIT": "1"
}
}
},
"DependsOn": [
"DeleteLogGroup"
]
},
"ApiGatewayRestApi": {
"Type": "AWS::ApiGateway::RestApi",
"Properties": {
"Name": "dev-events",
"EndpointConfiguration": {
"Types": [
"EDGE"
]
},
"Policy": ""
}
},
"ApiGatewayResourceEvents": {
"Type": "AWS::ApiGateway::Resource",
"Properties": {
"ParentId": {
"Fn::GetAtt": [
"ApiGatewayRestApi",
"RootResourceId"
]
},
"PathPart": "events",
"RestApiId": {
"Ref": "ApiGatewayRestApi"
}
}
},
"ApiGatewayResourceEventsIdVar": {
"Type": "AWS::ApiGateway::Resource",
"Properties": {
"ParentId": {
"Ref": "ApiGatewayResourceEvents"
},
"PathPart": "{id}",
"RestApiId": {
"Ref": "ApiGatewayRestApi"
}
}
},
"ApiGatewayMethodEventsOptions": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"AuthorizationType": "NONE",
"HttpMethod": "OPTIONS",
"MethodResponses": [
{
"StatusCode": "200",
"ResponseParameters": {
"method.response.header.Access-Control-Allow-Origin": true,
"method.response.header.Access-Control-Allow-Headers": true,
"method.response.header.Access-Control-Allow-Methods": true
},
"ResponseModels": {}
}
],
"RequestParameters": {},
"Integration": {
"Type": "MOCK",
"RequestTemplates": {
"application/json": "{statusCode:200}"
},
"ContentHandling": "CONVERT_TO_TEXT",
"IntegrationResponses": [
{
"StatusCode": "200",
"ResponseParameters": {
"method.response.header.Access-Control-Allow-Origin": "'*'",
"method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'",
"method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,POST'"
},
"ResponseTemplates": {
"application/json": "#set($origin = $input.params(\"Origin\"))\n#if($origin == \"\") #set($origin = $input.params(\"origin\")) #end\n#if($origin.matches(\".+\")) #set($context.responseOverride.header.Access-Control-Allow-Origin = $origin) #end"
}
}
]
},
"ResourceId": {
"Ref": "ApiGatewayResourceEvents"
},
"RestApiId": {
"Ref": "ApiGatewayRestApi"
}
}
},
"ApiGatewayMethodEventsIdVarOptions": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"AuthorizationType": "NONE",
"HttpMethod": "OPTIONS",
"MethodResponses": [
{
"StatusCode": "200",
"ResponseParameters": {
"method.response.header.Access-Control-Allow-Origin": true,
"method.response.header.Access-Control-Allow-Headers": true,
"method.response.header.Access-Control-Allow-Methods": true
},
"ResponseModels": {}
}
],
"RequestParameters": {},
"Integration": {
"Type": "MOCK",
"RequestTemplates": {
"application/json": "{statusCode:200}"
},
"ContentHandling": "CONVERT_TO_TEXT",
"IntegrationResponses": [
{
"StatusCode": "200",
"ResponseParameters": {
"method.response.header.Access-Control-Allow-Origin": "'*'",
"method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'",
"method.response.header.Access-Control-Allow-Methods": "'OPTIONS,DELETE,PUT,GET'"
},
"ResponseTemplates": {
"application/json": "#set($origin = $input.params(\"Origin\"))\n#if($origin == \"\") #set($origin = $input.params(\"origin\")) #end\n#if($origin.matches(\".+\")) #set($context.responseOverride.header.Access-Control-Allow-Origin = $origin) #end"
}
}
]
},
"ResourceId": {
"Ref": "ApiGatewayResourceEventsIdVar"
},
"RestApiId": {
"Ref": "ApiGatewayRestApi"
}
}
},
"ApiGatewayMethodEventsPost": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"HttpMethod": "POST",
"RequestParameters": {},
"ResourceId": {
"Ref": "ApiGatewayResourceEvents"
},
"RestApiId": {
"Ref": "ApiGatewayRestApi"
},
"ApiKeyRequired": false,
"AuthorizationType": "AWS_IAM",
"Integration": {
"IntegrationHttpMethod": "POST",
"Type": "AWS_PROXY",
"Uri": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":apigateway:",
{
"Ref": "AWS::Region"
},
":lambda:path/2015-03-31/functions/",
{
"Fn::GetAtt": [
"CreateLambdaFunction",
"Arn"
]
},
":",
"provisioned",
"/invocations"
]
]
}
},
"MethodResponses": []
}
},
"ApiGatewayMethodEventsIdVarGet": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"HttpMethod": "GET",
"RequestParameters": {},
"ResourceId": {
"Ref": "ApiGatewayResourceEventsIdVar"
},
"RestApiId": {
"Ref": "ApiGatewayRestApi"
},
"ApiKeyRequired": false,
"AuthorizationType": "AWS_IAM",
"Integration": {
"IntegrationHttpMethod": "POST",
"Type": "AWS_PROXY",
"Uri": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":apigateway:",
{
"Ref": "AWS::Region"
},
":lambda:path/2015-03-31/functions/",
{
"Fn::GetAtt": [
"GetLambdaFunction",
"Arn"
]
},
":",
"provisioned",
"/invocations"
]
]
}
},
"MethodResponses": []
}
},
"ApiGatewayMethodEventsGet": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"HttpMethod": "GET",
"RequestParameters": {},
"ResourceId": {
"Ref": "ApiGatewayResourceEvents"
},
"RestApiId": {
"Ref": "ApiGatewayRestApi"
},
"ApiKeyRequired": false,
"AuthorizationType": "AWS_IAM",
"Integration": {
"IntegrationHttpMethod": "POST",
"Type": "AWS_PROXY",
"Uri": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":apigateway:",
{
"Ref": "AWS::Region"
},
":lambda:path/2015-03-31/functions/",
{
"Fn::GetAtt": [
"ListLambdaFunction",
"Arn"
]
},
":",
"provisioned",
"/invocations"
]
]
}
},
"MethodResponses": []
}
},
"ApiGatewayMethodEventsIdVarPut": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"HttpMethod": "PUT",
"RequestParameters": {},
"ResourceId": {
"Ref": "ApiGatewayResourceEventsIdVar"
},
"RestApiId": {
"Ref": "ApiGatewayRestApi"
},
"ApiKeyRequired": false,
"AuthorizationType": "AWS_IAM",
"Integration": {
"IntegrationHttpMethod": "POST",
"Type": "AWS_PROXY",
"Uri": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":apigateway:",
{
"Ref": "AWS::Region"
},
":lambda:path/2015-03-31/functions/",
{
"Fn::GetAtt": [
"UpdateLambdaFunction",
"Arn"
]
},
":",
"provisioned",
"/invocations"
]
]
}
},
"MethodResponses": []
}
},
"ApiGatewayMethodEventsIdVarDelete": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
"HttpMethod": "DELETE",
"RequestParameters": {},
"ResourceId": {
"Ref": "ApiGatewayResourceEventsIdVar"
},
"RestApiId": {
"Ref": "ApiGatewayRestApi"
},
"ApiKeyRequired": false,
"AuthorizationType": "AWS_IAM",
"Integration": {
"IntegrationHttpMethod": "POST",
"Type": "AWS_PROXY",
"Uri": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":apigateway:",
{
"Ref": "AWS::Region"
},
":lambda:path/2015-03-31/functions/",
{
"Fn::GetAtt": [
"DeleteLambdaFunction",
"Arn"
]
},
"/invocations"
]
]
}
},
"MethodResponses": []
}
},
"ApiGatewayDeployment1603806940843": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"RestApiId": {
"Ref": "ApiGatewayRestApi"
},
"StageName": "dev"
},
"DependsOn": [
"ApiGatewayMethodEventsOptions",
"ApiGatewayMethodEventsIdVarOptions",
"ApiGatewayMethodEventsPost",
"ApiGatewayMethodEventsIdVarGet",
"ApiGatewayMethodEventsGet",
"ApiGatewayMethodEventsIdVarPut",
"ApiGatewayMethodEventsIdVarDelete"
]
},
"CreateLambdaPermissionApiGateway": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"FunctionName": {
"Fn::Join": [
":",
[
{
"Fn::GetAtt": [
"CreateLambdaFunction",
"Arn"
]
},
"provisioned"
]
]
},
"Action": "lambda:InvokeFunction",
"Principal": "apigateway.amazonaws.com",
"SourceArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":execute-api:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":",
{
"Ref": "ApiGatewayRestApi"
},
"/*/*"
]
]
}
},
"DependsOn": "CreateProvConcLambdaAlias"
},
"GetLambdaPermissionApiGateway": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"FunctionName": {
"Fn::Join": [
":",
[
{
"Fn::GetAtt": [
"GetLambdaFunction",
"Arn"
]
},
"provisioned"
]
]
},
"Action": "lambda:InvokeFunction",
"Principal": "apigateway.amazonaws.com",
"SourceArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":execute-api:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":",
{
"Ref": "ApiGatewayRestApi"
},
"/*/*"
]
]
}
},
"DependsOn": "GetProvConcLambdaAlias"
},
"ListLambdaPermissionApiGateway": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"FunctionName": {
"Fn::Join": [
":",
[
{
"Fn::GetAtt": [
"ListLambdaFunction",
"Arn"
]
},
"provisioned"
]
]
},
"Action": "lambda:InvokeFunction",
"Principal": "apigateway.amazonaws.com",
"SourceArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":execute-api:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":",
{
"Ref": "ApiGatewayRestApi"
},
"/*/*"
]
]
}
},
"DependsOn": "ListProvConcLambdaAlias"
},
"UpdateLambdaPermissionApiGateway": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"FunctionName": {
"Fn::Join": [
":",
[
{
"Fn::GetAtt": [
"UpdateLambdaFunction",
"Arn"
]
},
"provisioned"
]
]
},
"Action": "lambda:InvokeFunction",
"Principal": "apigateway.amazonaws.com",
"SourceArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":execute-api:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":",
{
"Ref": "ApiGatewayRestApi"
},
"/*/*"
]
]
}
},
"DependsOn": "UpdateProvConcLambdaAlias"
},
"DeleteLambdaPermissionApiGateway": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"FunctionName": {
"Fn::GetAtt": [
"DeleteLambdaFunction",
"Arn"
]
},
"Action": "lambda:InvokeFunction",
"Principal": "apigateway.amazonaws.com",
"SourceArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":execute-api:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":",
{
"Ref": "ApiGatewayRestApi"
},
"/*/*"
]
]
}
}
},
"GatewayResponseDefault4XX": {
"Type": "AWS::ApiGateway::GatewayResponse",
"Properties": {
"ResponseParameters": {
"gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'"
},
"ResponseType": "DEFAULT_4XX",
"RestApiId": {
"Ref": "ApiGatewayRestApi"
}
}
},
"GatewayResponseDefault5XX": {
"Type": "AWS::ApiGateway::GatewayResponse",
"Properties": {
"ResponseParameters": {
"gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'"
},
"ResponseType": "DEFAULT_5XX",
"RestApiId": {
"Ref": "ApiGatewayRestApi"
}
}
},
"CognitoAuthorizedApiPolicy": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyName": "dev-CognitoEventsAuthorizedApiPolicy",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"execute-api:Invoke"
],
"Resource": {
"Fn::Sub": "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${ApiGatewayRestApi}/*"
}
}
]
},
"Roles": [
{
"Fn::ImportValue": "dev-rememberwhen-infra-CognitoAuthRole"
}
]
}
}
},
"Outputs": {
"ServerlessDeploymentBucketName": {
"Value": {
"Ref": "ServerlessDeploymentBucket"
}
},
"CreateLambdaFunctionQualifiedArn": {
"Description": "Current Lambda function version",
"Value": {
"Ref": "CreateLambdaVersionoobpEDbikA0tFLhMwMT5uHSJCeZmZ3B9vtHLqXS05E"
}
},
"GetLambdaFunctionQualifiedArn": {
"Description": "Current Lambda function version",
"Value": {
"Ref": "GetLambdaVersionGqemDQz2HdigHhCf4Yg4QPlFaIFBRgncLgxWPzRg"
}
},
"ListLambdaFunctionQualifiedArn": {
"Description": "Current Lambda function version",
"Value": {
"Ref": "ListLambdaVersion6IIzc5IpANySjcqoegxn9VQbi4NFmXRSZm5n8kCs2k"
}
},
"UpdateLambdaFunctionQualifiedArn": {
"Description": "Current Lambda function version",
"Value": {
"Ref": "UpdateLambdaVersioneDdLAXAlK618kSwUr5R1W7EBHROqNspzVcfwT7jSrM"
}
},
"ServiceEndpoint": {
"Description": "URL of the service endpoint",
"Value": {
"Fn::Join": [
"",
[
"https://",
{
"Ref": "ApiGatewayRestApi"
},
".execute-api.",
{
"Ref": "AWS::Region"
},
".",
{
"Ref": "AWS::URLSuffix"
},
"/dev"
]
]
}
}
}
}