1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getResourcePolicy
Google Cloud Classic v7.2.2 published on Monday, Jan 1, 0001 by Pulumi

gcp.compute.getResourcePolicy

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.2.2 published on Monday, Jan 1, 0001 by Pulumi

    Provide access to a Resource Policy’s attributes. For more information see the official documentation or the API.

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const daily = gcp.compute.getResourcePolicy({
        name: "daily",
        region: "us-central1",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    daily = gcp.compute.get_resource_policy(name="daily",
        region="us-central1")
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var daily = Gcp.Compute.GetResourcePolicy.Invoke(new()
        {
            Name = "daily",
            Region = "us-central1",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.LookupResourcePolicy(ctx, &compute.LookupResourcePolicyArgs{
    			Name:   "daily",
    			Region: pulumi.StringRef("us-central1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetResourcePolicyArgs;
    import java.util.List;
    import java.util.ArrayList;
    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) {
            final var daily = ComputeFunctions.getResourcePolicy(GetResourcePolicyArgs.builder()
                .name("daily")
                .region("us-central1")
                .build());
    
        }
    }
    
    variables:
      daily:
        fn::invoke:
          Function: gcp:compute:getResourcePolicy
          Arguments:
            name: daily
            region: us-central1
    

    Using getResourcePolicy

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getResourcePolicy(args: GetResourcePolicyArgs, opts?: InvokeOptions): Promise<GetResourcePolicyResult>
    function getResourcePolicyOutput(args: GetResourcePolicyOutputArgs, opts?: InvokeOptions): Output<GetResourcePolicyResult>
    def get_resource_policy(name: Optional[str] = None,
                            project: Optional[str] = None,
                            region: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetResourcePolicyResult
    def get_resource_policy_output(name: Optional[pulumi.Input[str]] = None,
                            project: Optional[pulumi.Input[str]] = None,
                            region: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetResourcePolicyResult]
    func LookupResourcePolicy(ctx *Context, args *LookupResourcePolicyArgs, opts ...InvokeOption) (*LookupResourcePolicyResult, error)
    func LookupResourcePolicyOutput(ctx *Context, args *LookupResourcePolicyOutputArgs, opts ...InvokeOption) LookupResourcePolicyResultOutput

    > Note: This function is named LookupResourcePolicy in the Go SDK.

    public static class GetResourcePolicy 
    {
        public static Task<GetResourcePolicyResult> InvokeAsync(GetResourcePolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetResourcePolicyResult> Invoke(GetResourcePolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourcePolicyResult> getResourcePolicy(GetResourcePolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:compute/getResourcePolicy:getResourcePolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string

    The name of the Resource Policy.

    Project string

    Project from which to list the Resource Policy. Defaults to project declared in the provider.

    Region string

    Region where the Resource Policy resides.

    Name string

    The name of the Resource Policy.

    Project string

    Project from which to list the Resource Policy. Defaults to project declared in the provider.

    Region string

    Region where the Resource Policy resides.

    name String

    The name of the Resource Policy.

    project String

    Project from which to list the Resource Policy. Defaults to project declared in the provider.

    region String

    Region where the Resource Policy resides.

    name string

    The name of the Resource Policy.

    project string

    Project from which to list the Resource Policy. Defaults to project declared in the provider.

    region string

    Region where the Resource Policy resides.

    name str

    The name of the Resource Policy.

    project str

    Project from which to list the Resource Policy. Defaults to project declared in the provider.

    region str

    Region where the Resource Policy resides.

    name String

    The name of the Resource Policy.

    project String

    Project from which to list the Resource Policy. Defaults to project declared in the provider.

    region String

    Region where the Resource Policy resides.

    getResourcePolicy Result

    The following output properties are available:

    description String

    Description of this Resource Policy.

    diskConsistencyGroupPolicies List<Property Map>
    groupPlacementPolicies List<Property Map>
    id String

    The provider-assigned unique ID for this managed resource.

    instanceSchedulePolicies List<Property Map>
    name String
    selfLink String

    The URI of the resource.

    snapshotSchedulePolicies List<Property Map>
    project String
    region String

    Supporting Types

    GetResourcePolicyDiskConsistencyGroupPolicy

    Enabled bool
    Enabled bool
    enabled Boolean
    enabled boolean
    enabled bool
    enabled Boolean

    GetResourcePolicyGroupPlacementPolicy

    GetResourcePolicyInstanceSchedulePolicy

    GetResourcePolicyInstanceSchedulePolicyVmStartSchedule

    Schedule string
    Schedule string
    schedule String
    schedule string
    schedule String

    GetResourcePolicyInstanceSchedulePolicyVmStopSchedule

    Schedule string
    Schedule string
    schedule String
    schedule string
    schedule String

    GetResourcePolicySnapshotSchedulePolicy

    GetResourcePolicySnapshotSchedulePolicyRetentionPolicy

    GetResourcePolicySnapshotSchedulePolicySchedule

    GetResourcePolicySnapshotSchedulePolicyScheduleDailySchedule

    daysInCycle Integer
    startTime String
    daysInCycle number
    startTime string
    daysInCycle Number
    startTime String

    GetResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule

    hoursInCycle Integer
    startTime String
    hoursInCycle number
    startTime string
    hoursInCycle Number
    startTime String

    GetResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule

    GetResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeek

    Day string
    StartTime string
    Day string
    StartTime string
    day String
    startTime String
    day string
    startTime string
    day String
    startTime String

    GetResourcePolicySnapshotSchedulePolicySnapshotProperty

    ChainName string
    GuestFlush bool
    Labels Dictionary<string, string>
    StorageLocations List<string>
    ChainName string
    GuestFlush bool
    Labels map[string]string
    StorageLocations []string
    chainName String
    guestFlush Boolean
    labels Map<String,String>
    storageLocations List<String>
    chainName string
    guestFlush boolean
    labels {[key: string]: string}
    storageLocations string[]
    chain_name str
    guest_flush bool
    labels Mapping[str, str]
    storage_locations Sequence[str]
    chainName String
    guestFlush Boolean
    labels Map<String>
    storageLocations List<String>

    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
    Google Cloud Classic v7.2.2 published on Monday, Jan 1, 0001 by Pulumi