Class ResourceBase
- Namespace
- Amazon.CDK.AWS.APIGateway
- Assembly
- Amazon.CDK.AWS.APIGateway.dll
public abstract class ResourceBase : Resource, IResource, IResource, IConstruct, IConstruct, IDependable
- Inheritance
-
ResourceBase
- Implements
-
IResourceIConstructIConstructIDependable
- Derived
Constructors
ResourceBase(Construct, string)
protected ResourceBase(Construct scope, string id)
Parameters
scope
Constructid
string
Properties
Api
The rest API that this resource is part of.
public abstract IRestApi Api { get; }
Property Value
Remarks
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.
DefaultCorsPreflightOptions
Default options for CORS preflight OPTIONS method.
public abstract ICorsOptions? DefaultCorsPreflightOptions { get; }
Property Value
DefaultIntegration
An integration to use as a default for all methods created within this API unless an integration is specified.
public abstract Integration? DefaultIntegration { get; }
Property Value
DefaultMethodOptions
Method options to use as a default for all methods created within this API unless custom options are specified.
public abstract IMethodOptions? DefaultMethodOptions { get; }
Property Value
ParentResource
The parent of this resource or undefined for the root resource.
public abstract IResource? ParentResource { get; }
Property Value
Path
The full path of this resource.
public abstract string Path { get; }
Property Value
ResourceId
The ID of the resource.
public abstract string ResourceId { get; }
Property Value
RestApi
(deprecated) The rest API that this resource is part of.
[Obsolete("- Throws an error if this Resource is not associated with an instance of `RestApi`. Use `api` instead.")]
public abstract RestApi RestApi { get; }
Property Value
Remarks
Stability: Deprecated
Url
[Obsolete("- Throws error in some use cases that have been enabled since this deprecation notice. Use `RestApi.urlForPath()` instead.")]
public virtual string Url { get; }
Property Value
Remarks
Stability: Deprecated
Methods
AddCorsPreflight(ICorsOptions)
Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests.
public virtual Method AddCorsPreflight(ICorsOptions options)
Parameters
options
ICorsOptions
Returns
Remarks
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.
AddMethod(string, Integration?, IMethodOptions?)
Defines a new method for this resource.
public virtual Method AddMethod(string httpMethod, Integration? integration = null, IMethodOptions? options = null)
Parameters
httpMethod
stringintegration
Integrationoptions
IMethodOptions
Returns
AddProxy(IProxyResourceOptions?)
Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route.
public virtual ProxyResource AddProxy(IProxyResourceOptions? options = null)
Parameters
options
IProxyResourceOptions
Returns
AddResource(string, IResourceOptions?)
Defines a new child resource where this resource is the parent.
public virtual Resource AddResource(string pathPart, IResourceOptions? options = null)
Parameters
pathPart
stringoptions
IResourceOptions
Returns
GetResource(string)
Retrieves a child resource by path part.
public virtual IResource? GetResource(string pathPart)
Parameters
pathPart
string
Returns
ResourceForPath(string)
Gets or create all resources leading up to the specified path.
public virtual Resource ResourceForPath(string path)
Parameters
path
string