-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API GatewaybugThis issue is a bug.This issue is a bug.language/dotnetRelated to .NET bindingsRelated to .NET bindingsp0
Description
Regardless what is set in MethodResponses and IntegrationOptions, the cdk synth command output cloud formation wouldn't have those configuration as part of its Cloud Formation output when using cdk for .NET.
Here is the .NET C# code, you can see there are some configurations related to Status code 200
var serviceResourceMethodResponses = new Dictionary<string, object>[] { new Dictionary<string, object>()};
serviceResourceMethodResponses[0].Add("StatusCode", "200");
serviceResourceMethodResponses[0].Add("ResponseModels", new Dictionary<string, string> { { "application/json", "Empty" } });
var integrationResponseOptions = new IntegrationOptions
{
IntegrationResponses = new IntegrationResponse[] { new IntegrationResponse {
StatusCode = "200",
ResponseTemplates = new Dictionary<string, string> { {"application/json", "" } }
}}
};
var serviceGet = new CfnMethod_(this, "serviceGetId", new CfnMethodProps
{
HttpMethod = "GET",
Integration = new IntegrationProps
{
Type = IntegrationType.AwsProxy,
Options = integrationResponseOptions,
IntegrationHttpMethod = "GET",
Uri = $"arn:aws:apigateway:{region}:lambda:path/2015-03-31/functions/{DemoAPIG.FunctionArn}/invocations"
},
ResourceId = serviceResource.ResourceId,
ApiKeyRequired = false,
AuthorizationType = "AWS_IAM",
RestApiId = apigForWorkDocsGoService.RestApiId,
MethodResponses = serviceResourceMethodResponses
});
serviceGet.AddDependsOn(serviceResource);
Here is the Cloud Formation Output from cdk synth command and no integration configuration nor the method response configuration
serviceGetId:
Type: AWS::ApiGateway::Method
Properties:
HttpMethod: GET
ResourceId:
Ref: serviceResourceId
RestApiId:
Ref: apigForDemoServiceId
ApiKeyRequired: false
AuthorizationType: AWS_IAM
Integration:
IntegrationHttpMethod: GET
Type: AWS_PROXY
Uri:
Fn::Join:
- ""
- - arn:aws:apigateway:ap-northeast-1:lambda:path/2015-03-31/functions/
- Fn::GetAtt:
- DemoAPIGId
- Arn
- /invocations
DependsOn:
- serviceResourceId
Metadata:
aws:cdk:path: nrt-prod/serviceGetId
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API GatewaybugThis issue is a bug.This issue is a bug.language/dotnetRelated to .NET bindingsRelated to .NET bindingsp0