Class: AWSCDK::ImageBuilder::CfnImageRecipe::AdditionalInstanceConfigurationProperty

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

Overview

In addition to your infrastructure configuration, these settings provide an extra layer of control over your build instances.

You can also specify commands to run on launch for all of your build instances.

Image Builder does not automatically install the Systems Manager agent on Windows instances. If your base image includes the Systems Manager agent, then the AMI that you create will also include the agent. For Linux instances, if the base image does not already include the Systems Manager agent, Image Builder installs it. For Linux instances where Image Builder installs the Systems Manager agent, you can choose whether to keep it for the AMI that you create.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(systems_manager_agent: nil, user_data_override: nil) ⇒ AdditionalInstanceConfigurationProperty

Returns a new instance of AdditionalInstanceConfigurationProperty.

Parameters:



693
694
695
696
697
698
# File 'image_builder/cfn_image_recipe.rb', line 693

def initialize(systems_manager_agent: nil, user_data_override: nil)
  @systems_manager_agent = systems_manager_agent.is_a?(Hash) ? ::AWSCDK::ImageBuilder::CfnImageRecipe::SystemsManagerAgentProperty.new(**systems_manager_agent.transform_keys(&:to_sym)) : systems_manager_agent
  Jsii::Type.check_type(@systems_manager_agent, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pbWFnZWJ1aWxkZXIuQ2ZuSW1hZ2VSZWNpcGUuU3lzdGVtc01hbmFnZXJBZ2VudFByb3BlcnR5In1dfX0=")), "systemsManagerAgent") unless @systems_manager_agent.nil?
  @user_data_override = user_data_override
  Jsii::Type.check_type(@user_data_override, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "userDataOverride") unless @user_data_override.nil?
end

Instance Attribute Details

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

Contains settings for the Systems Manager agent on your build instance.



704
705
706
# File 'image_builder/cfn_image_recipe.rb', line 704

def systems_manager_agent
  @systems_manager_agent
end

#user_data_overrideString? (readonly)

Use this property to provide commands or a command script to run when you launch your build instance.

The userDataOverride property replaces any commands that Image Builder might have added to ensure that Systems Manager is installed on your Linux build instance. If you override the user data, make sure that you add commands to install Systems Manager, if it is not pre-installed on your base image.

The user data is always base 64 encoded. For example, the following commands are encoded as IyEvYmluL2Jhc2gKbWtkaXIgLXAgL3Zhci9iYi8KdG91Y2ggL3Zhci$ :

#!/bin/bash

mkdir -p /var/bb/

touch /var



719
720
721
# File 'image_builder/cfn_image_recipe.rb', line 719

def user_data_override
  @user_data_override
end

Class Method Details

.jsii_propertiesObject



721
722
723
724
725
726
# File 'image_builder/cfn_image_recipe.rb', line 721

def self.jsii_properties
  {
    :systems_manager_agent => "systemsManagerAgent",
    :user_data_override => "userDataOverride",
  }
end

Instance Method Details

#to_jsiiObject



728
729
730
731
732
733
734
735
# File 'image_builder/cfn_image_recipe.rb', line 728

def to_jsii
  result = {}
  result.merge!({
    "systemsManagerAgent" => @systems_manager_agent,
    "userDataOverride" => @user_data_override,
  })
  result.compact
end