diff --git a/packages/@aws-cdk/aws-apigatewayv2/test/integ.ap.expected.json b/packages/@aws-cdk/aws-apigatewayv2/test/integ.ap.expected.json new file mode 100644 index 0000000000000..3d1c9cdc6c3ec --- /dev/null +++ b/packages/@aws-cdk/aws-apigatewayv2/test/integ.ap.expected.json @@ -0,0 +1,601 @@ +{ + "Resources": { + "MyFuncServiceRole54065130": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "MyFunc8A243A2C": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "\nimport json\ndef handler(event, context):\n return {\n 'statusCode': 200,\n 'body': json.dumps(event)\n }" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "MyFuncServiceRole54065130", + "Arn" + ] + }, + "Runtime": "python3.7" + }, + "DependsOn": [ + "MyFuncServiceRole54065130" + ] + }, + "RootFuncServiceRoleE4AA9E41": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "RootFuncF39FB174": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "\nimport json, os\ndef handler(event, context):\n whoami = os.environ['WHOAMI']\n http_path = os.environ['HTTP_PATH']\n return {\n 'statusCode': 200,\n 'body': json.dumps({ 'whoami': whoami, 'http_path': http_path })\n }" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "RootFuncServiceRoleE4AA9E41", + "Arn" + ] + }, + "Runtime": "python3.7", + "Environment": { + "Variables": { + "WHOAMI": "root", + "HTTP_PATH": "/" + } + } + }, + "DependsOn": [ + "RootFuncServiceRoleE4AA9E41" + ] + }, + "LambdaProxyApi67594471": { + "Type": "AWS::ApiGatewayV2::Api", + "Properties": { + "Name": "LambdaProxyApi", + "ProtocolType": "HTTP", + "Target": { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] + } + } + }, + "LambdaProxyApiPermission126890B4": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "MyFunc8A243A2C" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:aws:execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "LambdaProxyApi67594471" + }, + "/*/*" + ] + ] + } + } + }, + "IntegrationRootRoute": { + "Type": "AWS::ApiGatewayV2::Integration", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "IntegrationType": "AWS_PROXY", + "IntegrationMethod": "POST", + "IntegrationUri": { + "Fn::Join": [ + "", + [ + "arn:aws:apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "RootFuncF39FB174", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "PayloadFormatVersion": "1.0" + } + }, + "PermissionRootRoute": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "RootFuncF39FB174" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:aws:execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "LambdaProxyApi67594471" + }, + "/*/*" + ] + ] + } + } + }, + "RootRouteResoruceDCB7CC4A": { + "Type": "AWS::ApiGatewayV2::Route", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "RouteKey": "ANY /", + "Target": { + "Fn::Join": [ + "", + [ + "integrations/", + { + "Ref": "IntegrationRootRoute" + } + ] + ] + } + } + }, + "RootRouteIntegrationFoo7869F96E": { + "Type": "AWS::ApiGatewayV2::Integration", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "IntegrationType": "AWS_PROXY", + "IntegrationMethod": "POST", + "IntegrationUri": { + "Fn::Join": [ + "", + [ + "arn:aws:apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "PayloadFormatVersion": "1.0" + } + }, + "RootRoutePermissionFoo06AF804C": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "MyFunc8A243A2C" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:aws:execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "LambdaProxyApi67594471" + }, + "/*/*" + ] + ] + } + } + }, + "RootRouteFooResoruceB48AF356": { + "Type": "AWS::ApiGatewayV2::Route", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "RouteKey": "GET /foo", + "Target": { + "Fn::Join": [ + "", + [ + "integrations/", + { + "Ref": "RootRouteIntegrationFoo7869F96E" + } + ] + ] + } + } + }, + "RootRouteFooIntegrationFooCheckIp87863B2F": { + "Type": "AWS::ApiGatewayV2::Integration", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "IntegrationType": "HTTP_PROXY", + "IntegrationMethod": "ANY", + "IntegrationUri": "https://checkip.amazonaws.com", + "PayloadFormatVersion": "1.0" + } + }, + "RootRouteFooFooCheckIpResoruce7E7874A1": { + "Type": "AWS::ApiGatewayV2::Route", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "RouteKey": "ANY /foo/checkip", + "Target": { + "Fn::Join": [ + "", + [ + "integrations/", + { + "Ref": "RootRouteFooIntegrationFooCheckIp87863B2F" + } + ] + ] + } + } + }, + "HttpProxyApiD0217C67": { + "Type": "AWS::ApiGatewayV2::Api", + "Properties": { + "Name": "HttpProxyApi", + "ProtocolType": "HTTP", + "Target": "https://aws.amazon.com" + } + }, + "IntegrationSomeLambdaRoute": { + "Type": "AWS::ApiGatewayV2::Integration", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "IntegrationType": "AWS_PROXY", + "IntegrationMethod": "POST", + "IntegrationUri": { + "Fn::Join": [ + "", + [ + "arn:aws:apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "PayloadFormatVersion": "1.0" + } + }, + "PermissionSomeLambdaRoute": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "MyFunc8A243A2C" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:aws:execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "LambdaProxyApi67594471" + }, + "/*/*" + ] + ] + } + } + }, + "SomeLambdaRouteResoruce8A88D44E": { + "Type": "AWS::ApiGatewayV2::Route", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "RouteKey": "ANY /some/very/deep/route/path", + "Target": { + "Fn::Join": [ + "", + [ + "integrations/", + { + "Ref": "IntegrationSomeLambdaRoute" + } + ] + ] + } + } + }, + "SomeLambdaRouteIntegrationSomeDeepPathBar96AE7930": { + "Type": "AWS::ApiGatewayV2::Integration", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "IntegrationType": "AWS_PROXY", + "IntegrationMethod": "POST", + "IntegrationUri": { + "Fn::Join": [ + "", + [ + "arn:aws:apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "MyFunc8A243A2C", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "PayloadFormatVersion": "1.0" + } + }, + "SomeLambdaRoutePermissionSomeDeepPathBar34A20879": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Ref": "MyFunc8A243A2C" + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:aws:execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "LambdaProxyApi67594471" + }, + "/*/*" + ] + ] + } + } + }, + "SomeLambdaRouteSomeDeepPathBarResoruceC800EE14": { + "Type": "AWS::ApiGatewayV2::Route", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "RouteKey": "GET /some/very/deep/route/path/bar", + "Target": { + "Fn::Join": [ + "", + [ + "integrations/", + { + "Ref": "SomeLambdaRouteIntegrationSomeDeepPathBar96AE7930" + } + ] + ] + } + } + }, + "SomeLambdaRouteSomeDeepPathBarIntegrationSomeDeepPathBarCheckIp911CF681": { + "Type": "AWS::ApiGatewayV2::Integration", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "IntegrationType": "HTTP_PROXY", + "IntegrationMethod": "ANY", + "IntegrationUri": "https://checkip.amazonaws.com", + "PayloadFormatVersion": "1.0" + } + }, + "SomeLambdaRouteSomeDeepPathBarSomeDeepPathBarCheckIpResoruce5039BD41": { + "Type": "AWS::ApiGatewayV2::Route", + "Properties": { + "ApiId": { + "Ref": "LambdaProxyApi67594471" + }, + "RouteKey": "ANY /some/very/deep/route/path/bar/checkip", + "Target": { + "Fn::Join": [ + "", + [ + "integrations/", + { + "Ref": "SomeLambdaRouteSomeDeepPathBarIntegrationSomeDeepPathBarCheckIp911CF681" + } + ] + ] + } + } + } + }, + "Outputs": { + "LambdaProxyApiLambdaProxyApiUrl2866EF1B": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "LambdaProxyApi67594471" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com" + ] + ] + } + }, + "HttpProxyApiHttpProxyApiUrl25461D7F": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "HttpProxyApiD0217C67" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com" + ] + ] + } + }, + "SomeDeepLambdaRouteURL": { + "Value": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "LambdaProxyApi67594471" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".amazonaws.com/some/very/deep/route/path" + ] + ] + } + } + } +} \ No newline at end of file