Skip to content

Pattern: aws-apigateway-sqs registers methods on root and a /message resource inconsistently #665

@seandall

Description

@seandall

description of the bug: When using this construct, there is a "/message" resource created which is only used for a deleteMessage capability. all other actions, such as createMessage register at root. There should be an option to specify a resource name as an input, and if not specified, everything should register at root.

Reproduction Steps

ApiGatewayToSqs(self, "ApiGatewayToSqsPattern",
                        deploy_dead_letter_queue=False,
                        allow_delete_operation=False,
                        allow_create_operation=True,
                        allow_read_operation=False,
                        queue_props=sqs.QueueProps(queue_name="MyQueue", visibility_timeout=Duration.seconds(30)),
                        api_gateway_props=apigw.RestApiProps(rest_api_name="PromoDocRESTApi",
                                                             default_method_options=apigw.MethodOptions(
                                                                 authorization_type=apigw.AuthorizationType.NONE,
                                                                 method_responses=[apigw.MethodResponse(
                                                                     status_code="200",
                                                                     response_parameters={
                                                                         "method.response.header.content-type": True,
                                                                         "method.response.header.access-control-allow-origin": True,
                                                                         "method.response.header.access-control-allow-credentials": True
                                                                     }
                                                                 )]

                                                             ),
                                                             deploy=True,
                                                             deploy_options=apigw.StageOptions(stage_name="prod",
                                                                                               tracing_enabled=True,
                                                                                               metrics_enabled=True,
                                                                                               data_trace_enabled=True),
                                                             endpoint_configuration=apigw.EndpointConfiguration(
                                                                 types=[apigw.EndpointType.REGIONAL]
                                                             ),
                                                             default_cors_preflight_options=
                                                             apigw.CorsOptions(
                                                                 allow_origins=apigw.Cors.ALL_ORIGINS,
                                                                 allow_methods=apigw.Cors.ALL_METHODS
                                                             )
                                                             )
                        )

Error Log

Environment

  • CDK CLI Version : 2.20.0 (build 738ef49)
  • AWS Solutions Constructs Version : 2.5.0
    • aws-solutions-constructs.aws_apigateway_sqs==2.5.0
  • OS : MAC OSX
  • Language : Python

This is 🐛 Bug Report

Metadata

Metadata

Labels

bugSomething isn't workingneeds-triageThe issue or PR still needs to be triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions