interface IResource
Language | Type name |
---|---|
.NET | Amazon.CDK.IResource |
Go | github.com/aws/aws-cdk-go/awscdk/v2#IResource |
Java | software.amazon.awscdk.IResource |
Python | aws_cdk.IResource |
TypeScript (source) | aws-cdk-lib » IResource |
Implemented by
App
, Branch
, Domain
, Auto
, Observability
, Service
, Vpc
, Vpc
, Api
, Base
, Cognito
, Deployment
, Domain
, Gateway
, Lambda
, Method
, Model
, Proxy
, Rate
, Request
, Request
, Resource
, Rest
, Spec
, Stage
, Step
, Token
, Usage
, Vpc
, Api
, Domain
, Http
, Http
, Http
, Http
, Http
, Vpc
, Web
, Web
, Web
, Web
, Web
, Application
, Deployment
, Environment
, Extension
, Scalable
, Gateway
, Mesh
, Route
, Virtual
, Virtual
, Virtual
, Virtual
, Appsync
, Graphql
, Source
, Auto
, Lifecycle
, Scheduled
, Warm
, Backup
, Backup
, Backup
, Ecs
, Eks
, Fairshare
, Fargate
, Job
, Managed
, Managed
, Multi
, Unmanaged
, Certificate
, Dns
, Private
, Slack
, Edge
, Cache
, Cloud
, Distribution
, Function
, Key
, Key
, Origin
, Origin
, Public
, Realtime
, Response
, S3
, Trail
, Alarm
, Composite
, Dashboard
, Bit
, Fleet
, Git
, Git
, Pipeline
, Project
, Report
, Untrusted
, Repository
, Custom
, Ecs
, Ecs
, Ecs
, Lambda
, Lambda
, Lambda
, Server
, Server
, Server
, Profiling
, Pipeline
, Notification
, User
, User
, User
, User
, User
, User
, User
, User
, User
, User
, User
, Access
, Cloud
, Cloud
, Custom
, Custom
, Managed
, Cluster
, Database
, Database
, Database
, Table
, Table
, Bastion
, Client
, Client
, Client
, Flow
, Gateway
, Instance
, Interface
, Key
, Launch
, Network
, Network
, Placement
, Prefix
, Private
, Public
, Security
, Subnet
, Subnet
, Volume
, Vpc
, Vpc
, Vpn
, Vpn
, Repository
, Cluster
, Ec2
, Ec2
, External
, External
, Fargate
, Fargate
, Task
, Access
, File
, Access
, Addon
, Cluster
, Fargate
, Nodegroup
, Open
, Load
, Application
, Application
, Network
, Network
, Trust
, Trust
, Domain
, Api
, Archive
, Connection
, Event
, Event
, Rule
, Lustre
, Accelerator
, Endpoint
, Listener
, Access
, Group
, Instance
, Lazy
, Managed
, Open
, Policy
, Role
, Saml
, User
, Resource
, Stream
, Alias
, Key
, Alias
, Code
, Docker
, Event
, Event
, Function
, Function
, Layer
, Singleton
, Version
, Nodejs
, Cross
, Log
, Log
, Metric
, Query
, Resource
, Subscription
, Domain
, Database
, Database
, Database
, Database
, Database
, Database
, Database
, Option
, Parameter
, Serverless
, Serverless
, Subnet
, ARecord
, Aaaa
, Caa
, Caa
, Cname
, Ds
, Hosted
, Key
, Mx
, Ns
, Private
, Public
, Record
, Srv
, Txt
, Zone
, Bucket
, Bucket
, Resource
, Rotation
, Secret
, Secret
, Cloud
, Portfolio
, Tag
, Alias
, Cname
, Http
, Ip
, Non
, Private
, Public
, Service
, Configuration
, Configuration
, Dedicated
, Email
, Receipt
, Receipt
, Receipt
, Vdm
, Signing
, Subscription
, Topic
, Topic
, Queue
, Queue
, String
, String
, Activity
, State
, Canary
, Aws
, Kubectl
, Node
, Trigger
, Custom
, Ec2
, Git
, Identity
, Identity
, Egress
, Internet
, Ipam
, Nat
, Route
, Route
, Subnet
, VPNGateway
, Vpc
, Alias
, Build
, Build
, Game
, Game
, Matchmaking
, Queued
, Script
, Standalone
, Connection
, Data
, Database
, External
, Job
, S3
, Security
, Table
, Account
, Logging
, Scheduled
, Topic
, Detector
, Input
, Channel
, Playback
, Stream
, Application
, Delivery
, Go
, Python
, Python
, Geofence
, Place
, Route
, Tracker
, Cluster
, Cluster
, Database
, Database
, Parameter
, Subnet
, Pipe
, Cluster
, Cluster
, Cluster
, Database
, Firewall
, Firewall
, Firewall
, Access
, Endpoint
, Endpoint
, Model
, Group
, Schedule
, Application
, Attribute
Interface for the Resource construct.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
env
Type:
Resource
The environment this resource belongs to.
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.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
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
).