Class ResourceBase
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class ResourceBase : Resource, IResource, IResource, IResourceRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public MustInherit Class ResourceBase Inherits Resource Implements IResource, IResource, IResourceRef, IConstruct, IDependable, IEnvironmentAware
Synopsis
Constructors
| ResourceBase(Construct, string) |
Properties
| Api | The rest API that this resource is part of. |
| DefaultCorsPreflightOptions | Default options for CORS preflight OPTIONS method. |
| DefaultIntegration | An integration to use as a default for all methods created within this API unless an integration is specified. |
| DefaultMethodOptions | Method options to use as a default for all methods created within this API unless custom options are specified. |
| ParentResource | The parent of this resource or undefined for the root resource. |
| Path | The full path of this resource. |
| ResourceId | The ID of the resource. |
| ResourceRef | A reference to a Resource resource. |
Methods
| AddCorsPreflight(ICorsOptions) | Adds an OPTIONS method to this resource which responds to Cross-Origin Resource Sharing (CORS) preflight requests. |
| AddMethod(string, Integration?, IMethodOptions?) | Defines a new method for this resource. |
| AddProxy(IProxyResourceOptions?) | Adds a greedy proxy resource ("{proxy+}") and an ANY method to this route. |
| AddResource(string, IResourceOptions?) | Defines a new child resource where this resource is the parent. |
| GetResource(string) | Retrieves a child resource by path part. |
| ResourceForPath(string) | Gets or create all resources leading up to the specified path. |
Constructors
ResourceBase(Construct, 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
ResourceId
ResourceRef
A reference to a Resource resource.
public virtual IResourceReference ResourceRef { get; }
Property Value
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 string
- integration Integration
- options 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 string
- options 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