AWS::Lightsail::InstanceThe `AWS::Lightsail::Instance` resource specifies an Amazon Lightsail instance.
import { CfnInstance } from 'aws-cdk-lib/aws-lightsail';Or use the module namespace:
import * as lightsail from 'aws-cdk-lib/aws-lightsail';
// lightsail.CfnInstanceConfiguration passed to the constructor as CfnInstanceProps.
blueprintIdRequiredstringThe blueprint ID for the instance (for example, `os_amlinux_2016_03` ).
bundleIdRequiredstringThe bundle ID for the instance (for example, `micro_1_0` ).
instanceNameRequiredstringThe name of the instance.
addOnsOptionalIResolvable | IResolvable | AddOnProperty[]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.
availabilityZoneOptionalstringThe Availability Zone for the instance.
hardwareOptionalIResolvable | HardwarePropertyThe 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.
keyPairNameOptionalstringThe 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.
locationOptionalIResolvable | LocationPropertyThe 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.
networkingOptionalIResolvable | NetworkingPropertyThe public ports and the monthly amount of data transfer allocated for the instance.
stateOptionalIResolvable | StatePropertyThe 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.
tagsOptionalCfnTag[]An array of key-value pairs to apply to this resource. For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) in the *AWS CloudFormation User Guide* . > The `Value` of `Tags` is optional for Lightsail resources.
userDataOptionalstringThe 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` .
This L1 construct maps directly to the following CloudFormation resource type.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-lightsailAWS::Lightsail::Instance