request_validators
Creates, updates, deletes or gets a request_validator resource or lists request_validators in a region
Overview
| Name | request_validators |
| Type | Resource |
| Description | The AWS::ApiGateway::RequestValidator resource sets up basic validation rules for incoming requests to your API. For more information, see Enable Basic Request Validation for an API in API Gateway in the API Gateway Developer Guide. |
| Id | awscc.apigateway.request_validators |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
request_validator_id | string | |
name | string | |
rest_api_id | string | |
validate_request_body | boolean | |
validate_request_parameters | boolean | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
request_validator_id | string | |
rest_api_id | string | |
region | string | AWS region. |
For more information, see AWS::ApiGateway::RequestValidator.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | request_validators | INSERT | RestApiId, region |
delete_resource | request_validators | DELETE | Identifier, region |
update_resource | request_validators | UPDATE | Identifier, PatchDocument, region |
list_resources | request_validators_list_only | SELECT | region |
get_resource | request_validators | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual request_validator.
SELECT
region,
request_validator_id,
name,
rest_api_id,
validate_request_body,
validate_request_parameters
FROM awscc.apigateway.request_validators
WHERE
region = '{{ region }}' AND
Identifier = '{{ rest_api_id }}|{{ request_validator_id }}';
Lists all request_validators in a region.
SELECT
region,
rest_api_id,
request_validator_id
FROM awscc.apigateway.request_validators_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new request_validator resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.apigateway.request_validators (
RestApiId,
region
)
SELECT
'{{ rest_api_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.apigateway.request_validators (
Name,
RestApiId,
ValidateRequestBody,
ValidateRequestParameters,
region
)
SELECT
'{{ name }}',
'{{ rest_api_id }}',
'{{ validate_request_body }}',
'{{ validate_request_parameters }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: request_validator
props:
- name: name
value: '{{ name }}'
- name: rest_api_id
value: '{{ rest_api_id }}'
- name: validate_request_body
value: '{{ validate_request_body }}'
- name: validate_request_parameters
value: '{{ validate_request_parameters }}'
UPDATE example
Use the following StackQL query and manifest file to update a request_validator resource, using stack-deploy.
/*+ update */
UPDATE awscc.apigateway.request_validators
SET PatchDocument = string('{{ {
"ValidateRequestBody": validate_request_body,
"ValidateRequestParameters": validate_request_parameters
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ rest_api_id }}|{{ request_validator_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.apigateway.request_validators
WHERE
Identifier = '{{ rest_api_id }}|{{ request_validator_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:
| Parameter | Description |
|---|---|
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 request_validators resource, the following permissions are required:
- Create
- Update
- Delete
- Read
- List
apigateway:POST,
apigateway:GET
apigateway:PATCH,
apigateway:GET
apigateway:DELETE
apigateway:GET
apigateway:GET