AwsSimpleSubnetModule
Hierarchy
- AModule<AwsSimpleSubnetModuleSchema, AwsSimpleSubnet>
- AwsSimpleSubnetModule
Index
Constructors
constructor
Parameters
moduleId: string
The ID this module is loaded under.
Returns AwsSimpleSubnetModule
Properties
readonlyinheritedmoduleId
The ID this module was loaded under. It scopes everything the module produces, so the same module class can be loaded more than once.
staticreadonlyinheritedMODULE_PACKAGE
The package the module is registered under, set by Module.
staticreadonlyinheritedMODULE_SCHEMA
The schema of the module's inputs, set by Module.
Methods
onInit
Validates the availability zone and CIDR against the region, creates the subnet, wires its sibling rules, and overlays any filesystem mounts.
Parameters
inputs: AwsSimpleSubnetModuleSchema
Returns Promise<(AwsSimpleSubnet | AwsSimpleSubnetLocalFilesystemMountOverlay)[]>
inheritedregisterHooks
To hook custom behavior into Octo's lifecycle for the duration of this module. Override it to return the callbacks you want run.
Returns { postCommitHooks?: PostHookSignature[]; postModelActionHooks?: PostHookSignature[]; postResourceActionHooks?: PostHookSignature[]; preCommitHooks?: PreHookSignature[]; preModelActionHooks?: PreHookSignature[]; preResourceActionHooks?: PreHookSignature[] }
optionalpostCommitHooks?: PostHookSignature[]
optionalpostModelActionHooks?: PostHookSignature[]
optionalpostResourceActionHooks?: PostHookSignature[]
optionalpreCommitHooks?: PreHookSignature[]
optionalpreModelActionHooks?: PreHookSignature[]
optionalpreResourceActionHooks?: PreHookSignature[]
registerMetadata
Resolves the account, region, the region's availability zones, and its VPC CIDR block.
Parameters
inputs: AwsSimpleSubnetModuleSchema
Returns Promise<{ awsAccountId: string; awsAvailabilityZones: string[]; awsRegionId: string; awsRegionVpcCidrBlock: string }>
AwsSimpleSubnetModulecreates a VPC subnet in one availability zone (subnetCidrBlock,subnetAvailabilityZone) with an optional NAT gateway (subnetOptions.createNatGateway) and EFS filesystems mounted (localFilesystems).A subnet, its route table and its network ACL are free. A NAT gateway (
subnetOptions.createNatGateway) bills about $0.045 an hour (about $32 a month) plus about $0.045 per GB it carries, and its public IPv4 address about $0.005 an hour, in us-east-1.A replaced subnet takes what runs in it down with it until it is created again. A replaced NAT gateway cuts the outbound internet of every subnet routed through it until its successor is up.
TypeScript
Modules/Subnet/AwsSimpleSubnet
A private subnet reaches the internet only through a sibling's NAT gateway (
subnetSiblingswithattachToNatGateway). AWS keeps five addresses of every subnet for itself.subnetCidrBlocklies inside the region'svpcCidrBlockand overlaps no other subnet;subnetAvailabilityZoneis one of the region's zones.A mounted EFS filesystem accepts NFS traffic (port 2049) from this subnet's
subnetCidrBlockonly.A public subnet's network ACL allows all traffic in and out, so only security groups filter it.
A NAT gateway is a public one whose Elastic IP AWS allocates: an address of your own cannot be assigned.
Nothing of its own: a subnet holds no data. Replacing it replaces what lies inside, and that loses whatever those modules'
losesDatanames.Changing
subnetCidrBlock,subnetAvailabilityZoneorsubnetNamereplaces the subnet and everything in it.Subnetmodel.