CfnInstance

class aws_cdk.aws_lightsail.CfnInstance(scope, id, *, 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: CfnResource

A CloudFormation AWS::Lightsail::Instance.

The AWS::Lightsail::Instance resource specifies an Amazon Lightsail instance.

CloudformationResource:

AWS::Lightsail::Instance

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 = lightsail.CfnInstance(self, "MyCfnInstance",
    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"
)

Create a new AWS::Lightsail::Instance.

Parameters:
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • 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 .

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters:

path (str) – The path of the value to delete.

Return type:

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type:

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters:

property_path (str) – The path to the property.

Return type:

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type:

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type:

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:

attribute_name (str) – The name of the attribute.

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type:

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters:

new_logical_id (str) – The new logical ID to use for this stack element.

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Returns:

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::Lightsail::Instance'
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

attr_hardware_cpu_count

The number of vCPUs the instance has.

CloudformationAttribute:

Hardware.CpuCount

attr_hardware_ram_size_in_gb

The amount of RAM in GB on the instance (for example, 1.0 ).

CloudformationAttribute:

Hardware.RamSizeInGb

attr_instance_arn

The Amazon Resource Name (ARN) of the instance (for example, arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE ).

CloudformationAttribute:

InstanceArn

attr_is_static_ip

A Boolean value indicating whether the instance has a static IP assigned to it.

CloudformationAttribute:

IsStaticIp

attr_location_availability_zone

The AWS Region and Availability Zone where the instance is located.

CloudformationAttribute:

Location.AvailabilityZone

attr_location_region_name

The AWS Region of the instance.

CloudformationAttribute:

Location.RegionName

attr_networking_monthly_transfer_gb_per_month_allocated

The amount of allocated monthly data transfer (in GB) for an instance.

CloudformationAttribute:

Networking.MonthlyTransfer.GbPerMonthAllocated

attr_private_ip_address

The private IP address of the instance.

CloudformationAttribute:

PrivateIpAddress

attr_public_ip_address

The public IP address of the instance.

CloudformationAttribute:

PublicIpAddress

attr_resource_type

The resource type of the instance (for example, Instance ).

CloudformationAttribute:

ResourceType

attr_ssh_key_name

The name of the SSH key pair used by the instance.

CloudformationAttribute:

SshKeyName

attr_state_code

The status code of the instance.

CloudformationAttribute:

State.Code

attr_state_name

The state of the instance (for example, running or pending ).

CloudformationAttribute:

State.Name

attr_support_code

The support code of the instance.

Include this code in your email to support when you have questions about an instance or another resource in Lightsail . This code helps our support team to look up your Lightsail information.

CloudformationAttribute:

SupportCode

attr_user_name

The user name for connecting to the instance (for example, ec2-user ).

CloudformationAttribute:

UserName

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

cfn_options

Options for this resource, such as condition, update policy etc.

cfn_resource_type

AWS resource type.

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

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

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Returns:

the logical ID as a stringified token. This value will only get resolved during synthesis.

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

node

The construct tree node associated with this construct.

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

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

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters:

x (Any) –

Return type:

bool

Returns:

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters:

construct (IConstruct) –

Return type:

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool

AddOnProperty

class CfnInstance.AddOnProperty(*, add_on_type, auto_snapshot_add_on_request=None, status=None)

Bases: object

AddOn is a property of the AWS::Lightsail::Instance resource. It describes the add-ons for an instance.

Parameters:
  • add_on_type (str) – The add-on type (for example, AutoSnapshot ). .. epigraph:: AutoSnapshot is the only add-on that can be enabled for an instance.

  • auto_snapshot_add_on_request (Union[IResolvable, AutoSnapshotAddOnProperty, Dict[str, Any], None]) – The parameters for the automatic snapshot add-on, such as the daily time when an automatic snapshot will be created.

  • status (Optional[str]) – The status of the add-on. Valid Values: Enabled | Disabled

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-addon.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

add_on_property = 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"
)

Attributes

add_on_type

The add-on type (for example, AutoSnapshot ).

AutoSnapshot is the only add-on that can be enabled for an instance.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-addon.html#cfn-lightsail-instance-addon-addontype

auto_snapshot_add_on_request

The parameters for the automatic snapshot add-on, such as the daily time when an automatic snapshot will be created.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-addon.html#cfn-lightsail-instance-addon-autosnapshotaddonrequest

status

The status of the add-on.

Valid Values: Enabled | Disabled

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-addon.html#cfn-lightsail-instance-addon-status

AutoSnapshotAddOnProperty

class CfnInstance.AutoSnapshotAddOnProperty(*, snapshot_time_of_day=None)

Bases: object

AutoSnapshotAddOn is a property of the AddOn property. It describes the automatic snapshot add-on for an instance.

Parameters:

snapshot_time_of_day (Optional[str]) – The daily time when an automatic snapshot will be created. Constraints: - Must be in HH:00 format, and in an hourly increment. - Specified in Coordinated Universal Time (UTC). - The snapshot will be automatically created between the time specified and up to 45 minutes after.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-autosnapshotaddon.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

auto_snapshot_add_on_property = lightsail.CfnInstance.AutoSnapshotAddOnProperty(
    snapshot_time_of_day="snapshotTimeOfDay"
)

Attributes

snapshot_time_of_day

The daily time when an automatic snapshot will be created.

Constraints:

  • Must be in HH:00 format, and in an hourly increment.

  • Specified in Coordinated Universal Time (UTC).

  • The snapshot will be automatically created between the time specified and up to 45 minutes after.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-autosnapshotaddon.html#cfn-lightsail-instance-autosnapshotaddon-snapshottimeofday

DiskProperty

class CfnInstance.DiskProperty(*, disk_name, path, attached_to=None, attachment_state=None, iops=None, is_system_disk=None, size_in_gb=None)

Bases: object

Disk is a property of the Hardware property. It describes a disk attached to an instance.

Parameters:
  • disk_name (str) – The unique name of the disk.

  • path (str) – The disk path.

  • attached_to (Optional[str]) – The resources to which the disk is attached.

  • attachment_state (Optional[str]) – (Deprecated) The attachment state of the disk. .. epigraph:: In releases prior to November 14, 2017, this parameter returned attached for system disks in the API response. It is now deprecated, but still included in the response. Use isAttached instead.

  • iops (Union[int, float, None]) – The input/output operations per second (IOPS) of the disk.

  • is_system_disk (Union[bool, IResolvable, None]) – A Boolean value indicating whether this disk is a system disk (has an operating system loaded on it).

  • size_in_gb (Optional[str]) – The size of the disk in GB.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-disk.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

disk_property = 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"
)

Attributes

attached_to

The resources to which the disk is attached.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-disk.html#cfn-lightsail-instance-disk-attachedto

attachment_state

(Deprecated) The attachment state of the disk.

In releases prior to November 14, 2017, this parameter returned attached for system disks in the API response. It is now deprecated, but still included in the response. Use isAttached instead.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-disk.html#cfn-lightsail-instance-disk-attachmentstate

disk_name

The unique name of the disk.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-disk.html#cfn-lightsail-instance-disk-diskname

iops

The input/output operations per second (IOPS) of the disk.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-disk.html#cfn-lightsail-instance-disk-iops

is_system_disk

A Boolean value indicating whether this disk is a system disk (has an operating system loaded on it).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-disk.html#cfn-lightsail-instance-disk-issystemdisk

path

The disk path.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-disk.html#cfn-lightsail-instance-disk-path

size_in_gb

The size of the disk in GB.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-disk.html#cfn-lightsail-instance-disk-sizeingb

HardwareProperty

class CfnInstance.HardwareProperty(*, cpu_count=None, disks=None, ram_size_in_gb=None)

Bases: object

Hardware is a property of the AWS::Lightsail::Instance resource. It describes the hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.

Parameters:
  • cpu_count (Union[int, float, None]) – The number of vCPUs the instance has. .. epigraph:: The CpuCount property is read-only and should not be specified in a create instance or update instance request.

  • disks (Union[IResolvable, Sequence[Union[IResolvable, DiskProperty, Dict[str, Any]]], None]) – The disks attached to the instance. 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.

  • ram_size_in_gb (Union[int, float, None]) – The amount of RAM in GB on the instance (for example, 1.0 ). .. epigraph:: The RamSizeInGb 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-properties-lightsail-instance-hardware.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

hardware_property = 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
)

Attributes

cpu_count

The number of vCPUs the instance has.

The CpuCount 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-properties-lightsail-instance-hardware.html#cfn-lightsail-instance-hardware-cpucount

disks

The disks attached to the instance.

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-properties-lightsail-instance-hardware.html#cfn-lightsail-instance-hardware-disks

ram_size_in_gb

The amount of RAM in GB on the instance (for example, 1.0 ).

The RamSizeInGb 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-properties-lightsail-instance-hardware.html#cfn-lightsail-instance-hardware-ramsizeingb

LocationProperty

class CfnInstance.LocationProperty(*, availability_zone=None, region_name=None)

Bases: object

Location is a property of the AWS::Lightsail::Instance resource. It describes the location for an instance.

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

  • region_name (Optional[str]) – The name of the AWS Region for the instance.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-location.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

location_property = lightsail.CfnInstance.LocationProperty(
    availability_zone="availabilityZone",
    region_name="regionName"
)

Attributes

availability_zone

The Availability Zone for the instance.

Link:

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

region_name

The name of the AWS Region for the instance.

Link:

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

MonthlyTransferProperty

class CfnInstance.MonthlyTransferProperty(*, gb_per_month_allocated=None)

Bases: object

MonthlyTransfer is a property of the Networking property. It describes the amount of allocated monthly data transfer (in GB) for an instance.

Parameters:

gb_per_month_allocated (Optional[str]) – The amount of allocated monthly data transfer (in GB) for an instance.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-monthlytransfer.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

monthly_transfer_property = lightsail.CfnInstance.MonthlyTransferProperty(
    gb_per_month_allocated="gbPerMonthAllocated"
)

Attributes

gb_per_month_allocated

The amount of allocated monthly data transfer (in GB) for an instance.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-monthlytransfer.html#cfn-lightsail-instance-monthlytransfer-gbpermonthallocated

NetworkingProperty

class CfnInstance.NetworkingProperty(*, ports, monthly_transfer=None)

Bases: object

Networking is a property of the AWS::Lightsail::Instance resource. It describes the public ports and the monthly amount of data transfer allocated for the instance.

Parameters:
  • ports (Union[IResolvable, Sequence[Union[IResolvable, PortProperty, Dict[str, Any]]]]) – An array of ports to open on the instance.

  • monthly_transfer (Union[int, float, None]) – The monthly amount of data transfer, in GB, allocated for the instance.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-networking.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

networking_property = 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
)

Attributes

monthly_transfer

The monthly amount of data transfer, in GB, allocated for the instance.

ports

An array of ports to open on the instance.

Link:

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

PortProperty

class CfnInstance.PortProperty(*, access_direction=None, access_from=None, access_type=None, cidr_list_aliases=None, cidrs=None, common_name=None, from_port=None, ipv6_cidrs=None, protocol=None, to_port=None)

Bases: object

Port is a property of the Networking property. It describes information about ports for an instance.

Parameters:
  • access_direction (Optional[str]) – The access direction ( inbound or outbound ). .. epigraph:: Lightsail currently supports only inbound access direction.

  • access_from (Optional[str]) – The location from which access is allowed. For example, Anywhere (0.0.0.0/0) , or Custom if a specific IP address or range of IP addresses is allowed.

  • access_type (Optional[str]) – The type of access ( Public or Private ).

  • cidr_list_aliases (Optional[Sequence[str]]) – An alias that defines access for a preconfigured range of IP addresses. The only alias currently supported is lightsail-connect , which allows IP addresses of the browser-based RDP/SSH client in the Lightsail console to connect to your instance.

  • cidrs (Optional[Sequence[str]]) – The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol. .. epigraph:: The ipv6Cidrs parameter lists the IPv6 addresses that are allowed to connect to an instance. Examples: - To allow the IP address 192.0.2.44 , specify 192.0.2.44 or 192.0.2.44/32 . - To allow the IP addresses 192.0.2.0 to 192.0.2.255 , specify 192.0.2.0/24 .

  • common_name (Optional[str]) – The common name of the port information.

  • from_port (Union[int, float, None]) – The first port in a range of open ports on an instance. Allowed ports: - TCP and UDP - 0 to 65535 - ICMP - The ICMP type for IPv4 addresses. For example, specify 8 as the fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping. - ICMPv6 - The ICMP type for IPv6 addresses. For example, specify 128 as the fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code).

  • ipv6_cidrs (Optional[Sequence[str]]) – The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol. Only devices with an IPv6 address can connect to an instance through IPv6; otherwise, IPv4 should be used. .. epigraph:: The cidrs parameter lists the IPv4 addresses that are allowed to connect to an instance.

  • protocol (Optional[str]) – The IP protocol name. The name can be one of the following: - tcp - Transmission Control Protocol (TCP) provides reliable, ordered, and error-checked delivery of streamed data between applications running on hosts communicating by an IP network. If you have an application that doesn’t require reliable data stream service, use UDP instead. - all - All transport layer protocol types. - udp - With User Datagram Protocol (UDP), computer applications can send messages (or datagrams) to other hosts on an Internet Protocol (IP) network. Prior communications are not required to set up transmission channels or data paths. Applications that don’t require reliable data stream service can use UDP, which provides a connectionless datagram service that emphasizes reduced latency over reliability. If you do require reliable data stream service, use TCP instead. - icmp - Internet Control Message Protocol (ICMP) is used to send error messages and operational information indicating success or failure when communicating with an instance. For example, an error is indicated when an instance could not be reached. When you specify icmp as the protocol , you must specify the ICMP type using the fromPort parameter, and ICMP code using the toPort parameter.

  • to_port (Union[int, float, None]) – The last port in a range of open ports on an instance. Allowed ports: - TCP and UDP - 0 to 65535 - ICMP - The ICMP code for IPv4 addresses. For example, specify 8 as the fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping. - ICMPv6 - The ICMP code for IPv6 addresses. For example, specify 128 as the fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.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

port_property = 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
)

Attributes

access_direction

The access direction ( inbound or outbound ).

Lightsail currently supports only inbound access direction.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-accessdirection

access_from

The location from which access is allowed.

For example, Anywhere (0.0.0.0/0) , or Custom if a specific IP address or range of IP addresses is allowed.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-accessfrom

access_type

The type of access ( Public or Private ).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-accesstype

cidr_list_aliases

An alias that defines access for a preconfigured range of IP addresses.

The only alias currently supported is lightsail-connect , which allows IP addresses of the browser-based RDP/SSH client in the Lightsail console to connect to your instance.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-cidrlistaliases

cidrs

The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol.

The ipv6Cidrs parameter lists the IPv6 addresses that are allowed to connect to an instance.

Examples:

  • To allow the IP address 192.0.2.44 , specify 192.0.2.44 or 192.0.2.44/32 .

  • To allow the IP addresses 192.0.2.0 to 192.0.2.255 , specify 192.0.2.0/24 .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-cidrs

common_name

The common name of the port information.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-commonname

from_port

The first port in a range of open ports on an instance.

Allowed ports:

  • TCP and UDP - 0 to 65535

  • ICMP - The ICMP type for IPv4 addresses. For example, specify 8 as the fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping.

  • ICMPv6 - The ICMP type for IPv6 addresses. For example, specify 128 as the fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-fromport

ipv6_cidrs

The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are allowed to connect to an instance through the ports, and the protocol.

Only devices with an IPv6 address can connect to an instance through IPv6; otherwise, IPv4 should be used. .. epigraph:

The ``cidrs`` parameter lists the IPv4 addresses that are allowed to connect to an instance.
Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-ipv6cidrs

protocol

The IP protocol name.

The name can be one of the following:

  • tcp - Transmission Control Protocol (TCP) provides reliable, ordered, and error-checked delivery of streamed data between applications running on hosts communicating by an IP network. If you have an application that doesn’t require reliable data stream service, use UDP instead.

  • all - All transport layer protocol types.

  • udp - With User Datagram Protocol (UDP), computer applications can send messages (or datagrams) to other hosts on an Internet Protocol (IP) network. Prior communications are not required to set up transmission channels or data paths. Applications that don’t require reliable data stream service can use UDP, which provides a connectionless datagram service that emphasizes reduced latency over reliability. If you do require reliable data stream service, use TCP instead.

  • icmp - Internet Control Message Protocol (ICMP) is used to send error messages and operational information indicating success or failure when communicating with an instance. For example, an error is indicated when an instance could not be reached. When you specify icmp as the protocol , you must specify the ICMP type using the fromPort parameter, and ICMP code using the toPort parameter.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-protocol

to_port

The last port in a range of open ports on an instance.

Allowed ports:

  • TCP and UDP - 0 to 65535

  • ICMP - The ICMP code for IPv4 addresses. For example, specify 8 as the fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping.

  • ICMPv6 - The ICMP code for IPv6 addresses. For example, specify 128 as the fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-port.html#cfn-lightsail-instance-port-toport

StateProperty

class CfnInstance.StateProperty(*, code=None, name=None)

Bases: object

State is a property of the AWS::Lightsail::Instance resource. It describes the status code and the state (for example, running ) of an instance.

Parameters:
  • code (Union[int, float, None]) – The status code of the instance.

  • name (Optional[str]) – The state of the instance (for example, running or pending ).

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-instance-state.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

state_property = lightsail.CfnInstance.StateProperty(
    code=123,
    name="name"
)

Attributes

code

The status code of the instance.

Link:

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

name

The state of the instance (for example, running or pending ).

Link:

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