ProxyResourceProps

class aws_cdk.aws_apigateway.ProxyResourceProps(*, default_cors_preflight_options=None, default_integration=None, default_method_options=None, any_method=None, parent)

Bases: aws_cdk.aws_apigateway.ProxyResourceOptions

Parameters
  • default_cors_preflight_options (Optional[CorsOptions]) – Adds a CORS preflight OPTIONS method to this resource and all child resources. You can add CORS at the resource-level using addCorsPreflight. Default: - CORS is disabled

  • default_integration (Optional[Integration]) – An integration to use as a default for all methods created within this API unless an integration is specified. Default: - Inherited from parent.

  • default_method_options (Optional[MethodOptions]) – Method options to use as a default for all methods created within this API unless custom options are specified. Default: - Inherited from parent.

  • any_method (Optional[bool]) – Adds an “ANY” method to this resource. If set to false, you will have to explicitly add methods to this resource after it’s created. Default: true

  • parent (IResource) – The parent resource of this resource. You can either pass another Resource object or a RestApi object here.

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_apigateway as apigateway
import aws_cdk.core as cdk

# authorizer: apigateway.Authorizer
# integration: apigateway.Integration
# model: apigateway.Model
# request_validator: apigateway.RequestValidator
# resource: apigateway.Resource

proxy_resource_props = apigateway.ProxyResourceProps(
    parent=resource,

    # the properties below are optional
    any_method=False,
    default_cors_preflight_options=apigateway.CorsOptions(
        allow_origins=["allowOrigins"],

        # the properties below are optional
        allow_credentials=False,
        allow_headers=["allowHeaders"],
        allow_methods=["allowMethods"],
        disable_cache=False,
        expose_headers=["exposeHeaders"],
        max_age=cdk.Duration.minutes(30),
        status_code=123
    ),
    default_integration=integration,
    default_method_options=apigateway.MethodOptions(
        api_key_required=False,
        authorization_scopes=["authorizationScopes"],
        authorization_type=apigateway.AuthorizationType.NONE,
        authorizer=authorizer,
        method_responses=[apigateway.MethodResponse(
            status_code="statusCode",

            # the properties below are optional
            response_models={
                "response_models_key": model
            },
            response_parameters={
                "response_parameters_key": False
            }
        )],
        operation_name="operationName",
        request_models={
            "request_models_key": model
        },
        request_parameters={
            "request_parameters_key": False
        },
        request_validator=request_validator,
        request_validator_options=apigateway.RequestValidatorOptions(
            request_validator_name="requestValidatorName",
            validate_request_body=False,
            validate_request_parameters=False
        )
    )
)

Attributes

any_method

Adds an “ANY” method to this resource.

If set to false, you will have to explicitly add methods to this resource after it’s created.

Default

true

Return type

Optional[bool]

default_cors_preflight_options

Adds a CORS preflight OPTIONS method to this resource and all child resources.

You can add CORS at the resource-level using addCorsPreflight.

Default
  • CORS is disabled

Return type

Optional[CorsOptions]

default_integration

An integration to use as a default for all methods created within this API unless an integration is specified.

Default
  • Inherited from parent.

Return type

Optional[Integration]

default_method_options

Method options to use as a default for all methods created within this API unless custom options are specified.

Default
  • Inherited from parent.

Return type

Optional[MethodOptions]

parent

The parent resource of this resource.

You can either pass another Resource object or a RestApi object here.

Return type

IResource