Class: AWSCDK::EC2::WindowsImage
- Inherits:
-
GenericSSMParameterImage
- Object
- GenericSSMParameterImage
- AWSCDK::EC2::WindowsImage
- Defined in:
- ec2/windows_image.rb
Overview
Select the latest version of the indicated Windows version.
This Machine Image automatically updates to the latest version on every deployment. Be aware this will cause your instances to be replaced when a new version of the image becomes available. Do not store stateful information on the instance if you are using this image.
The AMI ID is selected using the values published to the SSM parameter store.
Class Method Summary collapse
Instance Method Summary collapse
-
#get_image(scope) ⇒ AWSCDK::EC2::MachineImageConfig
Return the image to use in the given context.
-
#initialize(version, props = nil) ⇒ WindowsImage
constructor
A new instance of WindowsImage.
-
#parameter_name ⇒ String
Name of the SSM parameter we're looking up.
Constructor Details
#initialize(version, props = nil) ⇒ WindowsImage
Returns a new instance of WindowsImage.
19 20 21 22 23 24 |
# File 'ec2/windows_image.rb', line 19 def initialize(version, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::EC2::WindowsImageProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLldpbmRvd3NWZXJzaW9uIn0=")), "version") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLldpbmRvd3NJbWFnZVByb3BzIn0=")), "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(version, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
26 27 28 29 30 31 |
# File 'ec2/windows_image.rb', line 26 def self.jsii_overridable_methods { :parameter_name => { kind: :property, name: "parameterName", is_optional: false }, :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.
44 45 46 47 |
# File 'ec2/windows_image.rb', line 44 def get_image(scope) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") jsii_call_method("getImage", [scope]) end |
#parameter_name ⇒ String
Name of the SSM parameter we're looking up.
36 37 38 |
# File 'ec2/windows_image.rb', line 36 def parameter_name() jsii_get_property("parameterName") end |