Class: AWSCDK::MissingRemovalPolicies

Inherits:
Jsii::Object
  • Object
show all
Defined in:
missing_removal_policies.rb

Overview

Manages removal policies for resources without existing policies within a construct scope.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ MissingRemovalPolicies

Returns a new instance of MissingRemovalPolicies.

Raises:

  • (NoMethodError)


8
9
10
# File 'missing_removal_policies.rb', line 8

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.MissingRemovalPolicies does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.jsii_overridable_methodsObject



12
13
14
15
16
17
18
19
20
# File 'missing_removal_policies.rb', line 12

def self.jsii_overridable_methods
  {
    :apply => { kind: :method, name: "apply", is_optional: false },
    :destroy => { kind: :method, name: "destroy", is_optional: false },
    :retain => { kind: :method, name: "retain", is_optional: false },
    :retain_on_update_or_delete => { kind: :method, name: "retainOnUpdateOrDelete", is_optional: false },
    :snapshot => { kind: :method, name: "snapshot", is_optional: false },
  }
end

.of(scope) ⇒ AWSCDK::MissingRemovalPolicies

Returns the missing removal policies API for the given scope.

Parameters:

  • scope (Constructs::IConstruct)

    The scope.

Returns:

  • (AWSCDK::MissingRemovalPolicies)


26
27
28
29
# File 'missing_removal_policies.rb', line 26

def self.of(scope)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "scope")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.MissingRemovalPolicies", "of", [scope])
end

Instance Method Details

#apply(policy, props = nil) ⇒ void

This method returns an undefined value.

Apply a removal policy only to resources without existing policies within this scope.

Parameters:



36
37
38
39
40
41
# File 'missing_removal_policies.rb', line 36

def apply(policy, props = nil)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  props = props.is_a?(Hash) ? ::AWSCDK::RemovalPolicyProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5UHJvcHMifQ==")), "props") unless props.nil?
  jsii_call_method("apply", [policy, props])
end

#destroy(props = nil) ⇒ void

This method returns an undefined value.

Apply DESTROY removal policy only to resources without existing policies within this scope.

Parameters:



47
48
49
50
51
# File 'missing_removal_policies.rb', line 47

def destroy(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::RemovalPolicyProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5UHJvcHMifQ==")), "props") unless props.nil?
  jsii_call_method("destroy", [props])
end

#retain(props = nil) ⇒ void

This method returns an undefined value.

Apply RETAIN removal policy only to resources without existing policies within this scope.

Parameters:



57
58
59
60
61
# File 'missing_removal_policies.rb', line 57

def retain(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::RemovalPolicyProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5UHJvcHMifQ==")), "props") unless props.nil?
  jsii_call_method("retain", [props])
end

#retain_on_update_or_delete(props = nil) ⇒ void

This method returns an undefined value.

Apply RETAIN_ON_UPDATE_OR_DELETE removal policy only to resources without existing policies within this scope.

Parameters:



67
68
69
70
71
# File 'missing_removal_policies.rb', line 67

def retain_on_update_or_delete(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::RemovalPolicyProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5UHJvcHMifQ==")), "props") unless props.nil?
  jsii_call_method("retainOnUpdateOrDelete", [props])
end

#snapshot(props = nil) ⇒ void

This method returns an undefined value.

Apply SNAPSHOT removal policy only to resources without existing policies within this scope.

Parameters:



77
78
79
80
81
# File 'missing_removal_policies.rb', line 77

def snapshot(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::RemovalPolicyProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5UHJvcHMifQ==")), "props") unless props.nil?
  jsii_call_method("snapshot", [props])
end