diff --git a/resources/types/aws/kubernetes_cluster.go b/resources/types/aws/kubernetes_cluster.go index fe110d7f..da0d2a11 100644 --- a/resources/types/aws/kubernetes_cluster.go +++ b/resources/types/aws/kubernetes_cluster.go @@ -150,6 +150,12 @@ func (r AwsKubernetesCluster) FromState(state *output.TfState) (*resourcespb.Kub result.KubeConfigRaw = kubeCgfRaw } + var err error + result.DefaultNodePool, err = AwsKubernetesNodePool{r.DefaultNodePool}.FromState(state) + if err != nil { + return nil, err + } + return result, nil } diff --git a/resources/types/azure/kubernetes_cluster.go b/resources/types/azure/kubernetes_cluster.go index 440ace47..1ebcb16b 100644 --- a/resources/types/azure/kubernetes_cluster.go +++ b/resources/types/azure/kubernetes_cluster.go @@ -43,6 +43,12 @@ func (r AzureKubernetesCluster) FromState(state *output.TfState) (*resourcespb.K result.KubeConfigRaw = values["kube_config_raw"].(string) } + var err error + result.DefaultNodePool, err = AzureKubernetesNodePool{r.DefaultNodePool}.FromState(state) + if err != nil { + return nil, err + } + return result, nil } diff --git a/test/_configs/network_interface/network_interface/config.textproto b/test/_configs/network_interface/network_interface/config.textproto index 26333323..1f23a58b 100755 --- a/test/_configs/network_interface/network_interface/config.textproto +++ b/test/_configs/network_interface/network_interface/config.textproto @@ -1,103 +1,103 @@ -resources: { - resource_id: "example_vn_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "example_vn_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "example_vn" - cidr_block: "10.0.0.0/16" + name: "example_vn" + cidr_block: "10.0.0.0/16" } } } } -resources: { - resource_id: "example_vn_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "example_vn_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "example_vn" - cidr_block: "10.0.0.0/16" + name: "example_vn" + cidr_block: "10.0.0.0/16" } } } } -resources: { - resource_id: "subnet_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.SubnetArgs]: { - name: "subnet" - cidr_block: "10.0.2.0/24" - virtual_network_id: "example_vn_aws" - availability_zone: 2 +resources: { + resource_id: "subnet_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.SubnetArgs]: { + name: "subnet" + cidr_block: "10.0.2.0/24" + virtual_network_id: "example_vn_aws" + availability_zone: 2 } } } } -resources: { - resource_id: "subnet_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.SubnetArgs]: { - name: "subnet" - cidr_block: "10.0.2.0/24" - virtual_network_id: "example_vn_azure" - availability_zone: 2 +resources: { + resource_id: "subnet_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.SubnetArgs]: { + name: "subnet" + cidr_block: "10.0.2.0/24" + virtual_network_id: "example_vn_azure" + availability_zone: 2 } } } } -resources: { - resource_id: "nic_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "nic_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "test-nic" - subnet_id: "subnet_azure" + name: "test-nic" + subnet_id: "subnet_azure" } } } } -resources: { - resource_id: "nic_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "nic_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "test-nic" - subnet_id: "subnet_aws" + name: "test-nic" + subnet_id: "subnet_aws" } } } } -resources: { - resource_id: "rg1" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.ResourceGroupArgs]: { - common_parameters: { - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "rg1" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.ResourceGroupArgs]: { + common_parameters: { + location: EU_WEST_1 + cloud_provider: AZURE } - name: "rg1" + name: "rg1" } } } diff --git a/test/_configs/network_interface_security_group_association/network_interface_security_group_association/config.textproto b/test/_configs/network_interface_security_group_association/network_interface_security_group_association/config.textproto index e6a42ea9..6816f3b6 100755 --- a/test/_configs/network_interface_security_group_association/network_interface_security_group_association/config.textproto +++ b/test/_configs/network_interface_security_group_association/network_interface_security_group_association/config.textproto @@ -1,225 +1,225 @@ -resources: { - resource_id: "example_vn_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "example_vn_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "example_vn" - cidr_block: "10.0.0.0/16" + name: "example_vn" + cidr_block: "10.0.0.0/16" } } } } -resources: { - resource_id: "example_vn_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "example_vn_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "example_vn" - cidr_block: "10.0.0.0/16" + name: "example_vn" + cidr_block: "10.0.0.0/16" } } } } -resources: { - resource_id: "subnet_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.SubnetArgs]: { - name: "subnet" - cidr_block: "10.0.2.0/24" - virtual_network_id: "example_vn_aws" - availability_zone: 2 +resources: { + resource_id: "subnet_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.SubnetArgs]: { + name: "subnet" + cidr_block: "10.0.2.0/24" + virtual_network_id: "example_vn_aws" + availability_zone: 2 } } } } -resources: { - resource_id: "subnet_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.SubnetArgs]: { - name: "subnet" - cidr_block: "10.0.2.0/24" - virtual_network_id: "example_vn_azure" - availability_zone: 2 +resources: { + resource_id: "subnet_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.SubnetArgs]: { + name: "subnet" + cidr_block: "10.0.2.0/24" + virtual_network_id: "example_vn_azure" + availability_zone: 2 } } } } -resources: { - resource_id: "ip_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.PublicIpArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "ip_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.PublicIpArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "test-ip" + name: "test-ip" } } } } -resources: { - resource_id: "ip_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.PublicIpArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "ip_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.PublicIpArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "test-ip" + name: "test-ip" } } } } -resources: { - resource_id: "nic_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "nic_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "test-nic" - subnet_id: "subnet_azure" - public_ip_id: "ip_azure" + name: "test-nic" + subnet_id: "subnet_azure" + public_ip_id: "ip_azure" } } } } -resources: { - resource_id: "nic_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "nic_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "test-nic" - subnet_id: "subnet_aws" - public_ip_id: "ip_aws" + name: "test-nic" + subnet_id: "subnet_aws" + public_ip_id: "ip_aws" } } } } -resources: { - resource_id: "nsg2_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkSecurityGroupArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "nsg2_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkSecurityGroupArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "test-nsg2" - virtual_network_id: "example_vn_aws" - rules: { - protocol: "tcp" - priority: 120 - port_range: { - from: 22 - to: 22 + name: "test-nsg2" + virtual_network_id: "example_vn_aws" + rules: { + protocol: "tcp" + priority: 120 + port_range: { + from: 22 + to: 22 } - cidr_block: "0.0.0.0/0" + cidr_block: "0.0.0.0/0" } - rules: { - protocol: "tcp" - priority: 140 - port_range: { - from: 443 - to: 443 + rules: { + protocol: "tcp" + priority: 140 + port_range: { + from: 443 + to: 443 } - cidr_block: "0.0.0.0/0" + cidr_block: "0.0.0.0/0" } } } } } -resources: { - resource_id: "nsg2_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkSecurityGroupArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "nsg2_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkSecurityGroupArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "test-nsg2" - virtual_network_id: "example_vn_azure" - rules: { - protocol: "tcp" - priority: 120 - port_range: { - from: 22 - to: 22 + name: "test-nsg2" + virtual_network_id: "example_vn_azure" + rules: { + protocol: "tcp" + priority: 120 + port_range: { + from: 22 + to: 22 } - cidr_block: "0.0.0.0/0" + cidr_block: "0.0.0.0/0" } - rules: { - protocol: "tcp" - priority: 140 - port_range: { - from: 443 - to: 443 + rules: { + protocol: "tcp" + priority: 140 + port_range: { + from: 443 + to: 443 } - cidr_block: "0.0.0.0/0" + cidr_block: "0.0.0.0/0" } } } } } -resources: { - resource_id: "nic_nsg_association_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceSecurityGroupAssociationArgs]: { - network_interface_id: "nic_aws" - security_group_id: "nsg2_aws" +resources: { + resource_id: "nic_nsg_association_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceSecurityGroupAssociationArgs]: { + network_interface_id: "nic_aws" + security_group_id: "nsg2_aws" } } } } -resources: { - resource_id: "nic_nsg_association_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceSecurityGroupAssociationArgs]: { - network_interface_id: "nic_azure" - security_group_id: "nsg2_azure" +resources: { + resource_id: "nic_nsg_association_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceSecurityGroupAssociationArgs]: { + network_interface_id: "nic_azure" + security_group_id: "nsg2_azure" } } } } -resources: { - resource_id: "rg1" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.ResourceGroupArgs]: { - common_parameters: { - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "rg1" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.ResourceGroupArgs]: { + common_parameters: { + location: EU_WEST_1 + cloud_provider: AZURE } - name: "rg1" + name: "rg1" } } } @@ -232,6 +232,7 @@ resources: { # proto-import: api/proto/resourcespb/kubernetes_node_pool.proto # proto-import: api/proto/resourcespb/lambda.proto # proto-import: api/proto/resourcespb/network_interface.proto +# proto-import: api/proto/resourcespb/network_interface_security_group_association.proto # proto-import: api/proto/resourcespb/network_security_group.proto # proto-import: api/proto/resourcespb/public_ip.proto # proto-import: api/proto/resourcespb/resource_group.proto diff --git a/test/_configs/public_ip/public_ip/config.textproto b/test/_configs/public_ip/public_ip/config.textproto index 5dc4974e..5bff71ab 100755 --- a/test/_configs/public_ip/public_ip/config.textproto +++ b/test/_configs/public_ip/public_ip/config.textproto @@ -1,167 +1,167 @@ -resources: { - resource_id: "example_vn_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "example_vn_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "example_vn" - cidr_block: "10.0.0.0/16" + name: "example_vn" + cidr_block: "10.0.0.0/16" } } } } -resources: { - resource_id: "example_vn_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "example_vn_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.VirtualNetworkArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "example_vn" - cidr_block: "10.0.0.0/16" + name: "example_vn" + cidr_block: "10.0.0.0/16" } } } } -resources: { - resource_id: "subnet_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.SubnetArgs]: { - name: "subnet" - cidr_block: "10.0.2.0/24" - virtual_network_id: "example_vn_aws" - availability_zone: 2 +resources: { + resource_id: "subnet_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.SubnetArgs]: { + name: "subnet" + cidr_block: "10.0.2.0/24" + virtual_network_id: "example_vn_aws" + availability_zone: 2 } } } } -resources: { - resource_id: "subnet_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.SubnetArgs]: { - name: "subnet" - cidr_block: "10.0.2.0/24" - virtual_network_id: "example_vn_azure" - availability_zone: 2 +resources: { + resource_id: "subnet_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.SubnetArgs]: { + name: "subnet" + cidr_block: "10.0.2.0/24" + virtual_network_id: "example_vn_azure" + availability_zone: 2 } } } } -resources: { - resource_id: "ip_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.PublicIpArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "ip_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.PublicIpArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "test-ip" + name: "test-ip" } } } } -resources: { - resource_id: "ip_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.PublicIpArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "ip_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.PublicIpArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "test-ip" + name: "test-ip" } } } } -resources: { - resource_id: "public-nic_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "public-nic_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "test-public-nic" - subnet_id: "subnet_azure" - public_ip_id: "ip_azure" + name: "test-public-nic" + subnet_id: "subnet_azure" + public_ip_id: "ip_azure" } } } } -resources: { - resource_id: "public-nic_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "public-nic_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "test-public-nic" - subnet_id: "subnet_aws" - public_ip_id: "ip_aws" + name: "test-public-nic" + subnet_id: "subnet_aws" + public_ip_id: "ip_aws" } } } } -resources: { - resource_id: "private-nic_aws" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AWS +resources: { + resource_id: "private-nic_aws" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AWS } - name: "test-private-nic" - subnet_id: "subnet_aws" + name: "test-private-nic" + subnet_id: "subnet_aws" } } } } -resources: { - resource_id: "private-nic_azure" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { - common_parameters: { - resource_group_id: "rg1" - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "private-nic_azure" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.NetworkInterfaceArgs]: { + common_parameters: { + resource_group_id: "rg1" + location: EU_WEST_1 + cloud_provider: AZURE } - name: "test-private-nic" - subnet_id: "subnet_azure" + name: "test-private-nic" + subnet_id: "subnet_azure" } } } } -resources: { - resource_id: "rg1" - resource_args: { - resource_args: { - [type.googleapis.com/dev.multy.resources.ResourceGroupArgs]: { - common_parameters: { - location: EU_WEST_1 - cloud_provider: AZURE +resources: { + resource_id: "rg1" + resource_args: { + resource_args: { + [type.googleapis.com/dev.multy.resources.ResourceGroupArgs]: { + common_parameters: { + location: EU_WEST_1 + cloud_provider: AZURE } - name: "rg1" + name: "rg1" } } }