public static final class IResource.Jsii$Proxy extends software.amazon.jsii.JsiiObject implements IResource.Jsii$Default
IResource.Jsii$Default, IResource.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
Jsii$Proxy(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
Method |
addCorsPreflight(CorsOptions options)
Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.
|
Method |
addMethod(java.lang.String httpMethod)
Defines a new method for this resource.
|
Method |
addMethod(java.lang.String httpMethod,
Integration target)
Defines a new method for this resource.
|
Method |
addMethod(java.lang.String httpMethod,
Integration target,
MethodOptions options)
Defines a new method for this resource.
|
ProxyResource |
addProxy()
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.
|
ProxyResource |
addProxy(ProxyResourceOptions options)
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.
|
Resource |
addResource(java.lang.String pathPart)
Defines a new child resource where this resource is the parent.
|
Resource |
addResource(java.lang.String pathPart,
ResourceOptions options)
Defines a new child resource where this resource is the parent.
|
void |
applyRemovalPolicy(RemovalPolicy policy)
Apply the given removal policy to this resource.
|
IRestApi |
getApi()
The rest API that this resource is part of.
|
CorsOptions |
getDefaultCorsPreflightOptions()
Default options for CORS preflight OPTIONS method.
|
Integration |
getDefaultIntegration()
An integration to use as a default for all methods created within this API unless an integration is specified.
|
MethodOptions |
getDefaultMethodOptions()
Method options to use as a default for all methods created within this API unless custom options are specified.
|
ResourceEnvironment |
getEnv()
The environment this resource belongs to.
|
ConstructNode |
getNode()
The construct tree node for this construct.
|
IResource |
getParentResource()
The parent of this resource or undefined for the root resource.
|
java.lang.String |
getPath()
The full path of this resource.
|
IResource |
getResource(java.lang.String pathPart)
Retrieves a child resource by path part.
|
java.lang.String |
getResourceId()
The ID of the resource.
|
RestApi |
getRestApi()
Deprecated.
- Throws an error if this Resource is not associated with an instance of `RestApi`. Use `api` instead.
|
Stack |
getStack()
The stack in which this resource is defined.
|
Resource |
resourceForPath(java.lang.String path)
Gets or create all resources leading up to the specified path.
|
public final ConstructNode getNode()
getNode
in interface IConstruct
getNode
in interface IConstruct.Jsii$Default
getNode
in interface IResource.Jsii$Default
public final ResourceEnvironment getEnv()
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.
getEnv
in interface IResource
getEnv
in interface IResource.Jsii$Default
public final Stack getStack()
getStack
in interface IResource
getStack
in interface IResource.Jsii$Default
public final IRestApi getApi()
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.
public final java.lang.String getPath()
public final java.lang.String getResourceId()
@Deprecated public final RestApi getRestApi()
public final CorsOptions getDefaultCorsPreflightOptions()
public final Integration getDefaultIntegration()
public final MethodOptions getDefaultMethodOptions()
public final IResource getParentResource()
public final void applyRemovalPolicy(RemovalPolicy policy)
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
).
applyRemovalPolicy
in interface IResource
applyRemovalPolicy
in interface IResource.Jsii$Default
policy
- This parameter is required.public final Method addCorsPreflight(CorsOptions options)
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.
options
- CORS options. This parameter is required.public final Method addMethod(java.lang.String httpMethod, Integration target, MethodOptions options)
httpMethod
- The HTTP method. This parameter is required.target
- The target backend integration for this method.options
- Method options, such as authentication.public final Method addMethod(java.lang.String httpMethod, Integration target)
httpMethod
- The HTTP method. This parameter is required.target
- The target backend integration for this method.public final Method addMethod(java.lang.String httpMethod)
httpMethod
- The HTTP method. This parameter is required.public final ProxyResource addProxy(ProxyResourceOptions options)
options
- Default integration and method options.public final ProxyResource addProxy()
public final Resource addResource(java.lang.String pathPart, ResourceOptions options)
pathPart
- The path part for the child resource. This parameter is required.options
- Resource options.public final Resource addResource(java.lang.String pathPart)
pathPart
- The path part for the child resource. This parameter is required.public final IResource getResource(java.lang.String pathPart)
pathPart
- The path part of the child resource. This parameter is required.public final Resource resourceForPath(java.lang.String path)
path
- The relative path. This parameter is required.