awslabs / awslabs/aws-solutions-constructs

Pass parameters to templates in aws-api-gateway-*

Open
#891 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.4k
Forks
268
Avg merge
5h 18m
Merged PRs (30d)
5

Description

Based on [aws-api_gateway-dynamodb](https://github.com/awslabs/aws-solutions-constructs/tree/main/source/patterns/%40aws-solutions-constructs/aws-apigateway-dynamodb)

The constructor has read_request_template etc.

The only way I can make it work in the python SDK is hard code the table name.

I can see the default template [index.ts](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-apigateway-dynamodb/lib/index.ts) line 268.

const readRequestTemplate = props.readRequestTemplate ??
`{ \
"TableName": "${this.dynamoTable.tableName}", \
"KeyConditionExpression": "${partitionKeyName} = :v1", \
"ExpressionAttributeValues": { \
":v1": { \
"S": "$input.params('${partitionKeyName}')" \
} \
} \
}`;

I cannot figure out how to pass parameters into the template.

the create request template looks like it explicitly replaces {$Table}

Contributor guide

Open the contributing guide

Research direction

Start with source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/lib/index.ts around line 268 and inspect the readRequestTemplate constructor property. Compare its handling with the create request template and determine how caller-supplied templates should receive parameters such as the table name. Done means the Python SDK can provide a template without hard-coding the table name.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
api, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.