Class: AWSCDK::EC2::VolumeAttributes

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/volume_attributes.rb

Overview

Attributes required to import an existing EBS Volume into the Stack.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(availability_zone:, volume_id:, encryption_key: nil) ⇒ VolumeAttributes

Returns a new instance of VolumeAttributes.

Parameters:

  • availability_zone (String)

    The availability zone that the EBS Volume is contained within (ex: us-west-2a).

  • volume_id (String)

    The EBS Volume's ID.

  • encryption_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    The customer-managed encryption key that is used to encrypt the Volume.



10
11
12
13
14
15
16
17
# File 'ec2/volume_attributes.rb', line 10

def initialize(availability_zone:, volume_id:, encryption_key: nil)
  @availability_zone = availability_zone
  Jsii::Type.check_type(@availability_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZone")
  @volume_id = volume_id
  Jsii::Type.check_type(@volume_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "volumeId")
  @encryption_key = encryption_key
  Jsii::Type.check_type(@encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "encryptionKey") unless @encryption_key.nil?
end

Instance Attribute Details

#availability_zoneString (readonly)

The availability zone that the EBS Volume is contained within (ex: us-west-2a).

Returns:

  • (String)


22
23
24
# File 'ec2/volume_attributes.rb', line 22

def availability_zone
  @availability_zone
end

#encryption_keyAWSCDK::KMS::IKey? (readonly)

Note:

Default: None -- The EBS Volume is not using a customer-managed KMS key for encryption.

The customer-managed encryption key that is used to encrypt the Volume.

Returns:



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

def encryption_key
  @encryption_key
end

#volume_idString (readonly)

The EBS Volume's ID.

Returns:

  • (String)


26
27
28
# File 'ec2/volume_attributes.rb', line 26

def volume_id
  @volume_id
end

Class Method Details

.jsii_propertiesObject



33
34
35
36
37
38
39
# File 'ec2/volume_attributes.rb', line 33

def self.jsii_properties
  {
    :availability_zone => "availabilityZone",
    :volume_id => "volumeId",
    :encryption_key => "encryptionKey",
  }
end

Instance Method Details

#to_jsiiObject



41
42
43
44
45
46
47
48
49
# File 'ec2/volume_attributes.rb', line 41

def to_jsii
  result = {}
  result.merge!({
    "availabilityZone" => @availability_zone,
    "volumeId" => @volume_id,
    "encryptionKey" => @encryption_key,
  })
  result.compact
end