github.com/kubernetes-incubator/kube-aws@v0.16.4/pkg/api/vpc.go (about) 1 package api 2 3 // kube-aws manages at most one VPC per cluster 4 // If ID or IDFromStackOutput is non-zero, kube-aws doesn't manage the VPC but its users' responsibility to 5 // provide properly configured one to be reused by kube-aws. 6 // More concretely: 7 // * If an user is going to reuse an existing VPC, it must have an internet gateway attached and 8 // * A valid internet gateway ID must be provided via `internetGateway.id` or `internetGateway.idFromStackOutput`. 9 // In other words, kube-aws doesn't create an internet gateway in an existing VPC. 10 type VPC struct { 11 Identifier `yaml:",inline"` 12 } 13 14 func (v VPC) ImportFromNetworkStack() VPC { 15 if !v.HasIdentifier() { 16 // Otherwise import the VPC ID from the control-plane stack 17 v.IDFromFn = `{"Fn::ImportValue":{"Fn::Sub":"${NetworkStackName}-VPC"}}` 18 } 19 return v 20 }