Interface IResource.Jsii$Default
- All Superinterfaces:
IConstruct
,software.constructs.IConstruct
,IConstruct.Jsii$Default
,software.constructs.IConstruct.Jsii$Default
,IDependable
,IDependable.Jsii$Default
,IResource
,IResource
,IResource.Jsii$Default
,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
IResource.Jsii$Proxy
- Enclosing interface:
IResource
IResource
.-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default, IConstruct.Jsii$Proxy
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IDependable
IDependable.Jsii$Default, IDependable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default, IResource.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.apigateway.IResource
IResource.Jsii$Default, IResource.Jsii$Proxy
-
Method Summary
Modifier and TypeMethodDescriptiondefault Method
addCorsPreflight
(CorsOptions options) Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.default Method
addMethod
(String httpMethod, Integration target, MethodOptions options) Defines a new method for this resource.default ProxyResource
addProxy
(ProxyResourceOptions options) Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.default Resource
addResource
(String pathPart, ResourceOptions options) Defines a new child resource where this resource is the parent.default void
applyRemovalPolicy
(RemovalPolicy policy) Apply the given removal policy to this resource.default IRestApi
getApi()
The rest API that this resource is part of.default CorsOptions
Default options for CORS preflight OPTIONS method.default Integration
An integration to use as a default for all methods created within this API unless an integration is specified.default MethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified.default ResourceEnvironment
getEnv()
The environment this resource belongs to.default ConstructNode
getNode()
The construct tree node for this construct.default IResource
The parent of this resource or undefined for the root resource.default String
getPath()
The full path of this resource.default IResource
getResource
(String pathPart) Retrieves a child resource by path part.default String
The ID of the resource.default RestApi
Deprecated.default Stack
getStack()
The stack in which this resource is defined.default Resource
resourceForPath
(String path) Gets or create all resources leading up to the specified path.Methods inherited from interface software.amazon.awscdk.services.apigateway.IResource
addMethod, addMethod, addProxy, addResource
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getNode
The construct tree node for this construct.- Specified by:
getNode
in interfaceIConstruct
- Specified by:
getNode
in interfaceIConstruct.Jsii$Default
- Specified by:
getNode
in interfaceIResource.Jsii$Default
-
getEnv
The environment this resource belongs to.For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
- Specified by:
getEnv
in interfaceIResource
- Specified by:
getEnv
in interfaceIResource.Jsii$Default
-
getStack
The stack in which this resource is defined.- Specified by:
getStack
in interfaceIResource
- Specified by:
getStack
in interfaceIResource.Jsii$Default
-
getApi
The rest API that this resource is part of.The reason we need the RestApi object itself and not just the ID is because the model is being tracked by the top-level RestApi object for the purpose of calculating it's hash to determine the ID of the deployment. This allows us to automatically update the deployment when the model of the REST API changes.
-
getPath
The full path of this resource. -
getResourceId
The ID of the resource.- Specified by:
getResourceId
in interfaceIResource
-
getRestApi
Deprecated.- Throws an error if this Resource is not associated with an instance of
RestApi
. Useapi
instead.
(deprecated) The rest API that this resource is part of.- Specified by:
getRestApi
in interfaceIResource
- Throws an error if this Resource is not associated with an instance of
-
getDefaultCorsPreflightOptions
Default options for CORS preflight OPTIONS method.- Specified by:
getDefaultCorsPreflightOptions
in interfaceIResource
-
getDefaultIntegration
An integration to use as a default for all methods created within this API unless an integration is specified.- Specified by:
getDefaultIntegration
in interfaceIResource
-
getDefaultMethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified.- Specified by:
getDefaultMethodOptions
in interfaceIResource
-
getParentResource
The parent of this resource or undefined for the root resource.- Specified by:
getParentResource
in interfaceIResource
-
applyRemovalPolicy
Apply the given removal policy to this resource.The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Specified by:
applyRemovalPolicy
in interfaceIResource
- Specified by:
applyRemovalPolicy
in interfaceIResource.Jsii$Default
- Parameters:
policy
- This parameter is required.
-
addCorsPreflight
Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a web application running at one origin, access to selected resources from a different origin. A web application executes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, or port) from its own.
- Specified by:
addCorsPreflight
in interfaceIResource
- Parameters:
options
- CORS options. This parameter is required.- Returns:
- a
Method
object - See Also:
-
addMethod
@Stability(Stable) @NotNull default Method addMethod(@NotNull String httpMethod, @Nullable Integration target, @Nullable MethodOptions options) Defines a new method for this resource. -
addProxy
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route. -
addResource
@Stability(Stable) @NotNull default Resource addResource(@NotNull String pathPart, @Nullable ResourceOptions options) Defines a new child resource where this resource is the parent.- Specified by:
addResource
in interfaceIResource
- Parameters:
pathPart
- The path part for the child resource. This parameter is required.options
- Resource options.- Returns:
- A Resource object
-
getResource
Retrieves a child resource by path part.- Specified by:
getResource
in interfaceIResource
- Parameters:
pathPart
- The path part of the child resource. This parameter is required.- Returns:
- the child resource or undefined if not found
-
resourceForPath
Gets or create all resources leading up to the specified path.- Path may only start with "/" if this method is called on the root resource.
- All resources are created using default options.
- Specified by:
resourceForPath
in interfaceIResource
- Parameters:
path
- The relative path. This parameter is required.- Returns:
- a new or existing resource.
-
RestApi
.