Skip to main content

gateway_responses

Creates, updates, deletes or gets a gateway_response resource or lists gateway_responses in a region

Overview

Namegateway_responses
TypeResource
DescriptionThe AWS::ApiGateway::GatewayResponse resource creates a gateway response for your API. For more information, see API Gateway Responses in the API Gateway Developer Guide.
Idawscc.apigateway.gateway_responses

Fields

NameDatatypeDescription
idstring
rest_api_idstring
response_typestring
status_codestring
response_parametersobject
response_templatesobject
regionstringAWS region.

For more information, see AWS::ApiGateway::GatewayResponse.

Methods

NameResourceAccessible byRequired Params
create_resourcegateway_responsesINSERTResponseType, RestApiId, region
delete_resourcegateway_responsesDELETEIdentifier, region
update_resourcegateway_responsesUPDATEIdentifier, PatchDocument, region
list_resourcesgateway_responses_list_onlySELECTregion
get_resourcegateway_responsesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual gateway_response.

SELECT
region,
id,
rest_api_id,
response_type,
status_code,
response_parameters,
response_templates
FROM awscc.apigateway.gateway_responses
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

INSERT example

Use the following StackQL query and manifest file to create a new gateway_response resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.apigateway.gateway_responses (
RestApiId,
ResponseType,
region
)
SELECT
'{{ rest_api_id }}',
'{{ response_type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a gateway_response resource, using stack-deploy.

/*+ update */
UPDATE awscc.apigateway.gateway_responses
SET PatchDocument = string('{{ {
"StatusCode": status_code,
"ResponseParameters": response_parameters,
"ResponseTemplates": response_templates
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.apigateway.gateway_responses
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the gateway_responses resource, the following permissions are required:

apigateway:PUT,
apigateway:GET