Class: AWSCDK::CfnHook

Inherits:
CfnElement
  • Object
show all
Defined in:
cfn_hook.rb

Overview

Represents a CloudFormation resource.

Direct Known Subclasses

CfnCodeDeployBlueGreenHook

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ CfnHook

Creates a new Hook object.

Parameters:



13
14
15
16
17
18
19
# File 'cfn_hook.rb', line 13

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::CfnHookProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5Ib29rUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'cfn_hook.rb', line 21

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :creation_stack => { kind: :property, name: "creationStack", is_optional: false },
    :logical_id => { kind: :property, name: "logicalId", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :type => { kind: :property, name: "type", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :override_logical_id => { kind: :method, name: "overrideLogicalId", is_optional: false },
    :render_properties => { kind: :method, name: "renderProperties", is_optional: false },
  }
end

Instance Method Details

#creation_stackArray<String>

Returns:

  • (Array<String>)


43
44
45
# File 'cfn_hook.rb', line 43

def creation_stack()
  jsii_get_property("creationStack")
end

#logical_idString

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use override_logical_id(new_logical_id).

Returns:

  • (String)


55
56
57
# File 'cfn_hook.rb', line 55

def logical_id()
  jsii_get_property("logicalId")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


38
39
40
# File 'cfn_hook.rb', line 38

def node()
  jsii_get_property("node")
end

#override_logical_id(new_logical_id) ⇒ void

This method returns an undefined value.

Overrides the auto-generated logical ID with a specific ID.

Parameters:

  • new_logical_id (String)

    The new logical ID to use for this stack element.



102
103
104
105
# File 'cfn_hook.rb', line 102

def override_logical_id(new_logical_id)
  Jsii::Type.check_type(new_logical_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "newLogicalId")
  jsii_call_method("overrideLogicalId", [new_logical_id])
end

#render_properties(props = nil) ⇒ Hash{String => Object}?

Parameters:

  • props (Hash{String => Object}, nil) (defaults to: nil)

Returns:

  • (Hash{String => Object}, nil)


109
110
111
112
# File 'cfn_hook.rb', line 109

def render_properties(props = nil)
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "props") unless props.nil?
  jsii_call_method("renderProperties", [props])
end

#stackAWSCDK::Stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Returns:



64
65
66
# File 'cfn_hook.rb', line 64

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


78
79
80
# File 'cfn_hook.rb', line 78

def to_string()
  jsii_call_method("toString", [])
end

#typeString

The type of the hook (for example, "AWS::CodeDeploy::BlueGreen").

Returns:

  • (String)


71
72
73
# File 'cfn_hook.rb', line 71

def type()
  jsii_get_property("type")
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. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


91
92
93
94
95
96
# File 'cfn_hook.rb', line 91

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