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](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html) in the *API Gateway Developer Guide*. |
Id | aws.apigateway.request_validators |
Fields
Name | Datatype | Description |
---|---|---|
request_validator_id | string | |
name | string | The name of this RequestValidator |
rest_api_id | string | The string identifier of the associated RestApi. |
validate_request_body | boolean | A Boolean flag to indicate whether to validate a request body according to the configured Model schema. |
validate_request_parameters | boolean | A Boolean flag to indicate whether to validate request parameters (true ) or not (false ). |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | RestApiId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all request_validators
in a region.
SELECT
region,
request_validator_id,
name,
rest_api_id,
validate_request_body,
validate_request_parameters
FROM aws.apigateway.request_validators
WHERE region = 'us-east-1';
Gets all properties from an individual request_validator
.
SELECT
region,
request_validator_id,
name,
rest_api_id,
validate_request_body,
validate_request_parameters
FROM aws.apigateway.request_validators
WHERE region = 'us-east-1' AND data__Identifier = '<RestApiId>|<RequestValidatorId>';
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 aws.apigateway.request_validators (
RestApiId,
region
)
SELECT
'{{ RestApiId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.apigateway.request_validators (
Name,
RestApiId,
ValidateRequestBody,
ValidateRequestParameters,
region
)
SELECT
'{{ Name }}',
'{{ RestApiId }}',
'{{ ValidateRequestBody }}',
'{{ ValidateRequestParameters }}',
'{{ region }}';
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: RestApiId
value: '{{ RestApiId }}'
- name: ValidateRequestBody
value: '{{ ValidateRequestBody }}'
- name: ValidateRequestParameters
value: '{{ ValidateRequestParameters }}'
DELETE
example
/*+ delete */
DELETE FROM aws.apigateway.request_validators
WHERE data__Identifier = '<RestApiId|RequestValidatorId>'
AND region = 'us-east-1';
Permissions
To operate on the request_validators
resource, the following permissions are required:
Create
apigateway:POST,
apigateway:GET
Update
apigateway:PATCH,
apigateway:GET
Delete
apigateway:DELETE
Read
apigateway:GET
List
apigateway:GET