Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 3.76 KB

File metadata and controls

78 lines (56 loc) · 3.76 KB

Description

This modules create a resource policy for compute engines. This policy can be passed to a gke-node-pool module to apply the policy on the node-pool's nodes.

Note: By default, you can't apply compact placement policies with a max distance value to A3 VMs. To request access to this feature, contact your Technical Account Manager (TAM) or the Sales team.

Example

The following example creates a group placement resource policy and applies it to a gke-node-pool.

  - id: group_placement_1
    source: modules/compute/resource-policy
    settings:
      name: gp-np-1
      group_placement_max_distance: 2

  - id: node_pool_1
    source: modules/compute/gke-node-pool
    use: [group_placement_1]
    settings:
      machine_type: e2-standard-8
    outputs: [instructions]

Copyright 2024 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Requirements

Name Version
terraform >= 1.3
google-beta ~> 5.0

Providers

Name Version
google-beta ~> 5.0

Modules

No modules.

Resources

Name Type
google-beta_google_compute_resource_policy.policy resource

Inputs

Name Description Type Default Required
group_placement_max_distance The max distance for group placement policy to use for the node pool's nodes. If set it will add a compact group placement policy.
Note: Placement policies have the following restrictions.
number 0 no
name The resource policy's name. string n/a yes
project_id The project ID for the resource policy. string n/a yes
region The region for the the resource policy. string n/a yes

Outputs

Name Description
placement_policy Group placement policy to use for placing VMs or GKE nodes placement. COMPACT is the only supported value for type currently. name is the name of the placement policy.
It is assumed that the specified policy exists. To create a placement policy refer to https://cloud.google.com/sdk/gcloud/reference/compute/resource-policies/create/group-placement.
Note: Placement policies have the following restrictions.