Class: AWSCDK::ECS::ECSOptimizedImage
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::ECS::ECSOptimizedImage
- Includes:
- AWSCDK::EC2::IMachineImage
- Defined in:
- ecs/ecs_optimized_image.rb
Overview
Construct a Linux or Windows machine image from the latest ECS Optimized AMI published in SSM.
Class Method Summary collapse
-
.amazon_linux(options = nil) ⇒ AWSCDK::ECS::ECSOptimizedImage
Construct an Amazon Linux AMI image from the latest ECS Optimized AMI published in SSM.
-
.amazon_linux2(hardware_type = nil, options = nil) ⇒ AWSCDK::ECS::ECSOptimizedImage
Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM.
-
.amazon_linux2023(hardware_type = nil, options = nil) ⇒ AWSCDK::ECS::ECSOptimizedImage
Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM.
- .jsii_overridable_methods ⇒ Object
-
.windows(windows_version, options = nil) ⇒ AWSCDK::ECS::ECSOptimizedImage
Construct a Windows image from the latest ECS Optimized AMI published in SSM.
Instance Method Summary collapse
-
#get_image(scope) ⇒ AWSCDK::EC2::MachineImageConfig
Return the correct image.
-
#initialize(*args) ⇒ ECSOptimizedImage
constructor
A new instance of ECSOptimizedImage.
Constructor Details
#initialize(*args) ⇒ ECSOptimizedImage
Returns a new instance of ECSOptimizedImage.
9 10 11 |
# File 'ecs/ecs_optimized_image.rb', line 9 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_ecs.EcsOptimizedImage does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.amazon_linux(options = nil) ⇒ AWSCDK::ECS::ECSOptimizedImage
Construct an Amazon Linux AMI image from the latest ECS Optimized AMI published in SSM.
23 24 25 26 27 |
# File 'ecs/ecs_optimized_image.rb', line 23 def self.amazon_linux( = nil) = .is_a?(Hash) ? ::AWSCDK::ECS::ECSOptimizedImageOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkVjc09wdGltaXplZEltYWdlT3B0aW9ucyJ9")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.EcsOptimizedImage", "amazonLinux", []) end |
.amazon_linux2(hardware_type = nil, options = nil) ⇒ AWSCDK::ECS::ECSOptimizedImage
Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM.
34 35 36 37 38 39 |
# File 'ecs/ecs_optimized_image.rb', line 34 def self.amazon_linux2(hardware_type = nil, = nil) Jsii::Type.check_type(hardware_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkFtaUhhcmR3YXJlVHlwZSJ9")), "hardwareType") unless hardware_type.nil? = .is_a?(Hash) ? ::AWSCDK::ECS::ECSOptimizedImageOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkVjc09wdGltaXplZEltYWdlT3B0aW9ucyJ9")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.EcsOptimizedImage", "amazonLinux2", [hardware_type, ]) end |
.amazon_linux2023(hardware_type = nil, options = nil) ⇒ AWSCDK::ECS::ECSOptimizedImage
Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM.
46 47 48 49 50 51 |
# File 'ecs/ecs_optimized_image.rb', line 46 def self.amazon_linux2023(hardware_type = nil, = nil) Jsii::Type.check_type(hardware_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkFtaUhhcmR3YXJlVHlwZSJ9")), "hardwareType") unless hardware_type.nil? = .is_a?(Hash) ? ::AWSCDK::ECS::ECSOptimizedImageOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkVjc09wdGltaXplZEltYWdlT3B0aW9ucyJ9")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.EcsOptimizedImage", "amazonLinux2023", [hardware_type, ]) end |
.jsii_overridable_methods ⇒ Object
13 14 15 16 17 |
# File 'ecs/ecs_optimized_image.rb', line 13 def self.jsii_overridable_methods { :get_image => { kind: :method, name: "getImage", is_optional: false }, } end |
.windows(windows_version, options = nil) ⇒ AWSCDK::ECS::ECSOptimizedImage
Construct a Windows image from the latest ECS Optimized AMI published in SSM.
58 59 60 61 62 63 |
# File 'ecs/ecs_optimized_image.rb', line 58 def self.windows(windows_version, = nil) Jsii::Type.check_type(windows_version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLldpbmRvd3NPcHRpbWl6ZWRWZXJzaW9uIn0=")), "windowsVersion") = .is_a?(Hash) ? ::AWSCDK::ECS::ECSOptimizedImageOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkVjc09wdGltaXplZEltYWdlT3B0aW9ucyJ9")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ecs.EcsOptimizedImage", "windows", [windows_version, ]) end |
Instance Method Details
#get_image(scope) ⇒ AWSCDK::EC2::MachineImageConfig
Return the correct image.
69 70 71 72 |
# File 'ecs/ecs_optimized_image.rb', line 69 def get_image(scope) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") jsii_call_method("getImage", [scope]) end |