1. Packages
  2. Packages
  3. Google Cloud (GCP) Classic
  4. API Docs
  5. compute
  6. ZoneVmExtensionPolicy
Viewing docs for Google Cloud v9.32.1
published on Wednesday, Jul 29, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v9.32.1
published on Wednesday, Jul 29, 2026 by Pulumi

    A Zone VM Extension Policy.

    Example Usage

    Compute Zone Vm Extension Policy Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const opsAgentPolicy = new gcp.compute.ZoneVmExtensionPolicy("ops_agent_policy", {
        name: "zonal-ops-agent-vme-policy-_80332",
        zone: "us-central1-a",
        extensionPolicies: [{
            extensionName: "ops-agent",
            pinnedVersion: "2.66.0",
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    ops_agent_policy = gcp.compute.ZoneVmExtensionPolicy("ops_agent_policy",
        name="zonal-ops-agent-vme-policy-_80332",
        zone="us-central1-a",
        extension_policies=[{
            "extension_name": "ops-agent",
            "pinned_version": "2.66.0",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewZoneVmExtensionPolicy(ctx, "ops_agent_policy", &compute.ZoneVmExtensionPolicyArgs{
    			Name: pulumi.String("zonal-ops-agent-vme-policy-_80332"),
    			Zone: pulumi.String("us-central1-a"),
    			ExtensionPolicies: compute.ZoneVmExtensionPolicyExtensionPolicyArray{
    				&compute.ZoneVmExtensionPolicyExtensionPolicyArgs{
    					ExtensionName: pulumi.String("ops-agent"),
    					PinnedVersion: pulumi.String("2.66.0"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var opsAgentPolicy = new Gcp.Compute.ZoneVmExtensionPolicy("ops_agent_policy", new()
        {
            Name = "zonal-ops-agent-vme-policy-_80332",
            Zone = "us-central1-a",
            ExtensionPolicies = new[]
            {
                new Gcp.Compute.Inputs.ZoneVmExtensionPolicyExtensionPolicyArgs
                {
                    ExtensionName = "ops-agent",
                    PinnedVersion = "2.66.0",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.ZoneVmExtensionPolicy;
    import com.pulumi.gcp.compute.ZoneVmExtensionPolicyArgs;
    import com.pulumi.gcp.compute.inputs.ZoneVmExtensionPolicyExtensionPolicyArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var opsAgentPolicy = new ZoneVmExtensionPolicy("opsAgentPolicy", ZoneVmExtensionPolicyArgs.builder()
                .name("zonal-ops-agent-vme-policy-_80332")
                .zone("us-central1-a")
                .extensionPolicies(ZoneVmExtensionPolicyExtensionPolicyArgs.builder()
                    .extensionName("ops-agent")
                    .pinnedVersion("2.66.0")
                    .build())
                .build());
    
        }
    }
    
    resources:
      opsAgentPolicy:
        type: gcp:compute:ZoneVmExtensionPolicy
        name: ops_agent_policy
        properties:
          name: zonal-ops-agent-vme-policy-_80332
          zone: us-central1-a
          extensionPolicies:
            - extensionName: ops-agent
              pinnedVersion: 2.66.0
    
    pulumi {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    resource "gcp_compute_zonevmextensionpolicy" "ops_agent_policy" {
      name = "zonal-ops-agent-vme-policy-_80332"
      zone = "us-central1-a"
      extension_policies {
        extension_name = "ops-agent"
        pinned_version = "2.66.0"
      }
    }
    

    Create ZoneVmExtensionPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ZoneVmExtensionPolicy(name: string, args: ZoneVmExtensionPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ZoneVmExtensionPolicy(resource_name: str,
                              args: ZoneVmExtensionPolicyArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def ZoneVmExtensionPolicy(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              extension_policies: Optional[Sequence[ZoneVmExtensionPolicyExtensionPolicyArgs]] = None,
                              zone: Optional[str] = None,
                              deletion_policy: Optional[str] = None,
                              description: Optional[str] = None,
                              instance_selectors: Optional[Sequence[ZoneVmExtensionPolicyInstanceSelectorArgs]] = None,
                              name: Optional[str] = None,
                              priority: Optional[int] = None,
                              project: Optional[str] = None)
    func NewZoneVmExtensionPolicy(ctx *Context, name string, args ZoneVmExtensionPolicyArgs, opts ...ResourceOption) (*ZoneVmExtensionPolicy, error)
    public ZoneVmExtensionPolicy(string name, ZoneVmExtensionPolicyArgs args, CustomResourceOptions? opts = null)
    public ZoneVmExtensionPolicy(String name, ZoneVmExtensionPolicyArgs args)
    public ZoneVmExtensionPolicy(String name, ZoneVmExtensionPolicyArgs args, CustomResourceOptions options)
    
    type: gcp:compute:ZoneVmExtensionPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "gcp_compute_zone_vm_extension_policy" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ZoneVmExtensionPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ZoneVmExtensionPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ZoneVmExtensionPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ZoneVmExtensionPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ZoneVmExtensionPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var zoneVmExtensionPolicyResource = new Gcp.Compute.ZoneVmExtensionPolicy("zoneVmExtensionPolicyResource", new()
    {
        ExtensionPolicies = new[]
        {
            new Gcp.Compute.Inputs.ZoneVmExtensionPolicyExtensionPolicyArgs
            {
                ExtensionName = "string",
                PinnedVersion = "string",
                StringConfig = "string",
            },
        },
        Zone = "string",
        DeletionPolicy = "string",
        Description = "string",
        InstanceSelectors = new[]
        {
            new Gcp.Compute.Inputs.ZoneVmExtensionPolicyInstanceSelectorArgs
            {
                LabelSelector = new Gcp.Compute.Inputs.ZoneVmExtensionPolicyInstanceSelectorLabelSelectorArgs
                {
                    InclusionLabels = 
                    {
                        { "string", "string" },
                    },
                },
            },
        },
        Name = "string",
        Priority = 0,
        Project = "string",
    });
    
    example, err := compute.NewZoneVmExtensionPolicy(ctx, "zoneVmExtensionPolicyResource", &compute.ZoneVmExtensionPolicyArgs{
    	ExtensionPolicies: compute.ZoneVmExtensionPolicyExtensionPolicyArray{
    		&compute.ZoneVmExtensionPolicyExtensionPolicyArgs{
    			ExtensionName: pulumi.String("string"),
    			PinnedVersion: pulumi.String("string"),
    			StringConfig:  pulumi.String("string"),
    		},
    	},
    	Zone:           pulumi.String("string"),
    	DeletionPolicy: pulumi.String("string"),
    	Description:    pulumi.String("string"),
    	InstanceSelectors: compute.ZoneVmExtensionPolicyInstanceSelectorArray{
    		&compute.ZoneVmExtensionPolicyInstanceSelectorArgs{
    			LabelSelector: &compute.ZoneVmExtensionPolicyInstanceSelectorLabelSelectorArgs{
    				InclusionLabels: pulumi.StringMap{
    					"string": pulumi.String("string"),
    				},
    			},
    		},
    	},
    	Name:     pulumi.String("string"),
    	Priority: pulumi.Int(0),
    	Project:  pulumi.String("string"),
    })
    
    resource "gcp_compute_zone_vm_extension_policy" "zoneVmExtensionPolicyResource" {
      lifecycle {
        create_before_destroy = true
      }
      extension_policies {
        extension_name = "string"
        pinned_version = "string"
        string_config  = "string"
      }
      zone            = "string"
      deletion_policy = "string"
      description     = "string"
      instance_selectors {
        label_selector = {
          inclusion_labels = {
            "string" = "string"
          }
        }
      }
      name     = "string"
      priority = 0
      project  = "string"
    }
    
    var zoneVmExtensionPolicyResource = new ZoneVmExtensionPolicy("zoneVmExtensionPolicyResource", ZoneVmExtensionPolicyArgs.builder()
        .extensionPolicies(ZoneVmExtensionPolicyExtensionPolicyArgs.builder()
            .extensionName("string")
            .pinnedVersion("string")
            .stringConfig("string")
            .build())
        .zone("string")
        .deletionPolicy("string")
        .description("string")
        .instanceSelectors(ZoneVmExtensionPolicyInstanceSelectorArgs.builder()
            .labelSelector(ZoneVmExtensionPolicyInstanceSelectorLabelSelectorArgs.builder()
                .inclusionLabels(Map.of("string", "string"))
                .build())
            .build())
        .name("string")
        .priority(0)
        .project("string")
        .build());
    
    zone_vm_extension_policy_resource = gcp.compute.ZoneVmExtensionPolicy("zoneVmExtensionPolicyResource",
        extension_policies=[{
            "extension_name": "string",
            "pinned_version": "string",
            "string_config": "string",
        }],
        zone="string",
        deletion_policy="string",
        description="string",
        instance_selectors=[{
            "label_selector": {
                "inclusion_labels": {
                    "string": "string",
                },
            },
        }],
        name="string",
        priority=0,
        project="string")
    
    const zoneVmExtensionPolicyResource = new gcp.compute.ZoneVmExtensionPolicy("zoneVmExtensionPolicyResource", {
        extensionPolicies: [{
            extensionName: "string",
            pinnedVersion: "string",
            stringConfig: "string",
        }],
        zone: "string",
        deletionPolicy: "string",
        description: "string",
        instanceSelectors: [{
            labelSelector: {
                inclusionLabels: {
                    string: "string",
                },
            },
        }],
        name: "string",
        priority: 0,
        project: "string",
    });
    
    type: gcp:compute:ZoneVmExtensionPolicy
    properties:
        deletionPolicy: string
        description: string
        extensionPolicies:
            - extensionName: string
              pinnedVersion: string
              stringConfig: string
        instanceSelectors:
            - labelSelector:
                inclusionLabels:
                    string: string
        name: string
        priority: 0
        project: string
        zone: string
    

    ZoneVmExtensionPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ZoneVmExtensionPolicy resource accepts the following input properties:

    ExtensionPolicies List<ZoneVmExtensionPolicyExtensionPolicy>
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    Zone string
    Name of the zone for this request.
    DeletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    Description string
    An optional description of this resource.
    InstanceSelectors List<ZoneVmExtensionPolicyInstanceSelector>
    Selectors to target VMs for this policy. Structure is documented below.
    Name string
    Name of the resource. Provided by the client when the resource is created.
    Priority int
    Priority of this policy.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ExtensionPolicies []ZoneVmExtensionPolicyExtensionPolicyArgs
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    Zone string
    Name of the zone for this request.
    DeletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    Description string
    An optional description of this resource.
    InstanceSelectors []ZoneVmExtensionPolicyInstanceSelectorArgs
    Selectors to target VMs for this policy. Structure is documented below.
    Name string
    Name of the resource. Provided by the client when the resource is created.
    Priority int
    Priority of this policy.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    extension_policies list(object)
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    zone string
    Name of the zone for this request.
    deletion_policy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description string
    An optional description of this resource.
    instance_selectors list(object)
    Selectors to target VMs for this policy. Structure is documented below.
    name string
    Name of the resource. Provided by the client when the resource is created.
    priority number
    Priority of this policy.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    extensionPolicies List<ZoneVmExtensionPolicyExtensionPolicy>
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    zone String
    Name of the zone for this request.
    deletionPolicy String
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description String
    An optional description of this resource.
    instanceSelectors List<ZoneVmExtensionPolicyInstanceSelector>
    Selectors to target VMs for this policy. Structure is documented below.
    name String
    Name of the resource. Provided by the client when the resource is created.
    priority Integer
    Priority of this policy.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    extensionPolicies ZoneVmExtensionPolicyExtensionPolicy[]
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    zone string
    Name of the zone for this request.
    deletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description string
    An optional description of this resource.
    instanceSelectors ZoneVmExtensionPolicyInstanceSelector[]
    Selectors to target VMs for this policy. Structure is documented below.
    name string
    Name of the resource. Provided by the client when the resource is created.
    priority number
    Priority of this policy.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    extension_policies Sequence[ZoneVmExtensionPolicyExtensionPolicyArgs]
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    zone str
    Name of the zone for this request.
    deletion_policy str
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description str
    An optional description of this resource.
    instance_selectors Sequence[ZoneVmExtensionPolicyInstanceSelectorArgs]
    Selectors to target VMs for this policy. Structure is documented below.
    name str
    Name of the resource. Provided by the client when the resource is created.
    priority int
    Priority of this policy.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    extensionPolicies List<Property Map>
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    zone String
    Name of the zone for this request.
    deletionPolicy String
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description String
    An optional description of this resource.
    instanceSelectors List<Property Map>
    Selectors to target VMs for this policy. Structure is documented below.
    name String
    Name of the resource. Provided by the client when the resource is created.
    priority Number
    Priority of this policy.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ZoneVmExtensionPolicy resource produces the following output properties:

    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    Type of the resource.
    ManagedByGlobal bool
    Indicates if this policy is managed by a global policy.
    State string
    Current state of the policy.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    Id string
    The provider-assigned unique ID for this managed resource.
    Kind string
    Type of the resource.
    ManagedByGlobal bool
    Indicates if this policy is managed by a global policy.
    State string
    Current state of the policy.
    creation_timestamp string
    Creation timestamp in RFC3339 text format.
    id string
    The provider-assigned unique ID for this managed resource.
    kind string
    Type of the resource.
    managed_by_global bool
    Indicates if this policy is managed by a global policy.
    state string
    Current state of the policy.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    Type of the resource.
    managedByGlobal Boolean
    Indicates if this policy is managed by a global policy.
    state String
    Current state of the policy.
    creationTimestamp string
    Creation timestamp in RFC3339 text format.
    id string
    The provider-assigned unique ID for this managed resource.
    kind string
    Type of the resource.
    managedByGlobal boolean
    Indicates if this policy is managed by a global policy.
    state string
    Current state of the policy.
    creation_timestamp str
    Creation timestamp in RFC3339 text format.
    id str
    The provider-assigned unique ID for this managed resource.
    kind str
    Type of the resource.
    managed_by_global bool
    Indicates if this policy is managed by a global policy.
    state str
    Current state of the policy.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    id String
    The provider-assigned unique ID for this managed resource.
    kind String
    Type of the resource.
    managedByGlobal Boolean
    Indicates if this policy is managed by a global policy.
    state String
    Current state of the policy.

    Look up Existing ZoneVmExtensionPolicy Resource

    Get an existing ZoneVmExtensionPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ZoneVmExtensionPolicyState, opts?: CustomResourceOptions): ZoneVmExtensionPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            creation_timestamp: Optional[str] = None,
            deletion_policy: Optional[str] = None,
            description: Optional[str] = None,
            extension_policies: Optional[Sequence[ZoneVmExtensionPolicyExtensionPolicyArgs]] = None,
            instance_selectors: Optional[Sequence[ZoneVmExtensionPolicyInstanceSelectorArgs]] = None,
            kind: Optional[str] = None,
            managed_by_global: Optional[bool] = None,
            name: Optional[str] = None,
            priority: Optional[int] = None,
            project: Optional[str] = None,
            state: Optional[str] = None,
            zone: Optional[str] = None) -> ZoneVmExtensionPolicy
    func GetZoneVmExtensionPolicy(ctx *Context, name string, id IDInput, state *ZoneVmExtensionPolicyState, opts ...ResourceOption) (*ZoneVmExtensionPolicy, error)
    public static ZoneVmExtensionPolicy Get(string name, Input<string> id, ZoneVmExtensionPolicyState? state, CustomResourceOptions? opts = null)
    public static ZoneVmExtensionPolicy get(String name, Output<String> id, ZoneVmExtensionPolicyState state, CustomResourceOptions options)
    resources:  _:    type: gcp:compute:ZoneVmExtensionPolicy    get:      id: ${id}
    import {
      to = gcp_compute_zone_vm_extension_policy.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    DeletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    Description string
    An optional description of this resource.
    ExtensionPolicies List<ZoneVmExtensionPolicyExtensionPolicy>
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    InstanceSelectors List<ZoneVmExtensionPolicyInstanceSelector>
    Selectors to target VMs for this policy. Structure is documented below.
    Kind string
    Type of the resource.
    ManagedByGlobal bool
    Indicates if this policy is managed by a global policy.
    Name string
    Name of the resource. Provided by the client when the resource is created.
    Priority int
    Priority of this policy.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    State string
    Current state of the policy.
    Zone string
    Name of the zone for this request.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    DeletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    Description string
    An optional description of this resource.
    ExtensionPolicies []ZoneVmExtensionPolicyExtensionPolicyArgs
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    InstanceSelectors []ZoneVmExtensionPolicyInstanceSelectorArgs
    Selectors to target VMs for this policy. Structure is documented below.
    Kind string
    Type of the resource.
    ManagedByGlobal bool
    Indicates if this policy is managed by a global policy.
    Name string
    Name of the resource. Provided by the client when the resource is created.
    Priority int
    Priority of this policy.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    State string
    Current state of the policy.
    Zone string
    Name of the zone for this request.
    creation_timestamp string
    Creation timestamp in RFC3339 text format.
    deletion_policy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description string
    An optional description of this resource.
    extension_policies list(object)
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    instance_selectors list(object)
    Selectors to target VMs for this policy. Structure is documented below.
    kind string
    Type of the resource.
    managed_by_global bool
    Indicates if this policy is managed by a global policy.
    name string
    Name of the resource. Provided by the client when the resource is created.
    priority number
    Priority of this policy.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state string
    Current state of the policy.
    zone string
    Name of the zone for this request.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    deletionPolicy String
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description String
    An optional description of this resource.
    extensionPolicies List<ZoneVmExtensionPolicyExtensionPolicy>
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    instanceSelectors List<ZoneVmExtensionPolicyInstanceSelector>
    Selectors to target VMs for this policy. Structure is documented below.
    kind String
    Type of the resource.
    managedByGlobal Boolean
    Indicates if this policy is managed by a global policy.
    name String
    Name of the resource. Provided by the client when the resource is created.
    priority Integer
    Priority of this policy.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state String
    Current state of the policy.
    zone String
    Name of the zone for this request.
    creationTimestamp string
    Creation timestamp in RFC3339 text format.
    deletionPolicy string
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description string
    An optional description of this resource.
    extensionPolicies ZoneVmExtensionPolicyExtensionPolicy[]
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    instanceSelectors ZoneVmExtensionPolicyInstanceSelector[]
    Selectors to target VMs for this policy. Structure is documented below.
    kind string
    Type of the resource.
    managedByGlobal boolean
    Indicates if this policy is managed by a global policy.
    name string
    Name of the resource. Provided by the client when the resource is created.
    priority number
    Priority of this policy.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state string
    Current state of the policy.
    zone string
    Name of the zone for this request.
    creation_timestamp str
    Creation timestamp in RFC3339 text format.
    deletion_policy str
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description str
    An optional description of this resource.
    extension_policies Sequence[ZoneVmExtensionPolicyExtensionPolicyArgs]
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    instance_selectors Sequence[ZoneVmExtensionPolicyInstanceSelectorArgs]
    Selectors to target VMs for this policy. Structure is documented below.
    kind str
    Type of the resource.
    managed_by_global bool
    Indicates if this policy is managed by a global policy.
    name str
    Name of the resource. Provided by the client when the resource is created.
    priority int
    Priority of this policy.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state str
    Current state of the policy.
    zone str
    Name of the zone for this request.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    deletionPolicy String
    Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
    description String
    An optional description of this resource.
    extensionPolicies List<Property Map>
    A map of extension names (for example, "ops-agent") to their corresponding policy configurations. Structure is documented below.
    instanceSelectors List<Property Map>
    Selectors to target VMs for this policy. Structure is documented below.
    kind String
    Type of the resource.
    managedByGlobal Boolean
    Indicates if this policy is managed by a global policy.
    name String
    Name of the resource. Provided by the client when the resource is created.
    priority Number
    Priority of this policy.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state String
    Current state of the policy.
    zone String
    Name of the zone for this request.

    Supporting Types

    ZoneVmExtensionPolicyExtensionPolicy, ZoneVmExtensionPolicyExtensionPolicyArgs

    ExtensionName string
    The identifier for this object. Format specified above.
    PinnedVersion string
    The specific version of the extension to install.
    StringConfig string
    String-based configuration data for the extension.
    ExtensionName string
    The identifier for this object. Format specified above.
    PinnedVersion string
    The specific version of the extension to install.
    StringConfig string
    String-based configuration data for the extension.
    extension_name string
    The identifier for this object. Format specified above.
    pinned_version string
    The specific version of the extension to install.
    string_config string
    String-based configuration data for the extension.
    extensionName String
    The identifier for this object. Format specified above.
    pinnedVersion String
    The specific version of the extension to install.
    stringConfig String
    String-based configuration data for the extension.
    extensionName string
    The identifier for this object. Format specified above.
    pinnedVersion string
    The specific version of the extension to install.
    stringConfig string
    String-based configuration data for the extension.
    extension_name str
    The identifier for this object. Format specified above.
    pinned_version str
    The specific version of the extension to install.
    string_config str
    String-based configuration data for the extension.
    extensionName String
    The identifier for this object. Format specified above.
    pinnedVersion String
    The specific version of the extension to install.
    stringConfig String
    String-based configuration data for the extension.

    ZoneVmExtensionPolicyInstanceSelector, ZoneVmExtensionPolicyInstanceSelectorArgs

    LabelSelector ZoneVmExtensionPolicyInstanceSelectorLabelSelector
    LabelSelector matches VM labels. Structure is documented below.
    LabelSelector ZoneVmExtensionPolicyInstanceSelectorLabelSelector
    LabelSelector matches VM labels. Structure is documented below.
    label_selector object
    LabelSelector matches VM labels. Structure is documented below.
    labelSelector ZoneVmExtensionPolicyInstanceSelectorLabelSelector
    LabelSelector matches VM labels. Structure is documented below.
    labelSelector ZoneVmExtensionPolicyInstanceSelectorLabelSelector
    LabelSelector matches VM labels. Structure is documented below.
    label_selector ZoneVmExtensionPolicyInstanceSelectorLabelSelector
    LabelSelector matches VM labels. Structure is documented below.
    labelSelector Property Map
    LabelSelector matches VM labels. Structure is documented below.

    ZoneVmExtensionPolicyInstanceSelectorLabelSelector, ZoneVmExtensionPolicyInstanceSelectorLabelSelectorArgs

    InclusionLabels Dictionary<string, string>
    A map of key-value pairs representing VM labels.
    InclusionLabels map[string]string
    A map of key-value pairs representing VM labels.
    inclusion_labels map(string)
    A map of key-value pairs representing VM labels.
    inclusionLabels Map<String,String>
    A map of key-value pairs representing VM labels.
    inclusionLabels {[key: string]: string}
    A map of key-value pairs representing VM labels.
    inclusion_labels Mapping[str, str]
    A map of key-value pairs representing VM labels.
    inclusionLabels Map<String>
    A map of key-value pairs representing VM labels.

    Import

    ZoneVmExtensionPolicy can be imported using any of these accepted formats:

    • projects/{{project}}/zones/{{zone}}/vmExtensionPolicies/{{name}}
    • {{project}}/{{zone}}/{{name}}
    • {{zone}}/{{name}}
    • {{name}}

    When using the pulumi import command, ZoneVmExtensionPolicy can be imported using one of the formats above. For example:

    $ pulumi import gcp:compute/zoneVmExtensionPolicy:ZoneVmExtensionPolicy default projects/{{project}}/zones/{{zone}}/vmExtensionPolicies/{{name}}
    $ pulumi import gcp:compute/zoneVmExtensionPolicy:ZoneVmExtensionPolicy default {{project}}/{{zone}}/{{name}}
    $ pulumi import gcp:compute/zoneVmExtensionPolicy:ZoneVmExtensionPolicy default {{zone}}/{{name}}
    $ pulumi import gcp:compute/zoneVmExtensionPolicy:ZoneVmExtensionPolicy default {{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Viewing docs for Google Cloud v9.32.1
    published on Wednesday, Jul 29, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial