Class: AWSCDK::ImageBuilder::CfnImageRecipeProps

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

Overview

Properties for defining a CfnImageRecipe.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, parent_image:, version:, additional_instance_configuration: nil, ami_tags: nil, block_device_mappings: nil, components: nil, description: nil, tags: nil, working_directory: nil) ⇒ CfnImageRecipeProps

Returns a new instance of CfnImageRecipeProps.

Parameters:



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'image_builder/cfn_image_recipe_props.rb', line 19

def initialize(name:, parent_image:, version:, additional_instance_configuration: nil, ami_tags: nil, block_device_mappings: nil, components: nil, description: nil, tags: nil, working_directory: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @parent_image = parent_image
  Jsii::Type.check_type(@parent_image, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "parentImage")
  @version = version
  Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "version")
  @additional_instance_configuration = additional_instance_configuration.is_a?(Hash) ? ::AWSCDK::ImageBuilder::CfnImageRecipe::AdditionalInstanceConfigurationProperty.new(**additional_instance_configuration.transform_keys(&:to_sym)) : additional_instance_configuration
  Jsii::Type.check_type(@additional_instance_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pbWFnZWJ1aWxkZXIuQ2ZuSW1hZ2VSZWNpcGUuQWRkaXRpb25hbEluc3RhbmNlQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "additionalInstanceConfiguration") unless @additional_instance_configuration.nil?
  @ami_tags = ami_tags
  Jsii::Type.check_type(@ami_tags, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "amiTags") unless @ami_tags.nil?
  @block_device_mappings = block_device_mappings
  Jsii::Type.check_type(@block_device_mappings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaW1hZ2VidWlsZGVyLkNmbkltYWdlUmVjaXBlLkluc3RhbmNlQmxvY2tEZXZpY2VNYXBwaW5nUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "blockDeviceMappings") unless @block_device_mappings.nil?
  @components = components
  Jsii::Type.check_type(@components, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaW1hZ2VidWlsZGVyLkNmbkltYWdlUmVjaXBlLkNvbXBvbmVudENvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "components") unless @components.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @tags = tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil?
  @working_directory = working_directory
  Jsii::Type.check_type(@working_directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "workingDirectory") unless @working_directory.nil?
end

Instance Attribute Details

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

Before you create a new AMI, Image Builder launches temporary Amazon EC2 instances to build and test your image configuration.

Instance configuration adds a layer of control over those instances. You can define settings and add scripts to run when an instance is launched from your AMI.



76
77
78
# File 'image_builder/cfn_image_recipe_props.rb', line 76

def additional_instance_configuration
  @additional_instance_configuration
end

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

Tags that are applied to the AMI that Image Builder creates during the Build phase prior to image distribution.



81
82
83
# File 'image_builder/cfn_image_recipe_props.rb', line 81

def ami_tags
  @ami_tags
end

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

The block device mappings to apply when creating images from this recipe.



86
87
88
# File 'image_builder/cfn_image_recipe_props.rb', line 86

def block_device_mappings
  @block_device_mappings
end

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

The components that are included in the image recipe.

Recipes require a minimum of one build component, and can have a maximum of 20 build and test components in any combination.



93
94
95
# File 'image_builder/cfn_image_recipe_props.rb', line 93

def components
  @components
end

#descriptionString? (readonly)

The description of the image recipe.



98
99
100
# File 'image_builder/cfn_image_recipe_props.rb', line 98

def description
  @description
end

#nameString (readonly)

The name of the image recipe.



46
47
48
# File 'image_builder/cfn_image_recipe_props.rb', line 46

def name
  @name
end

#parent_imageString (readonly)

The base image for customizations specified in the image recipe.

You can specify the parent image using one of the following options:

  • AMI ID
  • Image Builder image Amazon Resource Name (ARN)
  • AWS Systems Manager (SSM) Parameter Store Parameter, prefixed by ssm: , followed by the parameter name or ARN.
  • AWS Marketplace product ID


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

def parent_image
  @parent_image
end

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

The tags of the image recipe.



103
104
105
# File 'image_builder/cfn_image_recipe_props.rb', line 103

def tags
  @tags
end

#versionString (readonly)

The semantic version of the image recipe. This version follows the semantic version syntax.

The semantic version has four nodes: ../. You can assign values for the first three, and can filter on all of them.

Assignment: For the first three nodes you can assign any positive integer value, including zero, with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the fourth node.

Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as 2021.01.01.



69
70
71
# File 'image_builder/cfn_image_recipe_props.rb', line 69

def version
  @version
end

#working_directoryString? (readonly)

The working directory to be used during build and test workflows.



108
109
110
# File 'image_builder/cfn_image_recipe_props.rb', line 108

def working_directory
  @working_directory
end

Class Method Details

.jsii_propertiesObject



110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'image_builder/cfn_image_recipe_props.rb', line 110

def self.jsii_properties
  {
    :name => "name",
    :parent_image => "parentImage",
    :version => "version",
    :additional_instance_configuration => "additionalInstanceConfiguration",
    :ami_tags => "amiTags",
    :block_device_mappings => "blockDeviceMappings",
    :components => "components",
    :description => "description",
    :tags => "tags",
    :working_directory => "workingDirectory",
  }
end

Instance Method Details

#to_jsiiObject



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'image_builder/cfn_image_recipe_props.rb', line 125

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "parentImage" => @parent_image,
    "version" => @version,
    "additionalInstanceConfiguration" => @additional_instance_configuration,
    "amiTags" => @ami_tags,
    "blockDeviceMappings" => @block_device_mappings,
    "components" => @components,
    "description" => @description,
    "tags" => @tags,
    "workingDirectory" => @working_directory,
  })
  result.compact
end