Networking
VPC, subnets, internet gateways, route tables, NAT gateways, security groups, and VPC endpoints.
API Group:
aws.konfig.io/v1alpha1
VPC # ✅ Working
Creates and manages a VPC with DNS settings, instance tenancy, optional IPv6 CIDR block, and secondary IPv4 CIDRs. Secondary CIDRs are reconciled on every sync — missing ones are added, removed ones are disassociated.
Spec
| Field | Type | Required | Description |
| cidrBlock | string | ✅ | The primary IPv4 CIDR block for the VPC (e.g. 10.0.0.0/16). Immutable after creation. |
| enableDnsSupport | bool | | Enable DNS resolution in the VPC. Default: true. |
| enableDnsHostnames | bool | | Assign DNS hostnames to EC2 instances. Default: false. |
| instanceTenancy | string | | Tenancy of instances launched into the VPC. default or dedicated. Immutable after creation. Default: default. |
| assignIpv6CidrBlock | bool | | Request an Amazon-provided IPv6 /56 CIDR block for the VPC. |
| secondaryIPv4CIDRs | []string | | Additional IPv4 CIDR blocks to associate with the VPC. Delta sync — adds/removes as needed. |
| tags | map[string]string | | AWS tags applied to the VPC. |
Status
| Field | Description |
| vpcId | The ID of the created VPC (e.g. vpc-0abc123). |
| state | Current VPC state: pending or available. |
| ipv6CidrBlock | The Amazon-provided IPv6 CIDR block, if requested. |
| conditions | Standard Kubernetes conditions. |
| observedGeneration | Last reconciled generation. |
| lastSyncTime | RFC3339 timestamp of last sync. |
Example
apiVersion: aws.konfig.io/v1alpha1
kind: VPC
metadata:
name: prod-vpc
namespace: networking
spec:
cidrBlock: 10.0.0.0/16
enableDnsSupport: true
enableDnsHostnames: true
assignIpv6CidrBlock: true
secondaryIPv4CIDRs:
- 100.64.0.0/16
tags:
env: prod
team: platform
Notes
cidrBlock is immutable after creation. To change it, delete and recreate the VPC (and all dependent resources).
instanceTenancy is immutable after creation.
secondaryIPv4CIDRs are reconciled on every sync — adding entries associates the CIDR, removing entries disassociates it from the VPC.
Deletion
Blocked if in use. AWS will refuse to delete a VPC that still has subnets, non-default security groups, route tables (other than the main table), or an attached internet gateway. Delete all dependent resources first.
Subnet # ✅ Working
Creates a subnet within a VPC. The controller waits for the referenced VPC CR to be Ready before creating the subnet.
Spec
| Field | Type | Required | Description |
| vpcRef.name | string | ✅ | Name of the VPC CR in the same namespace. |
| vpcRef.id | string | | Direct VPC ID (alternative to vpcRef.name). |
| cidrBlock | string | ✅ | IPv4 CIDR block for the subnet. Must be a subset of the VPC CIDR. Immutable after creation. |
| availabilityZone | string | ✅ | The Availability Zone for the subnet (e.g. us-east-1a). |
| mapPublicIpOnLaunch | bool | | Automatically assign a public IPv4 address to instances launched in this subnet. Default: false. |
| tags | map[string]string | | AWS tags applied to the subnet. |
Status
| Field | Description |
| subnetId | The ID of the created subnet. |
| availableIpAddressCount | The number of available IPv4 addresses in the subnet. |
| conditions | Standard Kubernetes conditions. |
| observedGeneration | Last reconciled generation. |
| lastSyncTime | RFC3339 timestamp of last sync. |
Example
apiVersion: aws.konfig.io/v1alpha1
kind: Subnet
metadata:
name: prod-public-subnet-1a
namespace: networking
spec:
vpcRef:
name: prod-vpc
cidrBlock: 10.0.1.0/24
availabilityZone: us-east-1a
mapPublicIpOnLaunch: true
tags:
env: prod
type: public
kubernetes.io/role/elb: "1"
Notes
cidrBlock is immutable after creation.
- The controller waits for the
VPC CR to be Ready before creating the subnet. If the VPC CR is not Ready, the subnet CR will have reason: DependencyNotReady.
Deletion
Blocked if in use. AWS will refuse to delete a subnet that has Elastic Network Interfaces (ENIs) attached — typically means EC2 instances, RDS instances, Lambda functions, or load balancers still using it.
InternetGateway # ✅ Working
Creates an Internet Gateway and attaches it to the referenced VPC. Only one IGW can be attached to a VPC at a time.
Spec
| Field | Type | Required | Description |
| vpcRef.name | string | ✅ | Name of the VPC CR to attach to. |
| vpcRef.id | string | | Direct VPC ID (alternative to vpcRef.name). |
| tags | map[string]string | | AWS tags applied to the internet gateway. |
Status
| Field | Description |
| internetGatewayId | The ID of the created internet gateway (e.g. igw-0abc123). |
| conditions | Standard Kubernetes conditions. |
| observedGeneration | Last reconciled generation. |
| lastSyncTime | RFC3339 timestamp of last sync. |
Example
apiVersion: aws.konfig.io/v1alpha1
kind: InternetGateway
metadata:
name: prod-igw
namespace: networking
spec:
vpcRef:
name: prod-vpc
tags:
env: prod
Notes
- Maximum one internet gateway per VPC. Creating a second one while the first is attached will result in an error.
- The controller handles both creation and attachment in the same reconcile loop.
Deletion
Immediate. The controller detaches the IGW from the VPC first, then deletes it.
RouteTable # ✅ Working
Route table with individual route management and subnet associations. Routes and subnet associations are diffed on every reconcile. The local route is never removed.
Spec
| Field | Type | Required | Description |
| vpcRef.name | string | ✅ | Name of the VPC CR. |
| vpcRef.id | string | | Direct VPC ID (alternative to vpcRef.name). |
| routes | []Route | | List of routes. Each route has destinationCidr, and one of gatewayId, natGatewayRef. |
| routes[].destinationCidr | string | ✅ | Destination CIDR block for the route (e.g. 0.0.0.0/0). |
| routes[].gatewayId | string | | Direct gateway ID (IGW, VGW, etc.). Mutually exclusive with natGatewayRef. |
| routes[].natGatewayRef | string | | Name of a NatGateway CR. Controller waits for NatGateway to be Ready. |
| subnetAssociations | []string | | Names of Subnet CRs to associate with this route table. Delta sync. |
| tags | map[string]string | | AWS tags applied to the route table. |
Status
| Field | Description |
| routeTableId | The ID of the route table. |
| conditions | Standard Kubernetes conditions. |
| observedGeneration | Last reconciled generation. |
| lastSyncTime | RFC3339 timestamp of last sync. |
Example
apiVersion: aws.konfig.io/v1alpha1
kind: RouteTable
metadata:
name: prod-public-rt
namespace: networking
spec:
vpcRef:
name: prod-vpc
routes:
- destinationCidr: 0.0.0.0/0
gatewayId: igw-0abc123 # or use InternetGateway CR name via ref
subnetAssociations:
- prod-public-subnet-1a
- prod-public-subnet-1b
tags:
env: prod
type: public
---
apiVersion: aws.konfig.io/v1alpha1
kind: RouteTable
metadata:
name: prod-private-rt-1a
namespace: networking
spec:
vpcRef:
name: prod-vpc
routes:
- destinationCidr: 0.0.0.0/0
natGatewayRef: prod-nat-1a # references NatGateway CR
subnetAssociations:
- prod-private-subnet-1a
tags:
env: prod
type: private
Notes
- Routes are diffed on every reconcile — routes in AWS not in spec are deleted; routes in spec not in AWS are created.
- The local route (VPC CIDR → local) is always preserved and never deleted, even if not specified in spec.
- Subnet associations are delta-synced: the controller associates subnets in spec not yet associated, and disassociates subnets removed from spec.
- When using
natGatewayRef, the controller waits for the NatGateway CR to be Ready before creating the route.
Deletion
Immediate. The controller disassociates all subnets first, then deletes the route table. If this is the main route table of a VPC, deletion is a no-op (AWS does not allow deletion of the main route table).
NatGateway # ✅ Working ⏱ async
Creates a NAT gateway in the specified subnet. Public NAT gateways automatically allocate an Elastic IP address. Provisioning takes 1–3 minutes.
⏱ Async — takes 1–3 minutes to provision. Controller polls every 15 seconds until the NAT gateway reaches the available state.
Spec
| Field | Type | Required | Description |
| subnetRef.name | string | ✅ | Name of the Subnet CR to place the NAT gateway in (must be a public subnet for public NAT). |
| subnetRef.id | string | | Direct subnet ID (alternative to subnetRef.name). |
| connectivityType | string | | public or private. Default: public. Public NAT gateways allocate an EIP; private ones do not. Immutable after creation. |
| tags | map[string]string | | AWS tags applied to the NAT gateway. |
Status
| Field | Description |
| natGatewayId | The ID of the NAT gateway (e.g. nat-0abc123). |
| elasticIpAllocationId | The Elastic IP allocation ID (public NAT gateways only). |
| state | Current state: pending, available, deleting, deleted. |
| conditions | Standard Kubernetes conditions. |
| observedGeneration | Last reconciled generation. |
| lastSyncTime | RFC3339 timestamp of last sync. |
Example
apiVersion: aws.konfig.io/v1alpha1
kind: NatGateway
metadata:
name: prod-nat-1a
namespace: networking
spec:
subnetRef:
name: prod-public-subnet-1a
connectivityType: public
tags:
env: prod
az: us-east-1a
Notes
- Public NAT gateways allocate a new Elastic IP address automatically. The EIP allocation ID is stored in
status.elasticIpAllocationId.
- Private NAT gateways do not allocate an EIP and are used for routing between private subnets.
connectivityType is immutable after creation.
Deletion
Async (~60–90 seconds). The controller initiates deletion and polls until the NAT gateway reaches the deleted state, then releases the associated Elastic IP address. The CR remains until AWS confirms full deletion.
SecurityGroup # ✅ Working
Creates a security group with ingress and egress rules. Rules support IPv4 CIDR, IPv6 CIDR, prefix lists, and references to other security groups — all with per-rule descriptions. Drift detection runs on every reconcile.
Spec
| Field | Type | Required | Description |
| vpcRef.name | string | ✅ | Name of the VPC CR. |
| vpcRef.id | string | | Direct VPC ID (alternative to vpcRef.name). |
| groupName | string | ✅ | Name of the security group. Immutable after creation. |
| description | string | ✅ | Description of the security group. Immutable after creation. |
| ingressRules | []SGRule | | List of ingress rules. |
| egressRules | []SGRule | | List of egress rules. Default: allow all outbound (0.0.0.0/0, -1). |
| tags | map[string]string | | AWS tags applied to the security group. |
Each SGRule in ingressRules / egressRules supports:
| Field | Type | Description |
| protocol | string | IP protocol: tcp, udp, icmp, icmpv6, or -1 (all). |
| fromPort | int32 | Start of port range. Use -1 for ICMP or all protocols. |
| toPort | int32 | End of port range. |
| cidrIpv4 | string | IPv4 CIDR block source/destination. |
| cidrIpv6 | string | IPv6 CIDR block source/destination. |
| prefixListId | string | AWS-managed prefix list ID (e.g. for S3 or DynamoDB gateway endpoints). |
| sourceGroupRef | string | Name of another SecurityGroup CR in the same namespace. |
| description | string | Per-rule description for auditing purposes. |
Status
| Field | Description |
| groupId | The ID of the security group (e.g. sg-0abc123). |
| conditions | Standard Kubernetes conditions. |
| observedGeneration | Last reconciled generation. |
| lastSyncTime | RFC3339 timestamp of last sync. |
Example — Web Security Group
apiVersion: aws.konfig.io/v1alpha1
kind: SecurityGroup
metadata:
name: web-sg
namespace: networking
spec:
vpcRef:
name: prod-vpc
groupName: web-sg
description: "Web tier security group"
ingressRules:
- protocol: tcp
fromPort: 443
toPort: 443
cidrIpv4: 0.0.0.0/0
description: "HTTPS from internet"
- protocol: tcp
fromPort: 443
toPort: 443
cidrIpv6: "::/0"
description: "HTTPS from internet (IPv6)"
- protocol: tcp
fromPort: 80
toPort: 80
cidrIpv4: 0.0.0.0/0
description: "HTTP redirect"
egressRules:
- protocol: "-1"
fromPort: -1
toPort: -1
cidrIpv4: 0.0.0.0/0
description: "All outbound"
tags:
env: prod
tier: web
Example — DB Security Group (SG reference)
apiVersion: aws.konfig.io/v1alpha1
kind: SecurityGroup
metadata:
name: db-sg
namespace: networking
spec:
vpcRef:
name: prod-vpc
groupName: db-sg
description: "Database tier security group"
ingressRules:
- protocol: tcp
fromPort: 5432
toPort: 5432
sourceGroupRef: web-sg # references SecurityGroup CR
description: "PostgreSQL from web tier"
tags:
env: prod
tier: db
Notes
groupName and description are immutable after creation.
- All rules are diffed on every reconcile cycle. Rules present in AWS but not in spec are deleted; rules in spec but not in AWS are created.
- When using
sourceGroupRef, the controller waits for the referenced security group CR to be Ready.
Deletion
Blocked if in use. AWS refuses to delete a security group that is currently attached to ENIs, RDS instances, Lambda functions, or referenced as a source/destination in another security group's rules.
VPCEndpoint # ✅ Working
Creates Interface or Gateway VPC endpoints for AWS services. Gateway endpoints (S3, DynamoDB) are free; Interface endpoints are billed per hour and per GB.
Spec
| Field | Type | Required | Description |
| vpcRef.name | string | ✅ | Name of the VPC CR. |
| vpcRef.id | string | | Direct VPC ID. |
| serviceName | string | ✅ | AWS service name in the format com.amazonaws.<region>.<service> (e.g. com.amazonaws.us-east-1.s3). |
| endpointType | string | ✅ | Interface or Gateway. |
| routeTableRefs | []string | | Names of RouteTable CRs to associate (Gateway endpoints only). |
| subnetRefs | []string | | Names of Subnet CRs to place the endpoint ENIs in (Interface endpoints only). |
| securityGroupRefs | []string | | Names of SecurityGroup CRs for the endpoint ENIs (Interface endpoints only). |
| tags | map[string]string | | AWS tags applied to the endpoint. |
Status
| Field | Description |
| endpointId | The ID of the VPC endpoint (e.g. vpce-0abc123). |
| state | Current endpoint state: pending, available, deleting, etc. |
| conditions | Standard Kubernetes conditions. |
| observedGeneration | Last reconciled generation. |
| lastSyncTime | RFC3339 timestamp of last sync. |
Example — S3 Gateway Endpoint
apiVersion: aws.konfig.io/v1alpha1
kind: VPCEndpoint
metadata:
name: s3-gateway-endpoint
namespace: networking
spec:
vpcRef:
name: prod-vpc
serviceName: com.amazonaws.us-east-1.s3
endpointType: Gateway
routeTableRefs:
- prod-private-rt-1a
- prod-private-rt-1b
tags:
env: prod
---
apiVersion: aws.konfig.io/v1alpha1
kind: VPCEndpoint
metadata:
name: ecr-api-endpoint
namespace: networking
spec:
vpcRef:
name: prod-vpc
serviceName: com.amazonaws.us-east-1.ecr.api
endpointType: Interface
subnetRefs:
- prod-private-subnet-1a
- prod-private-subnet-1b
securityGroupRefs:
- web-sg
tags:
env: prod
Notes
- Gateway endpoints (S3, DynamoDB) are free and add a route to the specified route tables. No ENIs are created.
- Interface endpoints create ENIs in the specified subnets and are billed per hour and per GB of data processed.
- The service name format is always
com.amazonaws.<region>.<service>. Run aws ec2 describe-vpc-endpoint-services to discover available services in your region.
Deletion
Immediate. The VPC endpoint is deleted. Route table entries for Gateway endpoints are removed automatically by AWS.