Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
seandall opened this issue Apr 14, 2022 · 2 comments · May be fixed by #1079
Open
Assignees
Labels
bug Something isn't working needs-triage The issue or PR still needs to be triaged

Comments

@seandall
Copy link

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

@seandall seandall added bug Something isn't working needs-triage The issue or PR still needs to be triaged labels Apr 14, 2022
@biffgaut
Copy link
Contributor

Thanks for the heads up - we'll take a look

@biffgaut biffgaut self-assigned this Apr 15, 2022
@biffgaut
Copy link
Contributor

This construct was written this way as one of the original constructs released in 2020. It does look odd to us now. We're looking back to see if there was a reason it was written this way back then and also how we could address it without introducing a breaking change for existing users. No ETA at the moment, but it is currently getting attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage The issue or PR still needs to be triaged
Projects
None yet
3 participants