Class: AWSCDK::ImageBuilder::CfnInfrastructureConfigurationProps

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

Overview

Properties for defining a CfnInfrastructureConfiguration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_profile_name:, name:, description: nil, instance_metadata_options: nil, instance_types: nil, key_pair: nil, logging: nil, placement: nil, resource_tags: nil, security_group_ids: nil, sns_topic_arn: nil, subnet_id: nil, tags: nil, terminate_instance_on_failure: nil) ⇒ CfnInfrastructureConfigurationProps

Returns a new instance of CfnInfrastructureConfigurationProps.

Parameters:

  • instance_profile_name (String, AWSCDK::Interfaces::AWSIAM::IInstanceProfileRef)

    The instance profile to associate with the instance used to customize your Amazon EC2 AMI.

  • name (String)

    The name of the infrastructure configuration.

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

    The description of the infrastructure configuration.

  • instance_metadata_options (AWSCDK::IResolvable, AWSCDK::ImageBuilder::CfnInfrastructureConfiguration::InstanceMetadataOptionsProperty, nil) (defaults to: nil)

    The instance metadata options that you can set for the HTTP requests that pipeline builds use to launch EC2 build and test instances.

  • instance_types (Array<String>, nil) (defaults to: nil)

    The instance types of the infrastructure configuration.

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

    The key pair of the infrastructure configuration.

  • logging (AWSCDK::IResolvable, AWSCDK::ImageBuilder::CfnInfrastructureConfiguration::LoggingProperty, nil) (defaults to: nil)

    The logging configuration of the infrastructure configuration.

  • placement (AWSCDK::IResolvable, AWSCDK::ImageBuilder::CfnInfrastructureConfiguration::PlacementProperty, nil) (defaults to: nil)

    The instance placement settings that define where the instances that are launched from your image will run.

  • resource_tags (AWSCDK::IResolvable, Hash{String => String}, nil) (defaults to: nil)

    The metadata tags to assign to the Amazon EC2 instance that Image Builder launches during the build process.

  • security_group_ids (Array<String>, nil) (defaults to: nil)

    The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.

  • sns_topic_arn (String, AWSCDK::Interfaces::AWSSNS::ITopicRef, nil) (defaults to: nil)

    The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.

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

    The subnet ID in which to place the instance used to customize your Amazon EC2 AMI.

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

    The metadata tags to assign to the infrastructure configuration resource that Image Builder creates as output.

  • terminate_instance_on_failure (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    The terminate instance on failure setting of the infrastructure configuration.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 23

def initialize(instance_profile_name:, name:, description: nil, instance_metadata_options: nil, instance_types: nil, key_pair: nil, logging: nil, placement: nil, resource_tags: nil, security_group_ids: nil, sns_topic_arn: nil, subnet_id: nil, tags: nil, terminate_instance_on_failure: nil)
  @instance_profile_name = instance_profile_name
  Jsii::Type.check_type(@instance_profile_name, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSUluc3RhbmNlUHJvZmlsZVJlZiJ9XX19")), "instanceProfileName")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @instance_metadata_options = .is_a?(Hash) ? ::AWSCDK::ImageBuilder::CfnInfrastructureConfiguration::InstanceMetadataOptionsProperty.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@instance_metadata_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pbWFnZWJ1aWxkZXIuQ2ZuSW5mcmFzdHJ1Y3R1cmVDb25maWd1cmF0aW9uLkluc3RhbmNlTWV0YWRhdGFPcHRpb25zUHJvcGVydHkifV19fQ==")), "instanceMetadataOptions") unless @instance_metadata_options.nil?
  @instance_types = instance_types
  Jsii::Type.check_type(@instance_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "instanceTypes") unless @instance_types.nil?
  @key_pair = key_pair
  Jsii::Type.check_type(@key_pair, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyPair") unless @key_pair.nil?
  @logging = logging.is_a?(Hash) ? ::AWSCDK::ImageBuilder::CfnInfrastructureConfiguration::LoggingProperty.new(**logging.transform_keys(&:to_sym)) : logging
  Jsii::Type.check_type(@logging, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pbWFnZWJ1aWxkZXIuQ2ZuSW5mcmFzdHJ1Y3R1cmVDb25maWd1cmF0aW9uLkxvZ2dpbmdQcm9wZXJ0eSJ9XX19")), "logging") unless @logging.nil?
  @placement = placement.is_a?(Hash) ? ::AWSCDK::ImageBuilder::CfnInfrastructureConfiguration::PlacementProperty.new(**placement.transform_keys(&:to_sym)) : placement
  Jsii::Type.check_type(@placement, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pbWFnZWJ1aWxkZXIuQ2ZuSW5mcmFzdHJ1Y3R1cmVDb25maWd1cmF0aW9uLlBsYWNlbWVudFByb3BlcnR5In1dfX0=")), "placement") unless @placement.nil?
  @resource_tags = resource_tags
  Jsii::Type.check_type(@resource_tags, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "resourceTags") unless @resource_tags.nil?
  @security_group_ids = security_group_ids
  Jsii::Type.check_type(@security_group_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "securityGroupIds") unless @security_group_ids.nil?
  @sns_topic_arn = sns_topic_arn
  Jsii::Type.check_type(@sns_topic_arn, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19zbnMuSVRvcGljUmVmIn1dfX0=")), "snsTopicArn") unless @sns_topic_arn.nil?
  @subnet_id = subnet_id
  Jsii::Type.check_type(@subnet_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subnetId") unless @subnet_id.nil?
  @tags = tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil?
  @terminate_instance_on_failure = terminate_instance_on_failure
  Jsii::Type.check_type(@terminate_instance_on_failure, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "terminateInstanceOnFailure") unless @terminate_instance_on_failure.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

The description of the infrastructure configuration.



68
69
70
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 68

def description
  @description
end

#instance_metadata_optionsAWSCDK::IResolvable, ... (readonly)

The instance metadata options that you can set for the HTTP requests that pipeline builds use to launch EC2 build and test instances.



73
74
75
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 73

def 
  @instance_metadata_options
end

#instance_profile_nameString, AWSCDK::Interfaces::AWSIAM::IInstanceProfileRef (readonly)

The instance profile to associate with the instance used to customize your Amazon EC2 AMI.



58
59
60
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 58

def instance_profile_name
  @instance_profile_name
end

#instance_typesArray<String>? (readonly)

The instance types of the infrastructure configuration.

You can specify one or more instance types to use for this build. The service will pick one of these instance types based on availability.



80
81
82
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 80

def instance_types
  @instance_types
end

#key_pairString? (readonly)

The key pair of the infrastructure configuration.

You can use this to log on to and debug the instance used to create your image.



87
88
89
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 87

def key_pair
  @key_pair
end

#loggingAWSCDK::IResolvable, ... (readonly)

The logging configuration of the infrastructure configuration.



92
93
94
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 92

def logging
  @logging
end

#nameString (readonly)

The name of the infrastructure configuration.



63
64
65
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 63

def name
  @name
end

#placementAWSCDK::IResolvable, ... (readonly)

The instance placement settings that define where the instances that are launched from your image will run.



97
98
99
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 97

def placement
  @placement
end

#resource_tagsAWSCDK::IResolvable, ... (readonly)

The metadata tags to assign to the Amazon EC2 instance that Image Builder launches during the build process.

Tags are formatted as key value pairs.



104
105
106
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 104

def resource_tags
  @resource_tags
end

#security_group_idsArray<String>? (readonly)

The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.



109
110
111
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 109

def security_group_ids
  @security_group_ids
end

#sns_topic_arnString, ... (readonly)

The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.

EC2 Image Builder is unable to send notifications to SNS topics that are encrypted using keys from other accounts. The key that is used to encrypt the SNS topic must reside in the account that the Image Builder service runs under.



116
117
118
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 116

def sns_topic_arn
  @sns_topic_arn
end

#subnet_idString? (readonly)

The subnet ID in which to place the instance used to customize your Amazon EC2 AMI.



121
122
123
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 121

def subnet_id
  @subnet_id
end

#tagsHash{String => String}? (readonly)

The metadata tags to assign to the infrastructure configuration resource that Image Builder creates as output.

Tags are formatted as key value pairs.



128
129
130
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 128

def tags
  @tags
end

#terminate_instance_on_failureBoolean, ... (readonly)

The terminate instance on failure setting of the infrastructure configuration.

Set to false if you want Image Builder to retain the instance used to configure your AMI if the build or test phase of your workflow fails.



135
136
137
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 135

def terminate_instance_on_failure
  @terminate_instance_on_failure
end

Class Method Details

.jsii_propertiesObject



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 137

def self.jsii_properties
  {
    :instance_profile_name => "instanceProfileName",
    :name => "name",
    :description => "description",
    :instance_metadata_options => "instanceMetadataOptions",
    :instance_types => "instanceTypes",
    :key_pair => "keyPair",
    :logging => "logging",
    :placement => "placement",
    :resource_tags => "resourceTags",
    :security_group_ids => "securityGroupIds",
    :sns_topic_arn => "snsTopicArn",
    :subnet_id => "subnetId",
    :tags => "tags",
    :terminate_instance_on_failure => "terminateInstanceOnFailure",
  }
end

Instance Method Details

#to_jsiiObject



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'image_builder/cfn_infrastructure_configuration_props.rb', line 156

def to_jsii
  result = {}
  result.merge!({
    "instanceProfileName" => @instance_profile_name,
    "name" => @name,
    "description" => @description,
    "instanceMetadataOptions" => @instance_metadata_options,
    "instanceTypes" => @instance_types,
    "keyPair" => @key_pair,
    "logging" => @logging,
    "placement" => @placement,
    "resourceTags" => @resource_tags,
    "securityGroupIds" => @security_group_ids,
    "snsTopicArn" => @sns_topic_arn,
    "subnetId" => @subnet_id,
    "tags" => @tags,
    "terminateInstanceOnFailure" => @terminate_instance_on_failure,
  })
  result.compact
end