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.93.0 (build 1706ca5)",
date="2024-01-03T18:29:28.728Z")
@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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAddOnis a property of the AWS::Lightsail::Instance resource.static interfaceAutoSnapshotAddOnis a property of the AddOn property.static final classA fluent builder forCfnInstance.static interfaceDiskis a property of the Hardware property.static interfaceHardwareis a property of the AWS::Lightsail::Instance resource.static interfaceLocationis a property of the AWS::Lightsail::Instance resource.static interfaceMonthlyTransferis a property of the Networking property.static interfaceNetworkingis a property of the AWS::Lightsail::Instance resource.static interfacePortis a property of the Networking property.static interfaceStateis a property of the AWS::Lightsail::Instance resource.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnInstance(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.CPU count of the Instance.RAM Size of the Instance.The Amazon Resource Name (ARN) of the instance (for example,arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE).A Boolean value indicating whether the instance has a static IP assigned to it.The Availability Zone in which to create your instance.The Region Name in which to create your instance.GbPerMonthAllocated of the 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.Status code of the Instance.Status code of the Instance.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.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidAn array of add-ons for the instance.voidsetAddOns(IResolvable value) An array of add-ons for the instance.voidsetAvailabilityZone(String value) The Availability Zone for the instance.voidsetBlueprintId(String value) The blueprint ID for the instance (for example,os_amlinux_2016_03).voidsetBundleId(String value) The bundle ID for the instance (for example,micro_1_0).voidsetHardware(IResolvable value) The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.voidThe hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.voidsetInstanceName(String value) The name of the instance.voidsetKeyPairName(String value) The name of the key pair to use for the instance.voidsetLocation(IResolvable value) The location for the instance, such as the AWS Region and Availability Zone.voidThe location for the instance, such as the AWS Region and Availability Zone.voidsetNetworking(IResolvable value) The public ports and the monthly amount of data transfer allocated for the instance.voidThe public ports and the monthly amount of data transfer allocated for the instance.voidsetState(IResolvable value) The status code and the state (for example,running) of the instance.voidThe status code and the state (for example,running) of the instance.voidsetTagsRaw(List<CfnTag> value) An array of key-value pairs to apply to this resource.voidsetUserData(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, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
inspectin 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrHardwareCpuCount
CPU count of the Instance. -
getAttrHardwareRamSizeInGb
RAM Size of the Instance. -
getAttrInstanceArn
The Amazon Resource Name (ARN) of the instance (for example,arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE). -
getAttrIsStaticIp
A Boolean value indicating whether the instance has a static IP assigned to it. -
getAttrLocationAvailabilityZone
The Availability Zone in which to create your instance.Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.
-
getAttrLocationRegionName
The Region Name in which to create your instance. -
getAttrNetworkingMonthlyTransferGbPerMonthAllocated
GbPerMonthAllocated of the 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
Status code of the Instance. -
getAttrStateName
Status code of the Instance. -
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:
getCfnPropertiesin 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.
-