Class: AWSCDK::ImageBuilder::CfnInfrastructureConfiguration::PlacementProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
image_builder/cfn_infrastructure_configuration.rb

Overview

By default, EC2 instances run on shared tenancy hardware.

This means that multiple AWS accounts might share the same physical hardware. When you use dedicated hardware, the physical server that hosts your instances is dedicated to your AWS account . Instance placement settings contain the details for the physical hardware where instances that Image Builder launches during image creation will run.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(availability_zone: nil, host_id: nil, host_resource_group_arn: nil, tenancy: nil) ⇒ PlacementProperty

Returns a new instance of PlacementProperty.

Parameters:

  • availability_zone (String, nil) (defaults to: nil)

    The Availability Zone where your build and test instances will launch.

  • host_id (String, nil) (defaults to: nil)

    The ID of the Dedicated Host on which build and test instances run.

  • host_resource_group_arn (String, nil) (defaults to: nil)

    The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances.

  • tenancy (String, nil) (defaults to: nil)

    The tenancy of the instance.



792
793
794
795
796
797
798
799
800
801
# File 'image_builder/cfn_infrastructure_configuration.rb', line 792

def initialize(availability_zone: nil, host_id: nil, host_resource_group_arn: nil, tenancy: nil)
  @availability_zone = availability_zone
  Jsii::Type.check_type(@availability_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZone") unless @availability_zone.nil?
  @host_id = host_id
  Jsii::Type.check_type(@host_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hostId") unless @host_id.nil?
  @host_resource_group_arn = host_resource_group_arn
  Jsii::Type.check_type(@host_resource_group_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hostResourceGroupArn") unless @host_resource_group_arn.nil?
  @tenancy = tenancy
  Jsii::Type.check_type(@tenancy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tenancy") unless @tenancy.nil?
end

Instance Attribute Details

#availability_zoneString? (readonly)

The Availability Zone where your build and test instances will launch.



807
808
809
# File 'image_builder/cfn_infrastructure_configuration.rb', line 807

def availability_zone
  @availability_zone
end

#host_idString? (readonly)

The ID of the Dedicated Host on which build and test instances run.

This only applies if tenancy is host . If you specify the host ID, you must not specify the resource group ARN. If you specify both, Image Builder returns an error.



814
815
816
# File 'image_builder/cfn_infrastructure_configuration.rb', line 814

def host_id
  @host_id
end

#host_resource_group_arnString? (readonly)

The Amazon Resource Name (ARN) of the host resource group in which to launch build and test instances.

This only applies if tenancy is host . If you specify the resource group ARN, you must not specify the host ID. If you specify both, Image Builder returns an error.



821
822
823
# File 'image_builder/cfn_infrastructure_configuration.rb', line 821

def host_resource_group_arn
  @host_resource_group_arn
end

#tenancyString? (readonly)

The tenancy of the instance.

An instance with a tenancy of dedicated runs on single-tenant hardware. An instance with a tenancy of host runs on a Dedicated Host.

If tenancy is set to host , then you can optionally specify one target for placement – either host ID or host resource group ARN. If automatic placement is enabled for your host, and you don't specify any placement target, Amazon EC2 will try to find an available host for your build and test instances.



830
831
832
# File 'image_builder/cfn_infrastructure_configuration.rb', line 830

def tenancy
  @tenancy
end

Class Method Details

.jsii_propertiesObject



832
833
834
835
836
837
838
839
# File 'image_builder/cfn_infrastructure_configuration.rb', line 832

def self.jsii_properties
  {
    :availability_zone => "availabilityZone",
    :host_id => "hostId",
    :host_resource_group_arn => "hostResourceGroupArn",
    :tenancy => "tenancy",
  }
end

Instance Method Details

#to_jsiiObject



841
842
843
844
845
846
847
848
849
850
# File 'image_builder/cfn_infrastructure_configuration.rb', line 841

def to_jsii
  result = {}
  result.merge!({
    "availabilityZone" => @availability_zone,
    "hostId" => @host_id,
    "hostResourceGroupArn" => @host_resource_group_arn,
    "tenancy" => @tenancy,
  })
  result.compact
end