awslabs / awslabs/aws-solutions-constructs
Pattern: aws-apigateway-sqs registers methods on root and a /message resource inconsistently
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 268
- Avg merge
- 5h 18m
- Merged PRs (30d)
- 5
Description
**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: Bug Report
Contributor guide
Assessment
This issue has not been assessed yet.