Class CfnInstance
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.lightsail.CfnInstance
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-15T10:25:01.893Z")
@Stability(Stable)
public class CfnInstance
extends CfnResource
implements IInspectable, ITaggable
The
AWS::Lightsail::Instance
resource specifies an Amazon Lightsail instance.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.lightsail.*; CfnInstance cfnInstance = CfnInstance.Builder.create(this, "MyCfnInstance") .blueprintId("blueprintId") .bundleId("bundleId") .instanceName("instanceName") // the properties below are optional .addOns(List.of(AddOnProperty.builder() .addOnType("addOnType") // the properties below are optional .autoSnapshotAddOnRequest(AutoSnapshotAddOnProperty.builder() .snapshotTimeOfDay("snapshotTimeOfDay") .build()) .status("status") .build())) .availabilityZone("availabilityZone") .hardware(HardwareProperty.builder() .cpuCount(123) .disks(List.of(DiskProperty.builder() .diskName("diskName") .path("path") // the properties below are optional .attachedTo("attachedTo") .attachmentState("attachmentState") .iops(123) .isSystemDisk(false) .sizeInGb("sizeInGb") .build())) .ramSizeInGb(123) .build()) .keyPairName("keyPairName") .location(LocationProperty.builder() .availabilityZone("availabilityZone") .regionName("regionName") .build()) .networking(NetworkingProperty.builder() .ports(List.of(PortProperty.builder() .accessDirection("accessDirection") .accessFrom("accessFrom") .accessType("accessType") .cidrListAliases(List.of("cidrListAliases")) .cidrs(List.of("cidrs")) .commonName("commonName") .fromPort(123) .ipv6Cidrs(List.of("ipv6Cidrs")) .protocol("protocol") .toPort(123) .build())) // the properties below are optional .monthlyTransfer(MonthlyTransferProperty.builder() .gbPerMonthAllocated("gbPerMonthAllocated") .build()) .build()) .state(StateProperty.builder() .code(123) .name("name") .build()) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .userData("userData") .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
AddOn
is a property of the AWS::Lightsail::Instance resource.static interface
AutoSnapshotAddOn
is a property of the AddOn property.static final class
A fluent builder forCfnInstance
.static interface
Disk
is a property of the Hardware property.static interface
Hardware
is a property of the AWS::Lightsail::Instance resource.static interface
Location
is a property of the AWS::Lightsail::Instance resource.static interface
MonthlyTransfer
is a property of the Networking property.static interface
Networking
is a property of the AWS::Lightsail::Instance resource.static interface
Port
is a property of the Networking property.static interface
State
is a property of the AWS::Lightsail::Instance resource.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnInstance
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnInstance
(software.amazon.jsii.JsiiObjectRef objRef) CfnInstance
(software.constructs.Construct scope, String id, CfnInstanceProps props) -
Method Summary
Modifier and TypeMethodDescriptionAn array of add-ons for the instance.The number of vCPUs the instance has.The amount of RAM in GB on the instance (for example,1.0
).The Amazon Resource Name (ARN) of the instance (for example,arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE
).The IPv6 addresses of the instance.A Boolean value indicating whether the instance has a static IP assigned to it.The AWS Region and Availability Zone where the instance is located.The AWS Region of the instance.The amount of allocated monthly data transfer (in GB) for an instance.The private IP address of the instance.The public IP address of the instance.The resource type of the instance (for example,Instance
).The name of the SSH key pair used by the instance.The status code of the instance.The state of the instance (for example,running
orpending
).The support code of the instance.The user name for connecting to the instance (for example,ec2-user
).The Availability Zone for the instance.The blueprint ID for the instance (for example,os_amlinux_2016_03
).The bundle ID for the instance (for example,micro_1_0
).The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.The name of the instance.The name of the key pair to use for the instance.The location for the instance, such as the AWS Region and Availability Zone.The public ports and the monthly amount of data transfer allocated for the instance.getState()
The status code and the state (for example,running
) of the instance.getTags()
Tag Manager which manages the tags for this resource.An array of key-value pairs to apply to this resource.The optional launch script for the instance.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
An array of add-ons for the instance.void
setAddOns
(IResolvable value) An array of add-ons for the instance.void
setAvailabilityZone
(String value) The Availability Zone for the instance.void
setBlueprintId
(String value) The blueprint ID for the instance (for example,os_amlinux_2016_03
).void
setBundleId
(String value) The bundle ID for the instance (for example,micro_1_0
).void
setHardware
(IResolvable value) The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.void
The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.void
setInstanceName
(String value) The name of the instance.void
setKeyPairName
(String value) The name of the key pair to use for the instance.void
setLocation
(IResolvable value) The location for the instance, such as the AWS Region and Availability Zone.void
The location for the instance, such as the AWS Region and Availability Zone.void
setNetworking
(IResolvable value) The public ports and the monthly amount of data transfer allocated for the instance.void
The public ports and the monthly amount of data transfer allocated for the instance.void
setState
(IResolvable value) The status code and the state (for example,running
) of the instance.void
The status code and the state (for example,running
) of the instance.void
setTagsRaw
(List<CfnTag> value) An array of key-value pairs to apply to this resource.void
setUserData
(String value) The optional launch script for the instance.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnInstance
protected CfnInstance(software.amazon.jsii.JsiiObjectRef objRef) -
CfnInstance
protected CfnInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnInstance
@Stability(Stable) public CfnInstance(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnInstanceProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrHardwareCpuCount
The number of vCPUs the instance has. -
getAttrHardwareRamSizeInGb
The amount of RAM in GB on the instance (for example,1.0
). -
getAttrInstanceArn
The Amazon Resource Name (ARN) of the instance (for example,arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE
). -
getAttrIpv6Addresses
The IPv6 addresses of the instance. -
getAttrIsStaticIp
A Boolean value indicating whether the instance has a static IP assigned to it. -
getAttrLocationAvailabilityZone
The AWS Region and Availability Zone where the instance is located. -
getAttrLocationRegionName
The AWS Region of the instance. -
getAttrNetworkingMonthlyTransferGbPerMonthAllocated
The amount of allocated monthly data transfer (in GB) for an instance. -
getAttrPrivateIpAddress
The private IP address of the instance. -
getAttrPublicIpAddress
The public IP address of the instance. -
getAttrResourceType
The resource type of the instance (for example,Instance
). -
getAttrSshKeyName
The name of the SSH key pair used by the instance. -
getAttrStateCode
The status code of the instance. -
getAttrStateName
The state of the instance (for example,running
orpending
). -
getAttrSupportCode
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.
-
getAttrUserName
The user name for connecting to the instance (for example,ec2-user
). -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getBlueprintId
The blueprint ID for the instance (for example,os_amlinux_2016_03
). -
setBlueprintId
The blueprint ID for the instance (for example,os_amlinux_2016_03
). -
getBundleId
The bundle ID for the instance (for example,micro_1_0
). -
setBundleId
The bundle ID for the instance (for example,micro_1_0
). -
getInstanceName
The name of the instance. -
setInstanceName
The name of the instance. -
getAddOns
An array of add-ons for the instance. -
setAddOns
An array of add-ons for the instance. -
setAddOns
An array of add-ons for the instance. -
getAvailabilityZone
The Availability Zone for the instance. -
setAvailabilityZone
The Availability Zone for the instance. -
getHardware
The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM. -
setHardware
The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM. -
setHardware
The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM. -
getKeyPairName
The name of the key pair to use for the instance. -
setKeyPairName
The name of the key pair to use for the instance. -
getLocation
The location for the instance, such as the AWS Region and Availability Zone. -
setLocation
The location for the instance, such as the AWS Region and Availability Zone. -
setLocation
The location for the instance, such as the AWS Region and Availability Zone. -
getNetworking
The public ports and the monthly amount of data transfer allocated for the instance. -
setNetworking
The public ports and the monthly amount of data transfer allocated for the instance. -
setNetworking
The public ports and the monthly amount of data transfer allocated for the instance. -
getState
The status code and the state (for example,running
) of the instance. -
setState
The status code and the state (for example,running
) of the instance. -
setState
The status code and the state (for example,running
) of the instance. -
getTagsRaw
An array of key-value pairs to apply to this resource. -
setTagsRaw
An array of key-value pairs to apply to this resource. -
getUserData
The optional launch script for the instance. -
setUserData
The optional launch script for the instance.
-