CfnInstanceProps Struct
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: {
gbPerMonthAllocated: 'gbPerMonthAllocated',
},
},
state: {
code: 123,
name: 'name',
},
tags: [{
key: 'key',
value: 'value',
}],
userData: 'userData',
};
Properties
addOnsIResolvable | IResolvable | CfnInstance.AddOnProperty[]add_onstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AddOnProperty]]]addOnsIResolvableAddOnsIResolvableAddOnsinterface{}#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.
availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*string#hardwareIResolvable | CfnInstance.HardwarePropertyhardwaretyping.Union[IResolvable, HardwareProperty]hardwareIResolvableHardwareIResolvableHardwareinterface{}#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.
If no key pair name is specified, the Regional Lightsail default key pair is used.
locationIResolvable | CfnInstance.LocationPropertylocationtyping.Union[IResolvable, LocationProperty]locationIResolvableLocationIResolvableLocationinterface{}#The
Locationproperty is read-only and should not be specified in a create instance or update instance request.
networkingIResolvable | CfnInstance.NetworkingPropertynetworkingtyping.Union[IResolvable, NetworkingProperty]networkingIResolvableNetworkingIResolvableNetworkinginterface{}#stateIResolvable | CfnInstance.StatePropertystatetyping.Union[IResolvable, StateProperty]stateIResolvableStateIResolvableStateinterface{}#The
Stateproperty is read-only and should not be specified in a create instance or update instance request.
For more information, see Tag in the AWS CloudFormation User Guide .
The
ValueofTagsis optional for Lightsail resources.
notes
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 useapt-get, and FreeBSD usespkg.