Class: AWSCDK::Lightsail::CfnDiskProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lightsail/cfn_disk_props.rb

Overview

Properties for defining a CfnDisk.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(disk_name:, size_in_gb:, add_ons: nil, availability_zone: nil, location: nil, tags: nil) ⇒ CfnDiskProps

Returns a new instance of CfnDiskProps.

Parameters:



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lightsail/cfn_disk_props.rb', line 15

def initialize(disk_name:, size_in_gb:, add_ons: nil, availability_zone: nil, location: nil, tags: nil)
  @disk_name = disk_name
  Jsii::Type.check_type(@disk_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "diskName")
  @size_in_gb = size_in_gb
  Jsii::Type.check_type(@size_in_gb, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "sizeInGb")
  @add_ons = add_ons
  Jsii::Type.check_type(@add_ons, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGlnaHRzYWlsLkNmbkRpc2suQWRkT25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "addOns") unless @add_ons.nil?
  @availability_zone = availability_zone
  Jsii::Type.check_type(@availability_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZone") unless @availability_zone.nil?
  @location = location.is_a?(Hash) ? ::AWSCDK::Lightsail::CfnDisk::LocationProperty.new(**location.transform_keys(&:to_sym)) : location
  Jsii::Type.check_type(@location, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19saWdodHNhaWwuQ2ZuRGlzay5Mb2NhdGlvblByb3BlcnR5In1dfX0=")), "location") unless @location.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#add_onsAWSCDK::IResolvable, ... (readonly)

An array of add-ons for the disk.

If the disk has an add-on enabled when performing a delete disk request, the add-on is automatically disabled before the disk is deleted.



46
47
48
# File 'lightsail/cfn_disk_props.rb', line 46

def add_ons
  @add_ons
end

#availability_zoneString? (readonly)

The AWS Region and Availability Zone location for the disk (for example, us-east-1a ).



51
52
53
# File 'lightsail/cfn_disk_props.rb', line 51

def availability_zone
  @availability_zone
end

#disk_nameString (readonly)

The name of the disk.



34
35
36
# File 'lightsail/cfn_disk_props.rb', line 34

def disk_name
  @disk_name
end

#locationAWSCDK::IResolvable, ... (readonly)

The AWS Region and Availability Zone where the disk is located.



56
57
58
# File 'lightsail/cfn_disk_props.rb', line 56

def location
  @location
end

#size_in_gbNumeric (readonly)

The size of the disk in GB.



39
40
41
# File 'lightsail/cfn_disk_props.rb', line 39

def size_in_gb
  @size_in_gb
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

An array of key-value pairs to apply to this resource.

For more information, see Tag in the AWS CloudFormation User Guide .

The Value of Tags is optional for Lightsail resources.



65
66
67
# File 'lightsail/cfn_disk_props.rb', line 65

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



67
68
69
70
71
72
73
74
75
76
# File 'lightsail/cfn_disk_props.rb', line 67

def self.jsii_properties
  {
    :disk_name => "diskName",
    :size_in_gb => "sizeInGb",
    :add_ons => "addOns",
    :availability_zone => "availabilityZone",
    :location => "location",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



78
79
80
81
82
83
84
85
86
87
88
89
# File 'lightsail/cfn_disk_props.rb', line 78

def to_jsii
  result = {}
  result.merge!({
    "diskName" => @disk_name,
    "sizeInGb" => @size_in_gb,
    "addOns" => @add_ons,
    "availabilityZone" => @availability_zone,
    "location" => @location,
    "tags" => @tags,
  })
  result.compact
end