Fugue.AWS.EC2.Instance

This is the preferred interface for making EC2 Instance resources with Fugue. If you want to manage an EC2 Instance with Fugue, the new function is the right place to start.

Module Members

external

(Function)

Create a reference to an externally managed Instance.

Example usage:

instance: EC2.Instance.external("i-1234abcd", AWS.Us-east-1)

Type Signature

 fun (String, Region) -> Instance
Argument: instanceId
Type: String
Argument: region

The Region containing the target Instance.

Type: Region

Returns:

A reference to the specified Instance.

Type: Instance

new

(Function)

new EC2 Instance (Constructor)

Call this constructor to create a new Fugue.Core.AWS.EC2.Instance value. This constructor should be used only when using one Network Interface with the instance. If you wish to use multiple Network Interfaces with the instance, please use newWithNetworkInterfaces.

Type Signature

 fun { keyName: Optional<String>,
       instanceType: Optional<InstanceType>,
       monitoring: Optional<Bool>,
       subnet: Subnet,
       privateIpAddress: Optional<String>,
       blockDeviceMappings: Optional<List<InstanceBlockDeviceMapping>>,
       tags: Optional<List<Tag>>,
       securityGroups: List<SecurityGroup>,
       sourceDestCheck: Optional<Bool>,
       iamInstanceProfile: Optional<InstanceProfile>,
       ebsOptimized: Optional<Bool>,
       image: String,
       disableApiTermination: Optional<Bool>,
       instanceInitiatedShutdownBehavior: Optional<InstanceShutdownBehavior>,
       userData: Optional<String>,
       userDataBin: Optional<Bytes>,
       associatePublicIpAddress: Optional<Bool> } -> Instance
Argument: keyName

The name of the SSH key to install on the instance for remote logins.

Type: Optional<String>

Argument: instanceType

The type of EC2 instance to launch.

Type: Optional<InstanceType>

Argument: monitoring

Specifies whether enhanced CloudWatch monitoring is enabled for the instance. *Mutable.

Type: Optional<Bool>

Argument: subnet

The subnet in which to launch the instance.

Type: Subnet

Argument: privateIpAddress

The primary private IP address for the instance.

Type: Optional<String>

Argument: blockDeviceMappings

The mapping of volumes to block devices for the OS, expressed as an array of BlockDeviceMapping variables.

Type: Optional<List<InstanceBlockDeviceMapping>>

Argument: tags

AWS tags to apply to the instance. *Mutable.

Type: Optional<List<Tag>>

Argument: securityGroups

Security groups to apply to the instance. At least one security group must be specified.

Type: List<SecurityGroup>

Argument: sourceDestCheck

Specifies whether source/destination checking is done for network traffic received by the instance. If the instance is going to perform NAT, it must accept traffic for sources & destinations other than itself, so this must be disabled.

Type: Optional<Bool>

Argument: iamInstanceProfile

The IAM profile to launch the instance with.

Type: Optional<InstanceProfile>

Argument: ebsOptimized

Specifies whether to launch the instance with EBS optimization, which is basically an additional NIC dedicated to EBS traffic. Otherwise, a single NIC usually handles both EBS and regular network traffic.

Type: Optional<Bool>

Argument: image

The ID of the Amazon Machine Image (AMI) to use as the basis for the instance storage.

Type: String

Argument: disableApiTermination

Whether to disable instance termination via the API. This applies a “safety switch” to instance termination, which must first be set to “false” before the instance can be terminated. *Mutable.

Type: Optional<Bool>

Argument: instanceInitiatedShutdownBehavior

The behavior AWS should take when the instance initiates its own shutdown, expressed as a ShutdownBehavior variable. *Mutable.

Type: Optional<InstanceShutdownBehavior>

Argument: userData

The userdata script to run at instance first boot. Only one of either userData or userDataBin may be specified.

Type: Optional<String>

Argument: userDataBin

The userdata, as bytes, to provide to the instance. Required for sending gzip or multipart encoded userdata. Only one of either userData or userDataBin may be specified.

@ associatePublicIpAddress Whether the instance launches with a public IP address. An Internet Gateway must be attached to the instances VPC if associatePublicIpAddress is set to True.

Type: Optional<Bytes>

Argument: associatePublicIpAddress
Type: Optional<Bool>
Returns:

A Fugue.Core.AWS.EC2.Instance value.

Type: Instance

newWithNetworkInterfaces

(Function)

newWithNetworkInterfaces EC2 Instance (Constructor)

Call this constructor to create a new Fugue.Core.AWS.EC2.Instance value. This constructor should be used only when multiple network interfaces are desired on the instance. If the desired instance only has one network interface, please use new.

Type Signature

 fun { keyName: Optional<String>,
       instanceType: Optional<InstanceType>,
       monitoring: Optional<Bool>,
       blockDeviceMappings: Optional<List<InstanceBlockDeviceMapping>>,
       tags: Optional<List<Tag>>,
       iamInstanceProfile: Optional<InstanceProfile>,
       ebsOptimized: Optional<Bool>,
       image: String,
       disableApiTermination: Optional<Bool>,
       instanceInitiatedShutdownBehavior: Optional<InstanceShutdownBehavior>,
       userData: Optional<String>,
       userDataBin: Optional<Bytes>,
       primaryNetworkInterface: PrimaryInstanceNetworkInterface,
       secondaryNetworkInterfaces: Optional<List<InstanceNetworkInterfaceAttachment>> } -> Instance
Argument: keyName

The name of the SSH key to install on the instance for remote logins.

Type: Optional<String>

Argument: instanceType

The type of EC2 instance to launch.

Type: Optional<InstanceType>

Argument: monitoring

Specifies whether enhanced CloudWatch monitoring is enabled for the instance. Mutable.

Type: Optional<Bool>

Argument: blockDeviceMappings

The mapping of volumes to block devices for the OS, expressed as an array of BlockDeviceMapping variables.

Type: Optional<List<InstanceBlockDeviceMapping>>

Argument: tags

AWS tags to apply to the instance. Mutable.

Type: Optional<List<Tag>>

Argument: iamInstanceProfile

The IAM profile to launch the instance with.

Type: Optional<InstanceProfile>

Argument: ebsOptimized

Specifies whether to launch the instance with EBS optimization, which is basically an additional NIC dedicated to EBS traffic. Otherwise, a single NIC usually handles both EBS and regular network traffic.

Type: Optional<Bool>

Argument: image

The ID of the Amazon Machine Image (AMI) to use as the basis for the instance storage.

Type: String

Argument: disableApiTermination

Whether to disable instance termination via the API. This applies a “safety switch” to instance termination, which must first be set to “false” before the instance can be terminated. Mutable.

Type: Optional<Bool>

Argument: instanceInitiatedShutdownBehavior

The behavior AWS should take when the instance initiates its own shutdown, expressed as a ShutdownBehavior variable. Mutable.

Type: Optional<InstanceShutdownBehavior>

Argument: userData

The userdata script to run at instance first boot. Only one of either userData or userDataBin may be specified.

Type: Optional<String>

Argument: userDataBin

The userdata, as bytes, to provide to the instance. Required for sending gzip or multipart encoded userdata. Only one of either userData or userDataBin may be specified.

@primaryNetworkInterface The primary network interface to be attached to the instance on network device eth0.

@secondaryNetworkInterfaces A list of network interface attachments for network devices eth1 through eth31. *Mutable.

Type: Optional<Bytes>

Argument: primaryNetworkInterface
Type: PrimaryInstanceNetworkInterface
Argument: secondaryNetworkInterfaces
Type: Optional<List<InstanceNetworkInterfaceAttachment>>
Returns:

A Fugue.Core.AWS.EC2.Instance value.

Type: Instance

default

(Value)

default:
  keyName: None
  privateIpAddress: None
  blockDeviceMappings: None
  tags: None
  sourceDestCheck: None
  iamInstanceProfile: None
  ebsOptimized: None
  disableApiTermination: None
  instanceInitiatedShutdownBehavior: None
  userData: None

DEPRECATED Please use named arguments in the new constructor instead.

EC2 Instance Specification (Default Values)