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

includesIP

(Function)

Test if a subnet includes a given IP.

Type Signature

 fun (Subnet, String) -> Bool
Argument: subnet

The subnet to test. Must not be an externally defined subnet (i.e. created with EC2.Subnet.external).

Type: Subnet

Argument: ip

The IP address to test.

Type: String

Returns:

True if ip is included in the subnet. False otherwise.

Type: Bool

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 { vpc: Vpc,
       cidrBlock: String,
       availabilityZone: Optional<AvailabilityZone>,
       defaultForAz: Optional<Bool>,
       mapPublicIpOnLaunch: Optional<Bool>,
       tags: Optional<List<Tag>>,
       resourceId: Optional<String> } -> Subnet
Argument: vpc

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

Type: Vpc

Argument: 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

Argument: 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>

Argument: defaultForAz

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

Type: Optional<Bool>

Argument: mapPublicIpOnLaunch

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

Type: Optional<Bool>

Argument: tags

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

Type: Optional<List<Tag>>

Argument: resourceId

Resource ID of the resource to import with Fugue Import. This field is only honored on fugue run. The resource ID is the AWS ID. Mutable. Example: subnet-1234abcd

Type: Optional<String>

Returns:

A Fugue.Core.AWS.EC2.Subnet value.

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:  EC2.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("subnet-12345678", 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)

DEPRECATED

This type of value is no longer used to specify a subnet for the subnet constructor new. See Fugue.AWS.EC2.Subnet.new https://docs.fugue.co/Fugue.AWS.EC2.Subnet.html#function-fugue-aws-ec2-subnet-new for documentation on the current arguments.

Record {

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

}

default

(Value)

default:
  defaultForAz: None
  mapPublicIpOnLaunch: None
  tags: None

Subnet Specification Defaults

DEPRECATED: Use of Fugue.AWS.EC2.Subnet.default is no longer required. It will be removed in a future release.