Class: AWSCDK::EC2::SSMParameterImageOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/ssm_parameter_image_options.rb

Overview

Properties for GenericSsmParameterImage.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(additional_cache_key: nil, cached_in_context: nil, os: nil, parameter_version: nil, user_data: nil) ⇒ SSMParameterImageOptions

Returns a new instance of SSMParameterImageOptions.

Parameters:

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

    Adds an additional discriminator to the cdk.context.json cache key.

  • cached_in_context (Boolean, nil) (defaults to: nil)

    Whether the AMI ID is cached to be stable between deployments.

  • os (AWSCDK::EC2::OperatingSystemType, nil) (defaults to: nil)

    Operating system.

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

    The version of the SSM parameter.

  • user_data (AWSCDK::EC2::UserData, nil) (defaults to: nil)

    Custom UserData.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'ec2/ssm_parameter_image_options.rb', line 12

def initialize(additional_cache_key: nil, cached_in_context: nil, os: nil, parameter_version: nil, user_data: nil)
  @additional_cache_key = additional_cache_key
  Jsii::Type.check_type(@additional_cache_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "additionalCacheKey") unless @additional_cache_key.nil?
  @cached_in_context = cached_in_context
  Jsii::Type.check_type(@cached_in_context, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "cachedInContext") unless @cached_in_context.nil?
  @os = os
  Jsii::Type.check_type(@os, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLk9wZXJhdGluZ1N5c3RlbVR5cGUifQ==")), "os") unless @os.nil?
  @parameter_version = parameter_version
  Jsii::Type.check_type(@parameter_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "parameterVersion") unless @parameter_version.nil?
  @user_data = user_data
  Jsii::Type.check_type(@user_data, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlVzZXJEYXRhIn0=")), "userData") unless @user_data.nil?
end

Instance Attribute Details

#additional_cache_keyString? (readonly)

Note:

Default: - no additional cache key

Adds an additional discriminator to the cdk.context.json cache key.

Returns:

  • (String, nil)


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

def additional_cache_key
  @additional_cache_key
end

#cached_in_contextBoolean? (readonly)

Note:

Default: false

Whether the AMI ID is cached to be stable between deployments.

By default, the newest image is used on each deployment. This will cause instances to be replaced whenever a new version is released, and may cause downtime if there aren't enough running instances in the AutoScalingGroup to reschedule the tasks on.

If set to true, the AMI ID will be cached in cdk.context.json and the same value will be used on future runs. Your instances will not be replaced but your AMI version will grow old over time. To refresh the AMI lookup, you will have to evict the value from the cache using the cdk context command. See https://docs.aws.amazon.com/cdk/latest/guide/context.html for more information.

Can not be set to true in environment-agnostic stacks.

Returns:

  • (Boolean, nil)


48
49
50
# File 'ec2/ssm_parameter_image_options.rb', line 48

def cached_in_context
  @cached_in_context
end

#osAWSCDK::EC2::OperatingSystemType? (readonly)

Note:

Default: OperatingSystemType.LINUX

Operating system.



53
54
55
# File 'ec2/ssm_parameter_image_options.rb', line 53

def os
  @os
end

#parameter_versionString? (readonly)

Note:

Default: no version specified.

The version of the SSM parameter.

Returns:

  • (String, nil)


58
59
60
# File 'ec2/ssm_parameter_image_options.rb', line 58

def parameter_version
  @parameter_version
end

#user_dataAWSCDK::EC2::UserData? (readonly)

Note:

Default: - UserData appropriate for the OS

Custom UserData.

Returns:



63
64
65
# File 'ec2/ssm_parameter_image_options.rb', line 63

def user_data
  @user_data
end

Class Method Details

.jsii_propertiesObject



65
66
67
68
69
70
71
72
73
# File 'ec2/ssm_parameter_image_options.rb', line 65

def self.jsii_properties
  {
    :additional_cache_key => "additionalCacheKey",
    :cached_in_context => "cachedInContext",
    :os => "os",
    :parameter_version => "parameterVersion",
    :user_data => "userData",
  }
end

Instance Method Details

#to_jsiiObject



75
76
77
78
79
80
81
82
83
84
85
# File 'ec2/ssm_parameter_image_options.rb', line 75

def to_jsii
  result = {}
  result.merge!({
    "additionalCacheKey" => @additional_cache_key,
    "cachedInContext" => @cached_in_context,
    "os" => @os,
    "parameterVersion" => @parameter_version,
    "userData" => @user_data,
  })
  result.compact
end