Module: AWSCDK::EC2::IPlacementGroup

Includes:
IResource, Interfaces::AWSEC2::IPlacementGroupRef
Included in:
PlacementGroup
Defined in:
ec2/i_placement_group.rb

Overview

Determines where your instances are placed on the underlying hardware according to the specified PlacementGroupStrategy.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'ec2/i_placement_group.rb', line 123

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 },
    :placement_group_ref => { kind: :property, name: "placementGroupRef", is_optional: false },
    :placement_group_name => { kind: :property, name: "placementGroupName", is_optional: false },
    :partitions => { kind: :property, name: "partitions", is_optional: true },
    :spread_level => { kind: :property, name: "spreadLevel", is_optional: true },
    :strategy => { kind: :property, name: "strategy", is_optional: true },
    :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:



118
119
120
121
# File 'ec2/i_placement_group.rb', line 118

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.



29
30
31
# File 'ec2/i_placement_group.rb', line 29

def env()
  jsii_get_property("env")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


14
15
16
# File 'ec2/i_placement_group.rb', line 14

def node()
  jsii_get_property("node")
end

#partitionsNumeric?

Note:

Default: 0

The number of partitions.

Valid only when Strategy is set to PARTITION.

Returns:

  • (Numeric, nil)


60
61
62
# File 'ec2/i_placement_group.rb', line 60

def partitions()
  jsii_get_property("partitions")
end

#placement_group_nameString

The name of this placement group.

Returns:

  • (String)


50
51
52
# File 'ec2/i_placement_group.rb', line 50

def placement_group_name()
  jsii_get_property("placementGroupName")
end

#placement_group_refAWSCDK::Interfaces::AWSEC2::PlacementGroupReference

A reference to a PlacementGroup resource.



43
44
45
# File 'ec2/i_placement_group.rb', line 43

def placement_group_ref()
  jsii_get_property("placementGroupRef")
end

#spread_levelAWSCDK::EC2::PlacementGroupSpreadLevel?

Note:

Default: - no spread level

Places instances on distinct hardware.

Spread placement groups are recommended for applications that have a small number of critical instances that should be kept separate from each other. Launching instances in a spread level placement group reduces the risk of simultaneous failures that might occur when instances share the same equipment. Spread level placement groups provide access to distinct hardware, and are therefore suitable for mixing instance types or launching instances over time. If you start or launch an instance in a spread placement group and there is insufficient unique hardware to fulfill the request, the request fails. Amazon EC2 makes more distinct hardware available over time, so you can try your request again later. Placement groups can spread instances across racks or hosts. You can use host level spread placement groups only with AWS Outposts.



80
81
82
# File 'ec2/i_placement_group.rb', line 80

def spread_level()
  jsii_get_property("spreadLevel")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



36
37
38
# File 'ec2/i_placement_group.rb', line 36

def stack()
  jsii_get_property("stack")
end

#strategyAWSCDK::EC2::PlacementGroupStrategy?

Note:

Default: - PlacementGroupStrategy.PARTITION if partitions is defined, CLUSTER otherwise

Which strategy to use when launching instances.



88
89
90
# File 'ec2/i_placement_group.rb', line 88

def strategy()
  jsii_get_property("strategy")
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



99
100
101
102
103
104
# File 'ec2/i_placement_group.rb', line 99

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