CfnInstanceProps

class aws_cdk.aws_lightsail.CfnInstanceProps(*, blueprint_id, bundle_id, instance_name, add_ons=None, availability_zone=None, hardware=None, key_pair_name=None, location=None, networking=None, state=None, tags=None, user_data=None)

Bases: object

Properties for defining a CfnInstance.

Parameters:
  • blueprint_id (str) – The blueprint ID for the instance (for example, os_amlinux_2016_03 ).

  • bundle_id (str) – The bundle ID for the instance (for example, micro_1_0 ).

  • instance_name (str) – The name of the instance.

  • add_ons (Union[IResolvable, Sequence[Union[IResolvable, AddOnProperty, Dict[str, Any]]], None]) – An array of add-ons for the instance. .. epigraph:: 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.

  • availability_zone (Optional[str]) – The Availability Zone for the instance.

  • hardware (Union[IResolvable, HardwareProperty, Dict[str, Any], None]) – The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM. .. epigraph:: 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.

  • key_pair_name (Optional[str]) – 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 (Union[IResolvable, LocationProperty, Dict[str, Any], None]) – The location for the instance, such as the AWS Region and Availability Zone. .. epigraph:: The Location property is read-only and should not be specified in a create instance or update instance request.

  • networking (Union[IResolvable, NetworkingProperty, Dict[str, Any], None]) – The public ports and the monthly amount of data transfer allocated for the instance.

  • state (Union[IResolvable, StateProperty, Dict[str, Any], None]) – The status code and the state (for example, running ) of the instance. .. epigraph:: The State property is read-only and should not be specified in a create instance or update instance request.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – An array of key-value pairs to apply to this resource. For more information, see Tag in the AWS CloudFormation User Guide . .. epigraph:: The Value of Tags is optional for Lightsail resources.

  • user_data (Optional[str]) – 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. .. epigraph:: 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 .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

cfn_instance_props = lightsail.CfnInstanceProps(
    blueprint_id="blueprintId",
    bundle_id="bundleId",
    instance_name="instanceName",

    # the properties below are optional
    add_ons=[lightsail.CfnInstance.AddOnProperty(
        add_on_type="addOnType",

        # the properties below are optional
        auto_snapshot_add_on_request=lightsail.CfnInstance.AutoSnapshotAddOnProperty(
            snapshot_time_of_day="snapshotTimeOfDay"
        ),
        status="status"
    )],
    availability_zone="availabilityZone",
    hardware=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
    ),
    key_pair_name="keyPairName",
    location=lightsail.CfnInstance.LocationProperty(
        availability_zone="availabilityZone",
        region_name="regionName"
    ),
    networking=lightsail.CfnInstance.NetworkingProperty(
        ports=[lightsail.CfnInstance.PortProperty(
            access_direction="accessDirection",
            access_from="accessFrom",
            access_type="accessType",
            cidr_list_aliases=["cidrListAliases"],
            cidrs=["cidrs"],
            common_name="commonName",
            from_port=123,
            ipv6_cidrs=["ipv6Cidrs"],
            protocol="protocol",
            to_port=123
        )],

        # the properties below are optional
        monthly_transfer=123
    ),
    state=lightsail.CfnInstance.StateProperty(
        code=123,
        name="name"
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    user_data="userData"
)

Attributes

add_ons

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-addons

availability_zone

The Availability Zone for the instance.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-availabilityzone

blueprint_id

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-blueprintid

bundle_id

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-bundleid

hardware

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-hardware

instance_name

The name of the instance.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-instancename

key_pair_name

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-keypairname

location

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-location

networking

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

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-networking

state

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.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-state

tags

An array of key-value pairs to apply to this resource.

For more information, see Tag in the AWS CloudFormation User Guide . .. epigraph:

The ``Value`` of ``Tags`` is optional for Lightsail resources.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-tags

user_data

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. .. epigraph:

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

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html#cfn-lightsail-instance-userdata