Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

RequestValidator

Manages an API Gateway Request Validator.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.ApiGateway.RequestValidator("example", new Aws.ApiGateway.RequestValidatorArgs
        {
            RestApi = aws_api_gateway_rest_api.Example.Id,
            ValidateRequestBody = true,
            ValidateRequestParameters = true,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/apigateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigateway.NewRequestValidator(ctx, "example", &apigateway.RequestValidatorArgs{
			RestApi:                   pulumi.Any(aws_api_gateway_rest_api.Example.Id),
			ValidateRequestBody:       pulumi.Bool(true),
			ValidateRequestParameters: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.apigateway.RequestValidator("example",
    rest_api=aws_api_gateway_rest_api["example"]["id"],
    validate_request_body=True,
    validate_request_parameters=True)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.apigateway.RequestValidator("example", {
    restApi: aws_api_gateway_rest_api.example.id,
    validateRequestBody: true,
    validateRequestParameters: true,
});

Create a RequestValidator Resource

new RequestValidator(name: string, args: RequestValidatorArgs, opts?: CustomResourceOptions);
@overload
def RequestValidator(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     name: Optional[str] = None,
                     rest_api: Optional[str] = None,
                     validate_request_body: Optional[bool] = None,
                     validate_request_parameters: Optional[bool] = None)
@overload
def RequestValidator(resource_name: str,
                     args: RequestValidatorArgs,
                     opts: Optional[ResourceOptions] = None)
func NewRequestValidator(ctx *Context, name string, args RequestValidatorArgs, opts ...ResourceOption) (*RequestValidator, error)
public RequestValidator(string name, RequestValidatorArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RequestValidatorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args RequestValidatorArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RequestValidatorArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RequestValidatorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

RequestValidator Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The RequestValidator resource accepts the following input properties:

RestApi string | string
The ID of the associated Rest API
Name string
The name of the request validator
ValidateRequestBody bool
Boolean whether to validate request body. Defaults to false.
ValidateRequestParameters bool
Boolean whether to validate request parameters. Defaults to false.
RestApi string | string
The ID of the associated Rest API
Name string
The name of the request validator
ValidateRequestBody bool
Boolean whether to validate request body. Defaults to false.
ValidateRequestParameters bool
Boolean whether to validate request parameters. Defaults to false.
restApi string | RestApi
The ID of the associated Rest API
name string
The name of the request validator
validateRequestBody boolean
Boolean whether to validate request body. Defaults to false.
validateRequestParameters boolean
Boolean whether to validate request parameters. Defaults to false.
rest_api str | str
The ID of the associated Rest API
name str
The name of the request validator
validate_request_body bool
Boolean whether to validate request body. Defaults to false.
validate_request_parameters bool
Boolean whether to validate request parameters. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the RequestValidator resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing RequestValidator Resource

Get an existing RequestValidator resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RequestValidatorState, opts?: CustomResourceOptions): RequestValidator
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        rest_api: Optional[str] = None,
        validate_request_body: Optional[bool] = None,
        validate_request_parameters: Optional[bool] = None) -> RequestValidator
func GetRequestValidator(ctx *Context, name string, id IDInput, state *RequestValidatorState, opts ...ResourceOption) (*RequestValidator, error)
public static RequestValidator Get(string name, Input<string> id, RequestValidatorState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Name string
The name of the request validator
RestApi string | string
The ID of the associated Rest API
ValidateRequestBody bool
Boolean whether to validate request body. Defaults to false.
ValidateRequestParameters bool
Boolean whether to validate request parameters. Defaults to false.
Name string
The name of the request validator
RestApi string | string
The ID of the associated Rest API
ValidateRequestBody bool
Boolean whether to validate request body. Defaults to false.
ValidateRequestParameters bool
Boolean whether to validate request parameters. Defaults to false.
name string
The name of the request validator
restApi string | RestApi
The ID of the associated Rest API
validateRequestBody boolean
Boolean whether to validate request body. Defaults to false.
validateRequestParameters boolean
Boolean whether to validate request parameters. Defaults to false.
name str
The name of the request validator
rest_api str | str
The ID of the associated Rest API
validate_request_body bool
Boolean whether to validate request body. Defaults to false.
validate_request_parameters bool
Boolean whether to validate request parameters. Defaults to false.

Import

aws_api_gateway_request_validator can be imported using REST-API-ID/REQUEST-VALIDATOR-ID, e.g.

 $ pulumi import aws:apigateway/requestValidator:RequestValidator example 12345abcde/67890fghij

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.