Skip to content

googleContainerAzureNodePool

An Anthos node pool running on Azure.

For more information, see:

Example Usage - basic_azure_node_pool

A basic example of a containerazure azure node pool

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleContainerAzureClientBasic =
  new google.containerAzureClient.ContainerAzureClient(this, "basic", {
    application_id: "12345678-1234-1234-1234-123456789111",
    location: "us-west1",
    name: "client-name",
    project: "my-project-name",
    tenant_id: "12345678-1234-1234-1234-123456789111",
  });
const dataGoogleContainerAzureVersionsVersions =
  new google.dataGoogleContainerAzureVersions.DataGoogleContainerAzureVersions(
    this,
    "versions",
    {
      location: "us-west1",
      project: "my-project-name",
    }
  );
const googleContainerAzureClusterPrimary =
  new google.containerAzureCluster.ContainerAzureCluster(this, "primary", {
    authorization: [
      {
        admin_users: [
          {
            username: "mmv2@google.com",
          },
        ],
      },
    ],
    azure_region: "westus2",
    client: `projects/my-project-number/locations/us-west1/azureClients/\${${googleContainerAzureClientBasic.name}}`,
    control_plane: [
      {
        ssh_config: [
          {
            authorized_key:
              "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC8yaayO6lnb2v+SedxUMa2c8vtIEzCzBjM3EJJsv8Vm9zUDWR7dXWKoNGARUb2mNGXASvI6mFIDXTIlkQ0poDEPpMaXR0g2cb5xT8jAAJq7fqXL3+0rcJhY/uigQ+MrT6s+ub0BFVbsmGHNrMQttXX9gtmwkeAEvj3mra9e5pkNf90qlKnZz6U0SVArxVsLx07vHPHDIYrl0OPG4zUREF52igbBPiNrHJFDQJT/4YlDMJmo/QT/A1D6n9ocemvZSzhRx15/Arjowhr+VVKSbaxzPtEfY0oIg2SrqJnnr/l3Du5qIefwh5VmCZe4xopPUaDDoOIEFriZ88sB+3zz8ib8sk8zJJQCgeP78tQvXCgS+4e5W3TUg9mxjB6KjXTyHIVhDZqhqde0OI3Fy1UuVzRUwnBaLjBnAwP5EoFQGRmDYk/rEYe7HTmovLeEBUDQocBQKT4Ripm/xJkkWY7B07K/tfo56dGUCkvyIVXKBInCh+dLK7gZapnd4UWkY0xBYcwo1geMLRq58iFTLA2j/JmpmHXp7m0l7jJii7d44uD3tTIFYThn7NlOnvhLim/YcBK07GMGIN7XwrrKZKmxXaspw6KBWVhzuw1UPxctxshYEaMLfFg/bwOw8HvMPr9VtrElpSB7oiOh91PDIPdPBgHCi7N2QgQ5l/ZDBHieSpNrQ== thomasrodgers",
          },
        ],
        subnet_id:
          "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-byo/providers/Microsoft.Network/virtualNetworks/my--dev-vnet/subnets/default",
        version: `\${${dataGoogleContainerAzureVersionsVersions.validVersions.fqn}[0]}`,
      },
    ],
    fleet: [
      {
        project: "my-project-number",
      },
    ],
    location: "us-west1",
    name: "name",
    networking: [
      {
        pod_address_cidr_blocks: ["10.200.0.0/16"],
        service_address_cidr_blocks: ["10.32.0.0/24"],
        virtual_network_id:
          "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-byo/providers/Microsoft.Network/virtualNetworks/my--dev-vnet",
      },
    ],
    project: "my-project-name",
    resource_group_id:
      "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-cluster",
  });
const googleContainerAzureNodePoolPrimary =
  new google.containerAzureNodePool.ContainerAzureNodePool(this, "primary_3", {
    annotations: [
      {
        "annotation-one": "value-one",
      },
    ],
    autoscaling: [
      {
        max_node_count: 3,
        min_node_count: 2,
      },
    ],
    cluster: googleContainerAzureClusterPrimary.name,
    config: [
      {
        proxy_config: [
          {
            resource_group_id:
              "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-cluster",
            secret_id:
              "https://my--dev-keyvault.vault.azure.net/secrets/my--dev-secret/0000000000000000000000000000000000",
          },
        ],
        root_volume: [
          {
            size_gib: 32,
          },
        ],
        ssh_config: [
          {
            authorized_key:
              "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC8yaayO6lnb2v+SedxUMa2c8vtIEzCzBjM3EJJsv8Vm9zUDWR7dXWKoNGARUb2mNGXASvI6mFIDXTIlkQ0poDEPpMaXR0g2cb5xT8jAAJq7fqXL3+0rcJhY/uigQ+MrT6s+ub0BFVbsmGHNrMQttXX9gtmwkeAEvj3mra9e5pkNf90qlKnZz6U0SVArxVsLx07vHPHDIYrl0OPG4zUREF52igbBPiNrHJFDQJT/4YlDMJmo/QT/A1D6n9ocemvZSzhRx15/Arjowhr+VVKSbaxzPtEfY0oIg2SrqJnnr/l3Du5qIefwh5VmCZe4xopPUaDDoOIEFriZ88sB+3zz8ib8sk8zJJQCgeP78tQvXCgS+4e5W3TUg9mxjB6KjXTyHIVhDZqhqde0OI3Fy1UuVzRUwnBaLjBnAwP5EoFQGRmDYk/rEYe7HTmovLeEBUDQocBQKT4Ripm/xJkkWY7B07K/tfo56dGUCkvyIVXKBInCh+dLK7gZapnd4UWkY0xBYcwo1geMLRq58iFTLA2j/JmpmHXp7m0l7jJii7d44uD3tTIFYThn7NlOnvhLim/YcBK07GMGIN7XwrrKZKmxXaspw6KBWVhzuw1UPxctxshYEaMLfFg/bwOw8HvMPr9VtrElpSB7oiOh91PDIPdPBgHCi7N2QgQ5l/ZDBHieSpNrQ== thomasrodgers",
          },
        ],
        tags: {
          owner: "mmv2",
        },
        vm_size: "Standard_DS2_v2",
      },
    ],
    location: "us-west1",
    max_pods_constraint: [
      {
        max_pods_per_node: 110,
      },
    ],
    name: "node-pool-name",
    project: "my-project-name",
    subnet_id:
      "/subscriptions/12345678-1234-1234-1234-123456789111/resourceGroups/my--dev-byo/providers/Microsoft.Network/virtualNetworks/my--dev-vnet/subnets/default",
    version: `\${${dataGoogleContainerAzureVersionsVersions.validVersions.fqn}[0]}`,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleContainerAzureNodePoolPrimary.overrideLogicalId("primary");

Argument Reference

The following arguments are supported:

  • autoscaling - (Required) Autoscaler configuration for this node pool.

  • cluster - (Required) The azureCluster for the resource

  • config - (Required) The node configuration of the node pool.

  • location - (Required) The location for the resource

  • maxPodsConstraint - (Required) The constraint on the maximum number of pods that can be run simultaneously on a node in the node pool.

  • name - (Required) The name of this resource.

  • subnetId - (Required) The ARM ID of the subnet where the node pool VMs run. Make sure it's a subnet under the virtual network in the cluster configuration.

  • version - (Required) The Kubernetes version (e.g. 11910Gke1000) running on this node pool.

The autoscaling block supports:

  • maxNodeCount - (Required) Maximum number of nodes in the node pool. Must be >= min_node_count.

  • minNodeCount - (Required) Minimum number of nodes in the node pool. Must be >= 1 and <= max_node_count.

The config block supports:

  • imageType - (Optional) (Beta only) The OS image type to use on node pool instances.

  • proxyConfig - (Optional) Proxy configuration for outbound HTTP(S) traffic.

  • rootVolume - (Optional) Optional. Configuration related to the root volume provisioned for each node pool machine. When unspecified, it defaults to a 32-GiB Azure Disk.

  • sshConfig - (Required) SSH configuration for how to access the node pool machines.

  • tags - (Optional) Optional. A set of tags to apply to all underlying Azure resources for this node pool. This currently only includes Virtual Machine Scale Sets. Specify at most 50 pairs containing alphanumerics, spaces, and symbols (.+-=_:@/). Keys can be up to 127 Unicode characters. Values can be up to 255 Unicode characters.

  • vmSize - (Optional) Optional. The Azure VM size name. Example: standardDs2V2. See (/anthos/clusters/docs/azure/reference/supported-vms) for options. When unspecified, it defaults to standardDs2V2.

The sshConfig block supports:

  • authorizedKey - (Required) The SSH public key data for VMs managed by Anthos. This accepts the authorized_keys file format used in OpenSSH according to the sshd(8) manual page.

The maxPodsConstraint block supports:

  • maxPodsPerNode - (Required) The maximum number of pods to schedule on a single node.

  • annotations - (Optional) Optional. Annotations on the node pool. This field has the same restrictions as Kubernetes annotations. The total size of all keys and values combined is limited to 256k. Keys can have 2 segments: prefix (optional) and name (required), separated by a slash (/). Prefix must be a DNS subdomain. Name must be 63 characters or less, begin and end with alphanumerics, with dashes (-), underscores (_), dots (.), and alphanumerics between.

  • azureAvailabilityZone - (Optional) Optional. The Azure availability zone of the nodes in this nodepool. When unspecified, it defaults to 1.

  • project - (Optional) The project for the resource

The proxyConfig block supports:

  • resourceGroupId - (Required) The ARM ID the of the resource group containing proxy keyvault. Resource group ids are formatted as /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>

  • secretId - (Required) The URL the of the proxy setting secret with its version. Secret ids are formatted as https:<keyVaultName>VaultAzureNet/secrets/<secretName>/<secretVersion>.

The rootVolume block supports:

  • sizeGib - (Optional) Optional. The size of the disk, in GiBs. When unspecified, a default value is provided. See the specific reference in the parent resource.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/azureClusters/{{cluster}}/azureNodePools/{{name}}

  • createTime - Output only. The time at which this node pool was created.

  • etag - Allows clients to perform consistent read-modify-writes through optimistic concurrency control. May be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

  • reconciling - Output only. If set, there are currently pending changes to the node pool.

  • state - Output only. The current state of the node pool. Possible values: STATE_UNSPECIFIED, PROVISIONING, RUNNING, RECONCILING, STOPPING, ERROR, DEGRADED

  • uid - Output only. A globally unique identifier for the node pool.

  • updateTime - Output only. The time at which this node pool was last updated.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

NodePool can be imported using any of these accepted formats:

$ terraform import google_container_azure_node_pool.default projects/{{project}}/locations/{{location}}/azureClusters/{{cluster}}/azureNodePools/{{name}}
$ terraform import google_container_azure_node_pool.default {{project}}/{{location}}/{{cluster}}/{{name}}
$ terraform import google_container_azure_node_pool.default {{location}}/{{cluster}}/{{name}}