func ReadNetworkConfiguration()

in cmd/launch.go [447:470]


func ReadNetworkConfiguration(h *ec2helper.EC2Helper, simpleConfig *config.SimpleInfo) bool {
	vpcId, err := question.AskVpc(h)
	if cli.ShowError(err, "Asking VPC failed") {
		return false
	}

	/*
		When a new VPC will be created, ask for subnet and security group placeholders.
		Otherwise, proceed to subnet and security group selection
	*/
	if *vpcId == cli.ResponseNew {
		simpleConfig.NewVPC = true

		return ReadSubnetPlaceholder(h, simpleConfig) && ReadSecurityGroupPlaceholder(h, simpleConfig)
	} else {
		// If the resources are not specified in the config, ask for them
		if (flagConfig.SubnetId == "" && !ReadSubnet(h, simpleConfig, *vpcId)) ||
			(flagConfig.SecurityGroupIds == nil && !ReadSecurityGroups(h, simpleConfig, *vpcId)) {
			return false
		}

		return true
	}
}