Class: Elbas::AWS::LaunchTemplate
- Defined in:
- lib/elbas/aws/launch_template.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(id, name, version) ⇒ LaunchTemplate
constructor
A new instance of LaunchTemplate.
- #update(ami) ⇒ Object
Methods inherited from Base
#aws_access_key, #aws_client, aws_client, #aws_credentials, #aws_region, #aws_secret_key
Constructor Details
#initialize(id, name, version) ⇒ LaunchTemplate
Returns a new instance of LaunchTemplate.
6 7 8 9 10 |
# File 'lib/elbas/aws/launch_template.rb', line 6 def initialize(id, name, version) @id = id @name = name @version = version end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/elbas/aws/launch_template.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/elbas/aws/launch_template.rb', line 4 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
4 5 6 |
# File 'lib/elbas/aws/launch_template.rb', line 4 def version @version end |
Instance Method Details
#update(ami) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/elbas/aws/launch_template.rb', line 12 def update(ami) latest = aws_client.create_launch_template_version({ launch_template_data: { image_id: ami.id }, launch_template_id: self.id, source_version: self.version }).launch_template_version self.class.new( latest&.launch_template_id, latest&.launch_template_name, latest&.version_number ) end |