(aws-apigateway): Allow for custom authorizer context in StepFunctionsIntegration #18891
Closed
1 of 2 tasks
Labels
@aws-cdk/aws-apigateway
Related to Amazon API Gateway
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
Description
Currently there's no option to output custom authorizer context values into the express step function integration. The only available option is to include the single
authorizerPrincipalId
field in requestContext. A possible change would be to addauthorizer: boolean
intoStepFunctionsRestApiProps
which would output the full$context.authorizer
object in aauthorizer: {}
object in the input to the state machine.Use Case
A common use case for custom authorizers is to set custom context values and use them downstream in the integration. This change would allow them to be used in a step functions integration.
Proposed Solution
Add
authorizer: boolean
toStepFunctionsExecutionIntegrationOptions
Add
const includeAuthorizer = options.authorizer ?? false;
andtemplateStr = templateStr.replace("%INCLUDE_AUTHORIZER%", String(includeAuthorizer));
totemplateString()
instepfunctions.ts
Add
and
to
stepfunctions.vtl
template.Other information
No response
Acknowledge
The text was updated successfully, but these errors were encountered: