Show / Hide Table of Contents

Class ResourceBase

Inheritance
object
Resource
ResourceBase
Resource
Implements
IResource
IResource
IResourceRef
IConstruct
IDependable
IEnvironmentAware
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
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)

protected ResourceBase(Construct scope, string id)
Parameters
scope Construct
id string

Properties

Api

The rest API that this resource is part of.

public abstract IRestApi Api { get; }
Property Value

IRestApi

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

ICorsOptions

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

Integration

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

IMethodOptions

ParentResource

The parent of this resource or undefined for the root resource.

public abstract IResource? ParentResource { get; }
Property Value

IResource

Path

The full path of this resource.

public abstract string Path { get; }
Property Value

string

ResourceId

The ID of the resource.

public abstract string ResourceId { get; }
Property Value

string

ResourceRef

A reference to a Resource resource.

public virtual IResourceReference ResourceRef { get; }
Property Value

IResourceReference

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

Method

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

Method

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

ProxyResource

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

Resource

GetResource(string)

Retrieves a child resource by path part.

public virtual IResource? GetResource(string pathPart)
Parameters
pathPart string
Returns

IResource

ResourceForPath(string)

Gets or create all resources leading up to the specified path.

public virtual Resource ResourceForPath(string path)
Parameters
path string
Returns

Resource

Remarks

    Implements

    IResource
    IResource
    IResourceRef
    Constructs.IConstruct
    Constructs.IDependable
    IEnvironmentAware
    Back to top Generated by DocFX