Skip to content

Support association of RouteTable to Subnet in ec2-controller #1219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RedbackThomson opened this issue Mar 11, 2022 · 0 comments · Fixed by aws-controllers-k8s/ec2-controller#45
Assignees
Labels
kind/enhancement Categorizes issue or PR as related to existing feature enhancements.

Comments

@RedbackThomson
Copy link
Contributor

Is your feature request related to a problem?
The EC2 controller currently supports creating a Subnet and a RouteTable resource, but does not support a way to associate the two. Since a SubnetRouteTableAssociation does not have a unique identifier, it does not warrant its own resource. It would be more appropriate to place a list of associated RouteTable as a field in the spec of Subnet.

Describe the solution you'd like

apiVersion: ec2.services.k8s.aws/v1alpha1
kind: Subnet
metadata:
  name: subnet-1
spec:
  routeTableIDs:
  - rt-12345
  - rt-67890

with a corresponding resource reference:

apiVersion: ec2.services.k8s.aws/v1alpha1
kind: Subnet
metadata:
  name: subnet-2
spec:
  routeTableRefs:
  - from:
      name: my-route-table-1
  - from:
      name: my-route-table-2
@RedbackThomson RedbackThomson added kind/enhancement Categorizes issue or PR as related to existing feature enhancements. EC2 labels Mar 11, 2022
@RedbackThomson RedbackThomson self-assigned this Mar 25, 2022
ack-bot pushed a commit to aws-controllers-k8s/ec2-controller that referenced this issue Mar 30, 2022
Closes aws-controllers-k8s/community#1219

Description of changes:
Generates the `Subnet` CRD with a new custom field `RouteTables`, which represent an array of route table IDs. Route tables are associated with the `Subnet` using the `AssociateRouteTable` API call, and then updated by deleting the association (using `DisassociateRouteTable`) and re-associating. 

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes issue or PR as related to existing feature enhancements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant