aws-cdk-lib.aws_lightsail.CfnInstanceProps

interface CfnInstanceProps

LanguageType name
.NETAmazon.CDK.AWS.Lightsail.CfnInstanceProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslightsail#CfnInstanceProps
Javasoftware.amazon.awscdk.services.lightsail.CfnInstanceProps
Pythonaws_cdk.aws_lightsail.CfnInstanceProps
TypeScript aws-cdk-lib » aws_lightsail » CfnInstanceProps

Properties for defining a CfnInstance.

Example

// 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 cfnInstanceProps: lightsail.CfnInstanceProps = {
  blueprintId: 'blueprintId',
  bundleId: 'bundleId',
  instanceName: 'instanceName',

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

    // the properties below are optional
    autoSnapshotAddOnRequest: {
      snapshotTimeOfDay: 'snapshotTimeOfDay',
    },
    status: 'status',
  }],
  availabilityZone: 'availabilityZone',
  hardware: {
    cpuCount: 123,
    disks: [{
      diskName: 'diskName',
      path: 'path',

      // the properties below are optional
      attachedTo: 'attachedTo',
      attachmentState: 'attachmentState',
      iops: 123,
      isSystemDisk: false,
      sizeInGb: 'sizeInGb',
    }],
    ramSizeInGb: 123,
  },
  keyPairName: 'keyPairName',
  location: {
    availabilityZone: 'availabilityZone',
    regionName: 'regionName',
  },
  networking: {
    ports: [{
      accessDirection: 'accessDirection',
      accessFrom: 'accessFrom',
      accessType: 'accessType',
      cidrListAliases: ['cidrListAliases'],
      cidrs: ['cidrs'],
      commonName: 'commonName',
      fromPort: 123,
      ipv6Cidrs: ['ipv6Cidrs'],
      protocol: 'protocol',
      toPort: 123,
    }],

    // the properties below are optional
    monthlyTransfer: 123,
  },
  state: {
    code: 123,
    name: 'name',
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
  userData: 'userData',
};

Properties

NameTypeDescription
blueprintIdstringThe blueprint ID for the instance (for example, os_amlinux_2016_03 ).
bundleIdstringThe bundle ID for the instance (for example, micro_1_0 ).
instanceNamestringThe name of the instance.
addOns?IResolvable | IResolvable | AddOnProperty[]An array of add-ons for the instance.
availabilityZone?stringThe Availability Zone for the instance.
hardware?IResolvable | HardwarePropertyThe hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.
keyPairName?stringThe name of the key pair to use for the instance.
location?IResolvable | LocationPropertyThe location for the instance, such as the AWS Region and Availability Zone.
networking?IResolvable | NetworkingPropertyThe public ports and the monthly amount of data transfer allocated for the instance.
state?IResolvable | StatePropertyThe status code and the state (for example, running ) of the instance.
tags?CfnTag[]An array of key-value pairs to apply to this resource.
userData?stringThe optional launch script for the instance.

blueprintId

Type: string

The blueprint ID for the instance (for example, os_amlinux_2016_03 ).


bundleId

Type: string

The bundle ID for the instance (for example, micro_1_0 ).


instanceName

Type: string

The name of the instance.


addOns?

Type: IResolvable | IResolvable | AddOnProperty[] (optional)

An array of add-ons for the instance.

If the instance has an add-on enabled when performing a delete instance request, the add-on is automatically disabled before the instance is deleted.


availabilityZone?

Type: string (optional)

The Availability Zone for the instance.


hardware?

Type: IResolvable | HardwareProperty (optional)

The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.

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.


keyPairName?

Type: string (optional)

The name of the key pair to use for the instance.

If no key pair name is specified, the Regional Lightsail default key pair is used.


location?

Type: IResolvable | LocationProperty (optional)

The location for the instance, such as the AWS Region and Availability Zone.

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


networking?

Type: IResolvable | NetworkingProperty (optional)

The public ports and the monthly amount of data transfer allocated for the instance.


state?

Type: IResolvable | StateProperty (optional)

The status code and the state (for example, running ) of the instance.

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


tags?

Type: CfnTag[] (optional)

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.


userData?

Type: string (optional)

The optional launch script for the instance.

Specify a launch script to configure an instance with additional user data. For example, you might want to specify apt-get -y update as a launch script.

Depending on the blueprint of your instance, the command to get software on your instance varies. Amazon Linux and CentOS use yum , Debian and Ubuntu use apt-get , and FreeBSD uses pkg .