Interface CfnInstanceProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnInstanceProps.Jsii$Proxy
CfnInstance
.
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.*; CfnInstanceProps cfnInstanceProps = CfnInstanceProps.builder() .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 TypeInterfaceDescriptionstatic final class
A builder forCfnInstanceProps
static final class
An implementation forCfnInstanceProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic CfnInstanceProps.Builder
builder()
default Object
An array of add-ons for the instance.default String
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
).default Object
The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.The name of the instance.default String
The name of the key pair to use for the instance.default Object
The location for the instance, such as the AWS Region and Availability Zone.default Object
The public ports and the monthly amount of data transfer allocated for the instance.default Object
getState()
The status code and the state (for example,running
) of the instance.getTags()
An array of key-value pairs to apply to this resource.default String
The optional launch script for the instance.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getBlueprintId
The blueprint ID for the instance (for example,os_amlinux_2016_03
).- See Also:
-
getBundleId
The bundle ID for the instance (for example,micro_1_0
).- See Also:
-
getInstanceName
The name of the instance.- See Also:
-
getAddOns
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.
- See Also:
-
getAvailabilityZone
The Availability Zone for the instance.- See Also:
-
getHardware
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.
- See Also:
-
getKeyPairName
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.
- See Also:
-
getLocation
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.- See Also:
-
getNetworking
The public ports and the monthly amount of data transfer allocated for the instance.- See Also:
-
getState
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.- See Also:
-
getTags
An array of key-value pairs to apply to this resource.For more information, see Tag in the AWS CloudFormation User Guide .
The
Value
ofTags
is optional for Lightsail resources.- See Also:
-
getUserData
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.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 useapt-get
, and FreeBSD usespkg
.- See Also:
-
builder
- Returns:
- a
CfnInstanceProps.Builder
ofCfnInstanceProps
-