Fugue.AWS.EC2.Subnet

This is the preferred interface for making Subnets with Fugue. The new function is the right place to start.

Module Members

external

(Function)

Create a reference to an externally managed Subnet.

Example usage:

subnet: EC2.Subnet.external("subnet-1234abcd", AWS.Us-east-1)

Type Signature

 fun (String, Region) -> Subnet
Argument: subnetId

The ID of the target Subnet. Must be of the form “subnet-” followed by 8 characters from a-z and 0-9.

Type: String

Argument: region

The Region containing the target Subnet.

Type: Region

Returns:

A reference to the specified Subnet.

Type: Subnet

new

(Function)

new Subnet (Constructor)

Call this constructor to create a new Fugue.AWS.EC2.Subnet value.

Example usage:

sn: EC2.Subnet.new {
  cidrBlock: '10.0.1.0/24',
  vpc: myVpc
  availabilityZone: AWS.A,
  mapPublicIpOnLaunch: True,
  defaultForAz: False,
  tags: [myTag]
}

Type Signature

 fun (SubnetSpec) -> Subnet
Argument: spec

A Subnet Specification record.

Type: SubnetSpec

Returns:

A Fugue.Core.AWS.EC2.Subnet record.

Type: Subnet

region

(Function)

Retrieve the region from a Subnet value.

Works for Subnets defined in the composition as well external values.

Example usage:

subnet1: EC2.Subnet.new {
  vpc:  ECS.Vpc.new {
    region: AWS.Us-west-2,
    cidrBlock: "10.0.0.0/16",
  },
  cidrBlock: "10.0.1.0/24",
}
region1: EC2.Subnet.region(subnet1) # => AWS.Us-west-2

subnet2: EC2.Subnet.external("sn-1234567", AWS.Us-east-1)
region2: EC2.Subnet.region(subnet2) # => AWS.Us-east-1

Type Signature

 fun (Subnet) -> Region
Argument: subnet

The subnet from which to get the region.

Type: Subnet

Returns:

The region containing the subnet.

Type: Region

SubnetSpec

(Type)

type SubnetSpec:
  vpc: Vpc
  cidrBlock: String
  availabilityZone: Optional<AvailabilityZone>
  defaultForAz: Optional<Bool>
  mapPublicIpOnLaunch: Optional<Bool>
  tags: Optional<List<Tag>>

Subnet Specification (Resource)

This type of value is used to specify a Subnet for the Subnet constructor, EC2.Subnet. new().

Record {

Field: vpc

The VPC in which to build the subnet. This must be a valid VPC record, constructed with the EC2.Vpc() constructor.

Type: Vpc

Field: cidrBlock

The network address space the subnet should encompass. This value is validated at compile time by the constructor, and must be a string written in CIDR notation. For more information see: https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation

Type: String

Field: availabilityZone

The availability zone in which the subnet resides. Instances launched in this subnet must also be launched in this availability zone. Of course, this must be a valid availability zone for the region in which the parent VPC is placed.

Type: Optional<AvailabilityZone>

Field: defaultForAz

The setting for whether this subnet is the default for instances launched in its Availability Zone.

Type: Optional<Bool>

Field: mapPublicIpOnLaunch

The setting for whether instances launched in this subnet are mapped to public IP addresses on launch. Mutable.

Type: Optional<Bool>

Field: tags

AWS tag key-value pairs to associate with the VPC. Mutable.

Type: Optional<List<Tag>>

}

default

(Value)

default:
  defaultForAz: None
  mapPublicIpOnLaunch: None
  tags: None

Subnet Specification Defaults