CfnInstancePropsMixin
- class aws_cdk.mixins_preview.aws_lightsail.mixins.CfnInstancePropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::Lightsail::Instanceresource specifies an Amazon Lightsail instance.- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html
- CloudformationResource:
AWS::Lightsail::Instance
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins cfn_instance_props_mixin = lightsail_mixins.CfnInstancePropsMixin(lightsail_mixins.CfnInstanceMixinProps( add_ons=[lightsail_mixins.CfnInstancePropsMixin.AddOnProperty( add_on_type="addOnType", auto_snapshot_add_on_request=lightsail_mixins.CfnInstancePropsMixin.AutoSnapshotAddOnProperty( snapshot_time_of_day="snapshotTimeOfDay" ), status="status" )], availability_zone="availabilityZone", blueprint_id="blueprintId", bundle_id="bundleId", hardware=lightsail_mixins.CfnInstancePropsMixin.HardwareProperty( cpu_count=123, disks=[lightsail_mixins.CfnInstancePropsMixin.DiskProperty( attached_to="attachedTo", attachment_state="attachmentState", disk_name="diskName", iops=123, is_system_disk=False, path="path", size_in_gb="sizeInGb" )], ram_size_in_gb=123 ), instance_name="instanceName", key_pair_name="keyPairName", location=lightsail_mixins.CfnInstancePropsMixin.LocationProperty( availability_zone="availabilityZone", region_name="regionName" ), networking=lightsail_mixins.CfnInstancePropsMixin.NetworkingProperty( monthly_transfer=lightsail_mixins.CfnInstancePropsMixin.MonthlyTransferProperty( gb_per_month_allocated="gbPerMonthAllocated" ), ports=[lightsail_mixins.CfnInstancePropsMixin.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 )] ), state=lightsail_mixins.CfnInstancePropsMixin.StateProperty( code=123, name="name" ), tags=[CfnTag( key="key", value="value" )], user_data="userData" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::Lightsail::Instance.- Parameters:
props (
Union[CfnInstanceMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['addOns', 'availabilityZone', 'blueprintId', 'bundleId', 'hardware', 'instanceName', 'keyPairName', 'location', 'networking', 'state', 'tags', 'userData']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AddOnProperty
- class CfnInstancePropsMixin.AddOnProperty(*, add_on_type=None, auto_snapshot_add_on_request=None, status=None)
Bases:
objectAddOnis a property of the AWS::Lightsail::Instance resource. It describes the add-ons for an instance.- Parameters:
add_on_type (
Optional[str]) – The add-on type (for example,AutoSnapshot). .. epigraph::AutoSnapshotis 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
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins add_on_property = lightsail_mixins.CfnInstancePropsMixin.AddOnProperty( add_on_type="addOnType", auto_snapshot_add_on_request=lightsail_mixins.CfnInstancePropsMixin.AutoSnapshotAddOnProperty( snapshot_time_of_day="snapshotTimeOfDay" ), status="status" )
Attributes
- add_on_type
The add-on type (for example,
AutoSnapshot).AutoSnapshotis the only add-on that can be enabled for an instance.
- 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.
- status
The status of the add-on.
Valid Values:
Enabled|Disabled
AutoSnapshotAddOnProperty
- class CfnInstancePropsMixin.AutoSnapshotAddOnProperty(*, snapshot_time_of_day=None)
Bases:
objectAutoSnapshotAddOnis 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 inHH:00format, 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.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins auto_snapshot_add_on_property = lightsail_mixins.CfnInstancePropsMixin.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:00format, 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.
DiskProperty
- class CfnInstancePropsMixin.DiskProperty(*, attached_to=None, attachment_state=None, disk_name=None, iops=None, is_system_disk=None, path=None, size_in_gb=None)
Bases:
objectDiskis a property of the Hardware property. It describes a disk attached to an instance.- Parameters:
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 returnedattachedfor system disks in the API response. It is now deprecated, but still included in the response. UseisAttachedinstead.disk_name (
Optional[str]) – The unique name of the disk.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).path (
Optional[str]) – The disk path.size_in_gb (
Optional[str]) – The size of the disk in GB.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins disk_property = lightsail_mixins.CfnInstancePropsMixin.DiskProperty( attached_to="attachedTo", attachment_state="attachmentState", disk_name="diskName", iops=123, is_system_disk=False, path="path", size_in_gb="sizeInGb" )
Attributes
- attached_to
The resources to which the disk is attached.
- attachment_state
(Deprecated) The attachment state of the disk.
In releases prior to November 14, 2017, this parameter returned
attachedfor system disks in the API response. It is now deprecated, but still included in the response. UseisAttachedinstead.
- disk_name
The unique name of the disk.
- iops
The input/output operations per second (IOPS) of the disk.
- is_system_disk
A Boolean value indicating whether this disk is a system disk (has an operating system loaded on it).
- path
The disk path.
- size_in_gb
The size of the disk in GB.
HardwareProperty
- class CfnInstancePropsMixin.HardwareProperty(*, cpu_count=None, disks=None, ram_size_in_gb=None)
Bases:
objectHardwareis 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:: TheCpuCountproperty 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:: TheRamSizeInGbproperty is read-only and should not be specified in a create instance or update instance request.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins hardware_property = lightsail_mixins.CfnInstancePropsMixin.HardwareProperty( cpu_count=123, disks=[lightsail_mixins.CfnInstancePropsMixin.DiskProperty( attached_to="attachedTo", attachment_state="attachmentState", disk_name="diskName", iops=123, is_system_disk=False, path="path", size_in_gb="sizeInGb" )], ram_size_in_gb=123 )
Attributes
- cpu_count
The number of vCPUs the instance has.
The
CpuCountproperty is read-only and should not be specified in a create instance or update instance request.
- 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.
- ram_size_in_gb
The amount of RAM in GB on the instance (for example,
1.0).The
RamSizeInGbproperty is read-only and should not be specified in a create instance or update instance request.
LocationProperty
- class CfnInstancePropsMixin.LocationProperty(*, availability_zone=None, region_name=None)
Bases:
objectLocationis 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.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins location_property = lightsail_mixins.CfnInstancePropsMixin.LocationProperty( availability_zone="availabilityZone", region_name="regionName" )
Attributes
- availability_zone
The Availability Zone for the instance.
- region_name
The name of the AWS Region for the instance.
MonthlyTransferProperty
- class CfnInstancePropsMixin.MonthlyTransferProperty(*, gb_per_month_allocated=None)
Bases:
objectMonthlyTransferis 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.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins monthly_transfer_property = lightsail_mixins.CfnInstancePropsMixin.MonthlyTransferProperty( gb_per_month_allocated="gbPerMonthAllocated" )
Attributes
- gb_per_month_allocated
The amount of allocated monthly data transfer (in GB) for an instance.
NetworkingProperty
- class CfnInstancePropsMixin.NetworkingProperty(*, monthly_transfer=None, ports=None)
Bases:
objectNetworkingis 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:
monthly_transfer (
Union[IResolvable,MonthlyTransferProperty,Dict[str,Any],None]) – The monthly amount of data transfer, in GB, allocated for the instance.ports (
Union[IResolvable,Sequence[Union[IResolvable,PortProperty,Dict[str,Any]]],None]) – An array of ports to open on the instance.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins networking_property = lightsail_mixins.CfnInstancePropsMixin.NetworkingProperty( monthly_transfer=lightsail_mixins.CfnInstancePropsMixin.MonthlyTransferProperty( gb_per_month_allocated="gbPerMonthAllocated" ), ports=[lightsail_mixins.CfnInstancePropsMixin.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
- monthly_transfer
The monthly amount of data transfer, in GB, allocated for the instance.
- ports
An array of ports to open on the instance.
PortProperty
- class CfnInstancePropsMixin.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:
objectPortis a property of the Networking property. It describes information about ports for an instance.- Parameters:
access_direction (
Optional[str]) – The access direction (inboundoroutbound). .. epigraph:: Lightsail currently supports onlyinboundaccess direction.access_from (
Optional[str]) – The location from which access is allowed. For example,Anywhere (0.0.0.0/0), orCustomif a specific IP address or range of IP addresses is allowed.access_type (
Optional[str]) – The type of access (PublicorPrivate).cidr_list_aliases (
Optional[Sequence[str]]) – An alias that defines access for a preconfigured range of IP addresses. The only alias currently supported islightsail-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:: Theipv6Cidrsparameter lists the IPv6 addresses that are allowed to connect to an instance. Examples: - To allow the IP address192.0.2.44, specify192.0.2.44or192.0.2.44/32. - To allow the IP addresses192.0.2.0to192.0.2.255, specify192.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 -0to65535- ICMP - The ICMP type for IPv4 addresses. For example, specify8as thefromPort(ICMP type), and-1as thetoPort(ICMP code), to enable ICMP Ping. - ICMPv6 - The ICMP type for IPv6 addresses. For example, specify128as thefromPort(ICMPv6 type), and0astoPort(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:: Thecidrsparameter 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 specifyicmpas theprotocol, you must specify the ICMP type using thefromPortparameter, and ICMP code using thetoPortparameter.to_port (
Union[int,float,None]) – The last port in a range of open ports on an instance. Allowed ports: - TCP and UDP -0to65535- ICMP - The ICMP code for IPv4 addresses. For example, specify8as thefromPort(ICMP type), and-1as thetoPort(ICMP code), to enable ICMP Ping. - ICMPv6 - The ICMP code for IPv6 addresses. For example, specify128as thefromPort(ICMPv6 type), and0astoPort(ICMPv6 code).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins port_property = lightsail_mixins.CfnInstancePropsMixin.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 (
inboundoroutbound).Lightsail currently supports only
inboundaccess direction.
- access_from
The location from which access is allowed.
For example,
Anywhere (0.0.0.0/0), orCustomif a specific IP address or range of IP addresses is allowed.
- access_type
The type of access (
PublicorPrivate).
- 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.
- 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
ipv6Cidrsparameter lists the IPv6 addresses that are allowed to connect to an instance.Examples:
To allow the IP address
192.0.2.44, specify192.0.2.44or192.0.2.44/32.To allow the IP addresses
192.0.2.0to192.0.2.255, specify192.0.2.0/24.
- common_name
The common name of the port information.
- from_port
The first port in a range of open ports on an instance.
Allowed ports:
TCP and UDP -
0to65535ICMP - The ICMP type for IPv4 addresses. For example, specify
8as thefromPort(ICMP type), and-1as thetoPort(ICMP code), to enable ICMP Ping.ICMPv6 - The ICMP type for IPv6 addresses. For example, specify
128as thefromPort(ICMPv6 type), and0astoPort(ICMPv6 code).
- 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.
- 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 specifyicmpas theprotocol, you must specify the ICMP type using thefromPortparameter, and ICMP code using thetoPortparameter.
- to_port
The last port in a range of open ports on an instance.
Allowed ports:
TCP and UDP -
0to65535ICMP - The ICMP code for IPv4 addresses. For example, specify
8as thefromPort(ICMP type), and-1as thetoPort(ICMP code), to enable ICMP Ping.ICMPv6 - The ICMP code for IPv6 addresses. For example, specify
128as thefromPort(ICMPv6 type), and0astoPort(ICMPv6 code).
StateProperty
- class CfnInstancePropsMixin.StateProperty(*, code=None, name=None)
Bases:
objectStateis 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,runningorpending).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins state_property = lightsail_mixins.CfnInstancePropsMixin.StateProperty( code=123, name="name" )
Attributes
- code
The status code of the instance.
- name
The state of the instance (for example,
runningorpending).