interface CfnInstanceProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lightsail.CfnInstanceProps |
Java | software.amazon.awscdk.services.lightsail.CfnInstanceProps |
Python | aws_cdk.aws_lightsail.CfnInstanceProps |
TypeScript | @aws-cdk/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 * as lightsail from '@aws-cdk/aws-lightsail';
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
Name | Type | Description |
---|---|---|
blueprint | string | The blueprint ID for the instance (for example, os_amlinux_2016_03 ). |
bundle | string | The bundle ID for the instance (for example, micro_1_0 ). |
instance | string | The name of the instance. |
add | IResolvable | IResolvable | Add [] | An array of add-ons for the instance. |
availability | string | The Availability Zone for the instance. |
hardware? | IResolvable | Hardware | The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM. |
key | string | The name of the key pair to use for the instance. |
location? | IResolvable | Location | The location for the instance, such as the AWS Region and Availability Zone. |
networking? | IResolvable | Networking | The public ports and the monthly amount of data transfer allocated for the instance. |
state? | IResolvable | State | The status code and the state (for example, running ) of the instance. |
tags? | Cfn [] | An array of key-value pairs to apply to this resource. |
user | string | The 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
|
Add
[]
(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
|
Hardware
(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
|
Location
(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
|
Networking
(optional)
The public ports and the monthly amount of data transfer allocated for the instance.
state?
Type:
IResolvable
|
State
(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:
Cfn
[]
(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
ofTags
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 useapt-get
, and FreeBSD usespkg
.