Skip to content
v2.278.0

HardwareProperty Struct ​

Hardware is a property of the AWS::Lightsail::Instance resource. It describes the hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.

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 hardwareProperty: lightsail.CfnInstance.HardwareProperty = {
  cpuCount: 123,
  disks: [{
    diskName: 'diskName',
    path: 'path',

    // the properties below are optional
    attachedTo: 'attachedTo',
    attachmentState: 'attachmentState',
    iops: 123,
    isSystemDisk: false,
    sizeInGb: 'sizeInGb',
  }],
  ramSizeInGb: 123,
};
python
# 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

hardware_property = lightsail.CfnInstance.HardwareProperty(
    cpu_count=123,
    disks=[lightsail.CfnInstance.DiskProperty(
        disk_name="diskName",
        path="path",

        # the properties below are optional
        attached_to="attachedTo",
        attachment_state="attachmentState",
        iops=123,
        is_system_disk=False,
        size_in_gb="sizeInGb"
    )],
    ram_size_in_gb=123
)
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.*;

HardwareProperty hardwareProperty = HardwareProperty.builder()
        .cpuCount(123)
        .disks(List.of(DiskProperty.builder()
                .diskName("diskName")
                .path("path")

                // the properties below are optional
                .attachedTo("attachedTo")
                .attachmentState("attachmentState")
                .iops(123)
                .isSystemDisk(false)
                .sizeInGb("sizeInGb")
                .build()))
        .ramSizeInGb(123)
        .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 hardwareProperty = new HardwareProperty {
    CpuCount = 123,
    Disks = new [] { new DiskProperty {
        DiskName = "diskName",
        Path = "path",

        // the properties below are optional
        AttachedTo = "attachedTo",
        AttachmentState = "attachmentState",
        Iops = 123,
        IsSystemDisk = false,
        SizeInGb = "sizeInGb"
    } },
    RamSizeInGb = 123
};
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"

hardwareProperty := &HardwareProperty{
	CpuCount: jsii.Number(123),
	Disks: []interface{}{
		&DiskProperty{
			DiskName: jsii.String("diskName"),
			Path: jsii.String("path"),

			// the properties below are optional
			AttachedTo: jsii.String("attachedTo"),
			AttachmentState: jsii.String("attachmentState"),
			Iops: jsii.Number(123),
			IsSystemDisk: jsii.Boolean(false),
			SizeInGb: jsii.String("sizeInGb"),
		},
	},
	RamSizeInGb: jsii.Number(123),
}

Properties ​

cpuCountoptionalnumbercpu_countoptionalint | floatcpuCountoptionalNumberCpuCountoptionaldoubleCpuCountoptional*float64 #
The number of vCPUs the instance has.

The CpuCount property is read-only and should not be specified in a create instance or update instance request.

disksoptionalIResolvable | IResolvable | CfnInstance.DiskProperty[]disksoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, DiskProperty]]]disksoptionalIResolvableDisksoptionalIResolvableDisksoptionalinterface{} #
The disks attached to the instance.

The instance restarts when performing an attach disk or detach disk request. This resets the public IP address of your instance if a static IP isn't attached to it.

ramSizeInGboptionalnumberram_size_in_gboptionalint | floatramSizeInGboptionalNumberRamSizeInGboptionaldoubleRamSizeInGboptional*float64 #
The amount of RAM in GB on the instance (for example, `1.0` ).

The RamSizeInGb property is read-only and should not be specified in a create instance or update instance request.