# HardwareProperty

Struct · External

`Hardware` is a property of the [AWS::Lightsail::Instance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html) resource. It describes the hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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:

```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:

```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();
```

C#:

```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:

```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

- `cpuCount`: number — 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.

- `disks`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInstance.DiskProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lightsail.CfnInstance.DiskProperty.html)[] — 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.

- `ramSizeInGb`: number — 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.
