Class: AWSCDK::EC2::GenericWindowsImage

Inherits:
Jsii::Object
  • Object
show all
Includes:
IMachineImage
Defined in:
ec2/generic_windows_image.rb

Overview

Construct a Windows machine image from an AMI map.

Allows you to create a generic Windows EC2 , manually specify an AMI map.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ami_map, props = nil) ⇒ GenericWindowsImage

Returns a new instance of GenericWindowsImage.

Parameters:



13
14
15
16
17
18
# File 'ec2/generic_windows_image.rb', line 13

def initialize(ami_map, props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::EC2::GenericWindowsImageProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(ami_map, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "amiMap")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkdlbmVyaWNXaW5kb3dzSW1hZ2VQcm9wcyJ9")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(ami_map, props)
end

Class Method Details

.jsii_overridable_methodsObject



20
21
22
23
24
# File 'ec2/generic_windows_image.rb', line 20

def self.jsii_overridable_methods
  {
    :get_image => { kind: :method, name: "getImage", is_optional: false },
  }
end

Instance Method Details

#get_image(scope) ⇒ AWSCDK::EC2::MachineImageConfig

Return the image to use in the given context.

Parameters:

  • scope (Constructs::Construct)

Returns:



30
31
32
33
# File 'ec2/generic_windows_image.rb', line 30

def get_image(scope)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  jsii_call_method("getImage", [scope])
end