0
votes

I have created API Gateway using CDK and wanting to create a input for Stage Variables while sending request from API Gateway, I referenced the docs related to stage variables but could not find something that would help me in achieving this.

I am able to create predefined stage variables which are coming under stage variables tab but not being able to set them while creating request because they should be created runtime as per our need.

            api = new RestApi(this, props.apiName, {
                deployOptions: {
                    stageName: 'alpha',
                    variables: {
                      'name': 'value'
                    }
            });

Refernced Docs :-

enter image description here

1

1 Answers

1
votes

This is not possible. Stage variables are for configuring a stage, and can only be set during the creation (or modification) of a stage, not on a per-request basis.

Refer to the documentation for details.

Depending on your use-case, you might find that regular request parameters suit your needs.