Class CfnInstance.Builder

java.lang.Object
software.amazon.awscdk.services.lightsail.CfnInstance.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnInstance>
Enclosing class:
CfnInstance

@Stability(Stable) public static final class CfnInstance.Builder extends Object implements software.amazon.jsii.Builder<CfnInstance>
A fluent builder for CfnInstance.
  • Method Details

    • create

      @Stability(Stable) public static CfnInstance.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnInstance.Builder.
    • blueprintId

      @Stability(Stable) public CfnInstance.Builder blueprintId(String blueprintId)
      The blueprint ID for the instance (for example, os_amlinux_2016_03 ).

      Parameters:
      blueprintId - The blueprint ID for the instance (for example, os_amlinux_2016_03 ). This parameter is required.
      Returns:
      this
    • bundleId

      @Stability(Stable) public CfnInstance.Builder bundleId(String bundleId)
      The bundle ID for the instance (for example, micro_1_0 ).

      Parameters:
      bundleId - The bundle ID for the instance (for example, micro_1_0 ). This parameter is required.
      Returns:
      this
    • instanceName

      @Stability(Stable) public CfnInstance.Builder instanceName(String instanceName)
      The name of the instance.

      Parameters:
      instanceName - The name of the instance. This parameter is required.
      Returns:
      this
    • addOns

      @Stability(Stable) public CfnInstance.Builder addOns(IResolvable addOns)
      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.

      Parameters:
      addOns - An array of add-ons for the instance. This parameter is required.
      Returns:
      this
    • addOns

      @Stability(Stable) public CfnInstance.Builder addOns(List<? extends Object> addOns)
      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.

      Parameters:
      addOns - An array of add-ons for the instance. This parameter is required.
      Returns:
      this
    • availabilityZone

      @Stability(Stable) public CfnInstance.Builder availabilityZone(String availabilityZone)
      The Availability Zone for the instance.

      Parameters:
      availabilityZone - The Availability Zone for the instance. This parameter is required.
      Returns:
      this
    • hardware

      @Stability(Stable) public CfnInstance.Builder hardware(IResolvable hardware)
      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.

      Parameters:
      hardware - The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM. This parameter is required.
      Returns:
      this
    • hardware

      @Stability(Stable) public CfnInstance.Builder hardware(CfnInstance.HardwareProperty hardware)
      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.

      Parameters:
      hardware - The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM. This parameter is required.
      Returns:
      this
    • keyPairName

      @Stability(Stable) public CfnInstance.Builder keyPairName(String keyPairName)
      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.

      Parameters:
      keyPairName - The name of the key pair to use for the instance. This parameter is required.
      Returns:
      this
    • location

      @Stability(Stable) public CfnInstance.Builder location(IResolvable location)
      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.

      Parameters:
      location - The location for the instance, such as the AWS Region and Availability Zone. This parameter is required.
      Returns:
      this
    • location

      @Stability(Stable) public CfnInstance.Builder location(CfnInstance.LocationProperty location)
      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.

      Parameters:
      location - The location for the instance, such as the AWS Region and Availability Zone. This parameter is required.
      Returns:
      this
    • networking

      @Stability(Stable) public CfnInstance.Builder networking(IResolvable networking)
      The public ports and the monthly amount of data transfer allocated for the instance.

      Parameters:
      networking - The public ports and the monthly amount of data transfer allocated for the instance. This parameter is required.
      Returns:
      this
    • networking

      @Stability(Stable) public CfnInstance.Builder networking(CfnInstance.NetworkingProperty networking)
      The public ports and the monthly amount of data transfer allocated for the instance.

      Parameters:
      networking - The public ports and the monthly amount of data transfer allocated for the instance. This parameter is required.
      Returns:
      this
    • state

      @Stability(Stable) public CfnInstance.Builder state(IResolvable state)
      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.

      Parameters:
      state - The status code and the state (for example, running ) of the instance. This parameter is required.
      Returns:
      this
    • state

      @Stability(Stable) public CfnInstance.Builder state(CfnInstance.StateProperty state)
      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.

      Parameters:
      state - The status code and the state (for example, running ) of the instance. This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public CfnInstance.Builder tags(List<? extends CfnTag> tags)
      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.

      Parameters:
      tags - An array of key-value pairs to apply to this resource. This parameter is required.
      Returns:
      this
    • userData

      @Stability(Stable) public CfnInstance.Builder userData(String userData)
      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 .

      Parameters:
      userData - The optional launch script for the instance. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnInstance build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnInstance>
      Returns:
      a newly built instance of CfnInstance.