ResourceOptions¶
-
class
aws_cdk.aws_apigateway.
ResourceOptions
(*, default_cors_preflight_options=None, default_integration=None, default_method_options=None)¶ Bases:
object
- 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 usingaddCorsPreflight
. Default: - CORS is disableddefault_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.
- ExampleMetadata
infused
Example:
# resource: apigateway.Resource subtree = resource.add_resource("subtree", default_cors_preflight_options=apigateway.CorsOptions( allow_origins=["https://amazon.com"] ) )
Attributes
-
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
]