Skip to content
v2.278.0

CfnDiskProps ​

Struct External

Properties for defining a CfnDisk.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const cfnDiskProps: lightsail.CfnDiskProps = {
  diskName: 'diskName',
  sizeInGb: 123,

  // the properties below are optional
  addOns: [{
    addOnType: 'addOnType',

    // the properties below are optional
    autoSnapshotAddOnRequest: {
      snapshotTimeOfDay: 'snapshotTimeOfDay',
    },
    status: 'status',
  }],
  availabilityZone: 'availabilityZone',
  location: {
    availabilityZone: 'availabilityZone',
    regionName: 'regionName',
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lightsail as lightsail

cfn_disk_props = lightsail.CfnDiskProps(
    disk_name="diskName",
    size_in_gb=123,

    # the properties below are optional
    add_ons=[lightsail.CfnDisk.AddOnProperty(
        add_on_type="addOnType",

        # the properties below are optional
        auto_snapshot_add_on_request=lightsail.CfnDisk.AutoSnapshotAddOnProperty(
            snapshot_time_of_day="snapshotTimeOfDay"
        ),
        status="status"
    )],
    availability_zone="availabilityZone",
    location=lightsail.CfnDisk.LocationProperty(
        availability_zone="availabilityZone",
        region_name="regionName"
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
java
// 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.*;

CfnDiskProps cfnDiskProps = CfnDiskProps.builder()
        .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();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lightsail;

var cfnDiskProps = new CfnDiskProps {
    DiskName = "diskName",
    SizeInGb = 123,

    // the properties below are optional
    AddOns = new [] { new AddOnProperty {
        AddOnType = "addOnType",

        // the properties below are optional
        AutoSnapshotAddOnRequest = new AutoSnapshotAddOnProperty {
            SnapshotTimeOfDay = "snapshotTimeOfDay"
        },
        Status = "status"
    } },
    AvailabilityZone = "availabilityZone",
    Location = new LocationProperty {
        AvailabilityZone = "availabilityZone",
        RegionName = "regionName"
    },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDiskProps := &CfnDiskProps{
	DiskName: jsii.String("diskName"),
	SizeInGb: jsii.Number(123),

	// the properties below are optional
	AddOns: []interface{}{
		&AddOnProperty{
			AddOnType: jsii.String("addOnType"),

			// the properties below are optional
			AutoSnapshotAddOnRequest: &AutoSnapshotAddOnProperty{
				SnapshotTimeOfDay: jsii.String("snapshotTimeOfDay"),
			},
			Status: jsii.String("status"),
		},
	},
	AvailabilityZone: jsii.String("availabilityZone"),
	Location: &LocationProperty{
		AvailabilityZone: jsii.String("availabilityZone"),
		RegionName: jsii.String("regionName"),
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

addOnsoptionalIResolvable | IResolvable | CfnDisk.AddOnProperty[]add_onsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AddOnProperty]]]addOnsoptionalIResolvableAddOnsoptionalIResolvableAddOnsoptionalinterface{} #
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.

availabilityZoneoptionalstringavailability_zoneoptionalstravailabilityZoneoptionalStringAvailabilityZoneoptionalstringAvailabilityZoneoptional*string #
The AWS Region and Availability Zone location for the disk (for example, `us-east-1a` ).
diskNamestringdisk_namestrdiskNameStringDiskNamestringDiskName*string required #
The name of the disk.
locationoptionalIResolvable | CfnDisk.LocationPropertylocationoptionaltyping.Union[IResolvable, LocationProperty]locationoptionalIResolvableLocationoptionalIResolvableLocationoptionalinterface{} #
The AWS Region and Availability Zone where the disk is located.
sizeInGbnumbersize_in_gbint | floatsizeInGbNumberSizeInGbdoubleSizeInGb*float64 required #
The size of the disk in GB.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
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.