Show / Hide Table of Contents

Class Resource

A construct which represents an AWS resource.

Inheritance
System.Object
Construct
Resource
App
Branch
Domain
ApiKey
Authorizer
BasePathMapping
Deployment
DomainName_
GatewayResponse
Method
Model
RateLimitedApiKey
RequestValidator
ResourceBase
RestApiBase
Stage
UsagePlan
VpcLink
ApiMapping
DomainName
HttpApi
HttpAuthorizer
HttpIntegration
HttpRoute
HttpStage
VpcLink
WebSocketApi
WebSocketIntegration
WebSocketRoute
WebSocketStage
ScalableTarget
GatewayRoute
Mesh
Route
VirtualGateway
VirtualNode
VirtualRouter
VirtualService
AppsyncFunction
GraphqlApiBase
AutoScalingGroup
LifecycleHook
ScheduledAction
BackupPlan
BackupSelection
BackupVault
ComputeEnvironment
JobDefinition
JobQueue
Certificate
DnsValidatedCertificate
SlackChannelConfiguration
Ec2Environment
CachePolicy
CloudFrontWebDistribution
Distribution
EdgeFunction
KeyGroup
OriginAccessIdentity
OriginRequestPolicy
PublicKey
Trail
AlarmBase
Dashboard
BitBucketSourceCredentials
GitHubEnterpriseSourceCredentials
GitHubSourceCredentials
Project
ReportGroup
Repository
CustomLambdaDeploymentConfig
EcsApplication
LambdaApplication
LambdaDeploymentGroup
ServerApplication
ServerDeploymentConfig
ServerDeploymentGroup
ProfilingGroup
Pipeline
GitHubRepository
UserPool
UserPoolClient
UserPoolDomain
UserPoolIdentityProviderAmazon
UserPoolIdentityProviderApple
UserPoolIdentityProviderFacebook
UserPoolIdentityProviderGoogle
UserPoolResourceServer
CustomRule
ManagedRule
ClusterParameterGroup
DatabaseCluster
DatabaseInstance
Table
BastionHostLinux
ClientVpnAuthorizationRule
ClientVpnEndpoint
ClientVpnRoute
FlowLog
Instance_
LaunchTemplate
NetworkAcl
NetworkAclEntry
SecurityGroup
Subnet
SubnetNetworkAclAssociation
Volume
Vpc
VpcEndpoint
VpcEndpointService
VpnConnection
VpnGateway
RepositoryBase
BaseService
Cluster
TaskDefinition
AccessPoint
FileSystem
Cluster
Cluster
Nodegroup
LoadBalancer
BaseListener
BaseLoadBalancer
Domain
Archive
EventBus
Rule
FileSystemBase
Accelerator
EndpointGroup
Listener
Connection
Database
SecurityConfiguration
Table
Group
LazyRole
ManagedPolicy
OpenIdConnectProvider
Policy
Role
SamlProvider
User
Channel
PlaybackKeyPair
StreamKey
Stream
Application
Alias
Key
CodeSigningConfig
EventInvokeConfig
EventSourceMapping
FunctionBase
LayerVersion
CrossAccountDestination
LogGroup
LogStream
MetricFilter
SubscriptionFilter
ClusterParameterGroup
DatabaseClusterBase
DatabaseInstance
ParameterGroup
SubnetGroup
DatabaseClusterBase
DatabaseInstanceBase
DatabaseProxy
OptionGroup
ParameterGroup
ServerlessCluster
SubnetGroup
Cluster
ClusterParameterGroup
ClusterSubnetGroup
HostedZone
RecordSet
Bucket
BucketPolicy
ResourcePolicy
RotationSchedule
Secret
SecretTargetAttachment
HttpNamespace
InstanceBase
PrivateDnsNamespace
PublicDnsNamespace
Service
ReceiptFilter
ReceiptRule
ReceiptRuleSet
SigningProfile
Subscription
TopicBase
TopicPolicy
QueueBase
QueuePolicy
StringListParameter
StringParameter
Activity
StateMachine
Canary
CustomResource
Implements
IResource
IConstruct
Constructs.IConstruct
IDependable
Inherited Members
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Validate()
Construct.Node
Namespace: Amazon.CDK
Assembly: Amazon.CDK.dll
Syntax (csharp)
public abstract class Resource : Construct, IResource, IConstruct, IConstruct, IDependable
Syntax (vb)
Public MustInherit Class Resource
    Inherits Construct
    Implements IResource, IConstruct, IConstruct, IDependable

Synopsis

Constructors

Resource(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

Resource(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Resource(Construct, String, IResourceProps)

Properties

Env

The environment this resource belongs to.

PhysicalName

(experimental) Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

Stack

The stack in which this resource is defined.

Methods

ApplyRemovalPolicy(RemovalPolicy)

Apply the given removal policy to this resource.

GeneratePhysicalName()
GetResourceArnAttribute(String, IArnComponents)

(experimental) Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

GetResourceNameAttribute(String)

(experimental) Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

IsResource(IConstruct)

Check whether the given construct is a Resource.

Constructors

Resource(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected Resource(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

Resource(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected Resource(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Resource(Construct, String, IResourceProps)

protected Resource(Construct scope, string id, IResourceProps props = null)
Parameters
scope Constructs.Construct
id System.String
props IResourceProps

Properties

Env

The environment this resource belongs to.

public virtual IResourceEnvironment Env { get; }
Property Value

IResourceEnvironment

Remarks

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.

PhysicalName

(experimental) Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

protected virtual string PhysicalName { get; }
Property Value

System.String

Remarks

This value will resolve to one of the following:

    Stability: Experimental

    Stack

    The stack in which this resource is defined.

    public virtual Stack Stack { get; }
    Property Value

    Stack

    Methods

    ApplyRemovalPolicy(RemovalPolicy)

    Apply the given removal policy to this resource.

    public virtual void ApplyRemovalPolicy(RemovalPolicy policy)
    Parameters
    policy RemovalPolicy
    Remarks

    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.DELETE), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

    GeneratePhysicalName()

    protected virtual string GeneratePhysicalName()
    Returns

    System.String

    GetResourceArnAttribute(String, IArnComponents)

    (experimental) Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

    protected virtual string GetResourceArnAttribute(string arnAttr, IArnComponents arnComponents)
    Parameters
    arnAttr System.String

    The CFN attribute which resolves to the ARN of the resource.

    arnComponents IArnComponents

    The format of the ARN of this resource.

    Returns

    System.String

    Remarks

    Normally, this token will resolve to arnAttr, but if the resource is referenced across environments, arnComponents will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arnComponents.

    Stability: Experimental

    GetResourceNameAttribute(String)

    (experimental) Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

    protected virtual string GetResourceNameAttribute(string nameAttr)
    Parameters
    nameAttr System.String

    The CFN attribute which resolves to the resource's name.

    Returns

    System.String

    Remarks

    Normally, this token will resolve to nameAttr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

    Stability: Experimental

    IsResource(IConstruct)

    Check whether the given construct is a Resource.

    public static bool IsResource(IConstruct construct)
    Parameters
    construct IConstruct
    Returns

    System.Boolean

    Implements

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