Module: AWSCDK::IResource

Includes:
AWSCDK::Interfaces::IEnvironmentAware, Constructs::IConstruct
Included in:
ACMPCA::ICertificateAuthority, APIGateway::IAPIKey, APIGateway::IDomainName, APIGateway::IGatewayResponse, APIGateway::IRequestValidator, APIGateway::IResource, APIGateway::IRestAPI, APIGateway::IStage, APIGateway::IUsagePlan, APIGateway::IVPCLink, APIGatewayv2::IAPI, APIGatewayv2::IAPIKey, APIGatewayv2::IAPIMapping, APIGatewayv2::IAuthorizer, APIGatewayv2::IDomainName, APIGatewayv2::IIntegration, APIGatewayv2::IRoute, APIGatewayv2::IStage, APIGatewayv2::IUsagePlan, APIGatewayv2::IVPCLink, AppConfig::IApplication, AppConfig::IDeploymentStrategy, AppConfig::IEnvironment, AppConfig::IExtension, AppMesh::IGatewayRoute, AppMesh::IMesh, AppMesh::IRoute, AppMesh::IVirtualGateway, AppMesh::IVirtualNode, AppMesh::IVirtualRouter, AppMesh::IVirtualService, AppSync::IAPI, AppSync::IAppsyncFunction, AppSync::IChannelNamespace, AppSync::IGraphqlAPI, AppSync::ISourceAPIAssociation, ApplicationAutoScaling::IScalableTarget, Autoscaling::IAutoScalingGroup, Autoscaling::ILifecycleHook, Backup::IBackupPlan, Backup::IBackupVault, Batch::IComputeEnvironment, Batch::IJobDefinition, Batch::IJobQueue, Batch::ISchedulingPolicy, BedrockAgentCore::IAPIKeyCredentialProvider, BedrockAgentCore::IBedrockAgentRuntime, BedrockAgentCore::IBrowserCustom, BedrockAgentCore::ICodeInterpreterCustom, BedrockAgentCore::IEvaluator, BedrockAgentCore::IGateway, BedrockAgentCore::IGatewayTarget, BedrockAgentCore::IMemory, BedrockAgentCore::IOAuth2CredentialProvider, BedrockAgentCore::IOnlineEvaluationConfig, BedrockAgentCore::IRuntimeEndpoint, BedrockAgentCore::IWorkloadIdentity, CertificateManager::ICertificate, Chatbot::ISlackChannelConfiguration, CloudFront::IDistribution, CloudFront::IFunction, CloudFront::IKeyGroup, CloudFront::IKeyValueStore, CloudFront::IOriginAccessControl, CloudFront::IOriginAccessIdentity, CloudFront::IPublicKey, CloudFront::IRealtimeLogConfig, CloudFront::IVPCOrigin, CloudWatch::IAlarm, CodeBuild::IFleet, CodeBuild::IProject, CodeBuild::IReportGroup, CodeDeploy::IECSApplication, CodeDeploy::IECSDeploymentGroup, CodeDeploy::ILambdaApplication, CodeDeploy::ILambdaDeploymentGroup, CodeDeploy::IServerApplication, CodeDeploy::IServerDeploymentGroup, CodeGuruProfiler::IProfilingGroup, CodeStarNotifications::INotificationRule, Codecommit::IRepository, Codepipeline::IPipeline, Cognito::IUserPool, Cognito::IUserPoolClient, Cognito::IUserPoolDomain, Cognito::IUserPoolGroup, Cognito::IUserPoolIdentityProvider, Cognito::IUserPoolResourceServer, CognitoIdentitypool::IIdentityPool, Config::IRule, DocDB::IClusterParameterGroup, DocDB::IDatabaseCluster, DocDB::IDatabaseInstance, DynamoDB::ITable, EC2::IClientVpnEndpoint, EC2::IFlowLog, EC2::IInstance, EC2::IKeyPair, EC2::ILaunchTemplate, EC2::INetworkAcl, EC2::INetworkAclEntry, EC2::IPlacementGroup, EC2::IPrefixList, EC2::ISecurityGroup, EC2::ISubnet, EC2::ISubnetNetworkAclAssociation, EC2::IVPC, EC2::IVPCEndpoint, EC2::IVPCEndpointService, EC2::IVolume, EC2::IVpnConnection, EC2::IVpnGateway, ECR::IRepository, ECS::ICluster, ECS::IService, ECS::ITaskDefinition, EFS::IAccessPoint, EKS::IAccessEntry, EKS::IAddon, EKS::ICluster, EKS::INodegroup, EKSv2::IAccessEntry, EKSv2::IAddon, EKSv2::ICluster, EKSv2::INodegroup, ElasticLoadBalancing::ILoadBalancer, ElasticLoadBalancingv2::IListener, ElasticLoadBalancingv2::ILoadBalancerV2, ElasticLoadBalancingv2::ITrustStore, Elasticsearch::IDomain, Events::IAPIDestination, Events::IConnection, Events::IEventBus, Events::IRule, EventsTargets::IDeliveryStream, GlobalAccelerator::IAccelerator, GlobalAccelerator::IEndpointGroup, GlobalAccelerator::IListener, AWSCDK::IAM::IAccessKey, AWSCDK::IAM::IIdentity, AWSCDK::IAM::IInstanceProfile, AWSCDK::IAM::IOidcProvider, AWSCDK::IAM::IOpenIdConnectProvider, AWSCDK::IAM::IPolicy, AWSCDK::IAM::IResourceWithPolicy, AWSCDK::IAM::ISamlProvider, AWSCDK::Inspector::IAssessmentTemplate, KMS::IKey, Kinesis::IStream, Kinesis::IStreamConsumer, KinesisFirehose::IDeliveryStream, Lambda::ICapacityProvider, Lambda::ICodeSigningConfig, Lambda::IEventSourceMapping, Lambda::IFunction, Lambda::IFunctionURL, Lambda::ILayerVersion, Logs::ILogStream, OpenSearchService::IDomain, RDS::IAuroraClusterInstance, RDS::IDatabaseCluster, RDS::IDatabaseInstance, RDS::IDatabaseProxy, RDS::IDatabaseProxyEndpoint, RDS::IOptionGroup, RDS::IParameterGroup, RDS::IServerlessCluster, RDS::ISubnetGroup, Resource, Route53::IHealthCheck, Route53::IHostedZone, Route53::IKeySigningKey, Route53::IRecordSet, S3::IBucket, SES::IConfigurationSet, SES::IConfigurationSetEventDestination, SES::IDedicatedIPPool, SES::IEmailIdentity, SES::IReceiptRule, SES::IReceiptRuleSet, SES::IVdmAttributes, SNS::ITopic, SQS::IQueue, SSM::IParameter, Sagemaker::IEndpoint, Sagemaker::IPipeline, Scheduler::ISchedule, Scheduler::IScheduleGroup, SecretsManager::ISecret, ServiceCatalog::IPortfolio, ServiceCatalog::IProduct, ServiceDiscovery::IInstance, ServiceDiscovery::INamespace, ServiceDiscovery::IService, Signer::ISigningProfile, StepFunctions::IActivity, StepFunctions::IStateMachine, Synthetics::ICanary, Synthetics::IGroup
Defined in:
i_resource.rb

Overview

Interface for L2 Resource constructs.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



69
70
71
72
73
74
75
76
77
# File 'i_resource.rb', line 69

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
  }
end

Instance Method Details

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

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).

Parameters:



64
65
66
67
# File 'i_resource.rb', line 64

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



27
28
29
# File 'i_resource.rb', line 27

def env()
  jsii_get_property("env")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


12
13
14
# File 'i_resource.rb', line 12

def node()
  jsii_get_property("node")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



34
35
36
# File 'i_resource.rb', line 34

def stack()
  jsii_get_property("stack")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



45
46
47
48
49
50
# File 'i_resource.rb', line 45

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end