java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:59.728Z") @Stability(Stable) public class CfnDisk extends CfnResource implements IInspectable
A CloudFormation AWS::Lightsail::Disk.

The AWS::Lightsail::Disk resource specifies a disk that can be attached to an Amazon Lightsail instance that is in the same AWS Region and Availability Zone.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lightsail.*;
 CfnDisk cfnDisk = CfnDisk.Builder.create(this, "MyCfnDisk")
         .diskName("diskName")
         .sizeInGb(123)
         // the properties below are optional
         .addOns(List.of(AddOnProperty.builder()
                 .addOnType("addOnType")
                 // the properties below are optional
                 .autoSnapshotAddOnRequest(AutoSnapshotAddOnProperty.builder()
                         .snapshotTimeOfDay("snapshotTimeOfDay")
                         .build())
                 .status("status")
                 .build()))
         .availabilityZone("availabilityZone")
         .location(LocationProperty.builder()
                 .availabilityZone("availabilityZone")
                 .regionName("regionName")
                 .build())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnDisk

      protected CfnDisk(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnDisk

      protected CfnDisk(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnDisk

      @Stability(Stable) public CfnDisk(@NotNull Construct scope, @NotNull String id, @NotNull CfnDiskProps props)
      Create a new AWS::Lightsail::Disk.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAttachedTo

      @Stability(Stable) @NotNull public String getAttrAttachedTo()
      The instance to which the disk is attached.
    • getAttrAttachmentState

      @Stability(Stable) @NotNull public String getAttrAttachmentState()
      (Deprecated) The attachment state of the disk.

      In releases prior to November 14, 2017, this parameter returned attached for system disks in the API response. It is now deprecated, but still included in the response. Use isAttached instead.

    • getAttrDiskArn

      @Stability(Stable) @NotNull public String getAttrDiskArn()
      The Amazon Resource Name (ARN) of the disk.
    • getAttrIops

      @Stability(Stable) @NotNull public Number getAttrIops()
      The input/output operations per second (IOPS) of the disk.
    • getAttrIsAttached

      @Stability(Stable) @NotNull public IResolvable getAttrIsAttached()
      A Boolean value indicating whether the disk is attached to an instance.
    • getAttrLocationAvailabilityZone

      @Stability(Stable) @NotNull public String getAttrLocationAvailabilityZone()
    • getAttrLocationRegionName

      @Stability(Stable) @NotNull public String getAttrLocationRegionName()
    • getAttrPath

      @Stability(Stable) @NotNull public String getAttrPath()
      The path of the disk.
    • getAttrResourceType

      @Stability(Stable) @NotNull public String getAttrResourceType()
      The resource type of the disk (for example, Disk ).
    • getAttrState

      @Stability(Stable) @NotNull public String getAttrState()
      The state of the disk (for example, in-use ).
    • getAttrSupportCode

      @Stability(Stable) @NotNull public String getAttrSupportCode()
      The support code of the disk.

      Include this code in your email to support when you have questions about a disk or another resource in Lightsail . This code helps our support team to look up your Lightsail information.

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      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.

    • getDiskName

      @Stability(Stable) @NotNull public String getDiskName()
      The name of the disk.
    • setDiskName

      @Stability(Stable) public void setDiskName(@NotNull String value)
      The name of the disk.
    • getSizeInGb

      @Stability(Stable) @NotNull public Number getSizeInGb()
      The size of the disk in GB.
    • setSizeInGb

      @Stability(Stable) public void setSizeInGb(@NotNull Number value)
      The size of the disk in GB.
    • getAddOns

      @Stability(Stable) @Nullable public Object getAddOns()
      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.

    • setAddOns

      @Stability(Stable) public void setAddOns(@Nullable IResolvable value)
      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.

    • setAddOns

      @Stability(Stable) public void setAddOns(@Nullable List<Object> value)
      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.

    • getAvailabilityZone

      @Stability(Stable) @Nullable public String getAvailabilityZone()
      The AWS Region and Availability Zone location for the disk (for example, us-east-1a ).
    • setAvailabilityZone

      @Stability(Stable) public void setAvailabilityZone(@Nullable String value)
      The AWS Region and Availability Zone location for the disk (for example, us-east-1a ).
    • getLocation

      @Stability(Stable) @Nullable public Object getLocation()
      AWS::Lightsail::Disk.Location.
    • setLocation

      @Stability(Stable) public void setLocation(@Nullable IResolvable value)
      AWS::Lightsail::Disk.Location.
    • setLocation

      @Stability(Stable) public void setLocation(@Nullable CfnDisk.LocationProperty value)
      AWS::Lightsail::Disk.Location.