Interface CfnInstanceProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnInstanceProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:59.765Z") @Stability(Stable) public interface CfnInstanceProps extends software.amazon.jsii.JsiiSerializable
Properties for defining a 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(123)
                 .build())
         .state(StateProperty.builder()
                 .code(123)
                 .name("name")
                 .build())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .userData("userData")
         .build();
 
  • Method Details

    • getBlueprintId

      @Stability(Stable) @NotNull String getBlueprintId()
      The blueprint ID for the instance (for example, os_amlinux_2016_03 ).
    • getBundleId

      @Stability(Stable) @NotNull String getBundleId()
      The bundle ID for the instance (for example, micro_1_0 ).
    • getInstanceName

      @Stability(Stable) @NotNull String getInstanceName()
      The name of the instance.
    • getAddOns

      @Stability(Stable) @Nullable default Object 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.

    • getAvailabilityZone

      @Stability(Stable) @Nullable default String getAvailabilityZone()
      The Availability Zone for the instance.
    • getHardware

      @Stability(Stable) @Nullable default Object 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.

    • getKeyPairName

      @Stability(Stable) @Nullable default String 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.

    • getLocation

      @Stability(Stable) @Nullable default Object 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.

    • getNetworking

      @Stability(Stable) @Nullable default Object getNetworking()
      The public ports and the monthly amount of data transfer allocated for the instance.
    • getState

      @Stability(Stable) @Nullable default Object 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.

    • getTags

      @Stability(Stable) @Nullable default List<CfnTag> 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 of Tags is optional for Lightsail resources.

    • getUserData

      @Stability(Stable) @Nullable default String 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 use apt-get , and FreeBSD uses pkg .

    • builder

      @Stability(Stable) static CfnInstanceProps.Builder builder()
      Returns:
      a CfnInstanceProps.Builder of CfnInstanceProps