I'm creating a new HTTP API using CloudFormation. The template creates a test route with lambda integration. When I view the integration in the UI, it looks bugged, it's missing information and the details are empty. Is my template wrong or is this a bug in the UI?
Screenshots:
https://codifycore-public.s3-us-west-2.amazonaws.com/api-gateway-integrations-bug-01.png
https://codifycore-public.s3-us-west-2.amazonaws.com/api-gateway-edit-integration-bug.png
CloudFormation template:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Designer": {
"79f7cdf8-1fde-4957-9e30-0d1064c5d99f": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 260,
"y": 70
},
"z": 1,
"embeds": []
},
"6d19e647-11c0-42ec-bdf4-012398fe2324": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 480,
"y": 70
},
"z": 1,
"embeds": []
},
"ef35ce79-c64f-468a-a556-27f2db988ff1": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 150,
"y": 70
},
"z": 1,
"embeds": []
},
"7516a14e-b343-4dac-8f03-fd5e2b7dc0f7": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 380,
"y": 70
},
"z": 1,
"embeds": []
},
"2928fc4a-d018-4b97-b9bf-945e935370a0": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 260,
"y": 180
},
"z": 1,
"embeds": []
},
"2ef49365-4aa4-43db-a233-3e590eb62520": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 580,
"y": 70
},
"z": 0,
"embeds": []
},
"3d44bc9d-733c-4b7f-9bb8-592454c8b016": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 380,
"y": 180
},
"z": 0,
"embeds": []
}
}
},
"Parameters": {},
"Resources": {
"MyTestApi": {
"Type": "AWS::ApiGatewayV2::Api",
"Properties": {
"Name": "MyTestApi",
"ProtocolType": "HTTP"
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "79f7cdf8-1fde-4957-9e30-0d1064c5d99f"
}
}
},
"TestFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Handler": "index.handler",
"FunctionName": "MyApiTestFunction",
"Role": {
"Fn::GetAtt": [
"TestFunctionRole",
"Arn"
]
},
"Runtime": "nodejs12.x",
"Code": {
"ZipFile": "exports.handler = async function(event, context) { return {statusCode: 200, body: JSON.stringify({message: 'Success'})}; }"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "6d19e647-11c0-42ec-bdf4-012398fe2324"
}
}
},
"ProdStage": {
"Type": "AWS::ApiGatewayV2::Stage",
"Properties": {
"AutoDeploy": true,
"StageName": "$default",
"ApiId": {
"Ref": "MyTestApi"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "ef35ce79-c64f-468a-a556-27f2db988ff1"
}
}
},
"TestRoute": {
"Type": "AWS::ApiGatewayV2::Route",
"Properties": {
"ApiId": {
"Ref": "MyTestApi"
},
"RouteKey": "GET /test",
"Target": {
"Fn::Join": [
"/",
[
"integrations",
{
"Ref": "TestIntegration"
}
]
]
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "2928fc4a-d018-4b97-b9bf-945e935370a0"
}
}
},
"TestIntegration": {
"Type": "AWS::ApiGatewayV2::Integration",
"Properties": {
"ApiId": {
"Ref": "MyTestApi"
},
"CredentialsArn": {
"Fn::GetAtt": [
"ApiGatewayInvokationRole",
"Arn"
]
},
"IntegrationType": "AWS_PROXY",
"IntegrationMethod": "POST",
"PayloadFormatVersion": "1.0",
"IntegrationUri": {
"Fn::GetAtt": [
"TestFunction",
"Arn"
]
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "7516a14e-b343-4dac-8f03-fd5e2b7dc0f7"
}
}
},
"TestFunctionRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
},
"Policies": [
{
"PolicyName": "TestFunctionPolicy",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "logs:CreateLogGroup",
"Resource": {
"Fn::Sub": "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:*"
}
},
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": [
{
"Fn::Sub": "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/testfunction:*"
}
]
}
]
}
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "2ef49365-4aa4-43db-a233-3e590eb62520"
}
}
},
"ApiGatewayInvokationRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "apigateway.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
},
"Policies": [
{
"PolicyName": "ApiGatewayInvokationRole",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "lambda:InvokeFunction",
"Resource": {
"Fn::Sub": "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:*"
}
}
]
}
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "3d44bc9d-733c-4b7f-9bb8-592454c8b016"
}
}
}
}
}
Edited by: khatiba on Jan 28, 2020 5:31 PM