gcp.compute.getResourcePolicy
Explore with Pulumi AI
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:
getResourcePolicy Result
The following output properties are available:
- Description string
Description of this Resource Policy.
- Disk
Consistency List<GetGroup Policies Resource Policy Disk Consistency Group Policy> - Group
Placement List<GetPolicies Resource Policy Group Placement Policy> - Id string
The provider-assigned unique ID for this managed resource.
- Instance
Schedule List<GetPolicies Resource Policy Instance Schedule Policy> - Name string
- Self
Link string The URI of the resource.
- Snapshot
Schedule List<GetPolicies Resource Policy Snapshot Schedule Policy> - Project string
- Region string
- Description string
Description of this Resource Policy.
- Disk
Consistency []GetGroup Policies Resource Policy Disk Consistency Group Policy - Group
Placement []GetPolicies Resource Policy Group Placement Policy - Id string
The provider-assigned unique ID for this managed resource.
- Instance
Schedule []GetPolicies Resource Policy Instance Schedule Policy - Name string
- Self
Link string The URI of the resource.
- Snapshot
Schedule []GetPolicies Resource Policy Snapshot Schedule Policy - Project string
- Region string
- description String
Description of this Resource Policy.
- disk
Consistency List<GetGroup Policies Resource Policy Disk Consistency Group Policy> - group
Placement List<GetPolicies Resource Policy Group Placement Policy> - id String
The provider-assigned unique ID for this managed resource.
- instance
Schedule List<GetPolicies Resource Policy Instance Schedule Policy> - name String
- self
Link String The URI of the resource.
- snapshot
Schedule List<GetPolicies Resource Policy Snapshot Schedule Policy> - project String
- region String
- description string
Description of this Resource Policy.
- disk
Consistency GetGroup Policies Resource Policy Disk Consistency Group Policy[] - group
Placement GetPolicies Resource Policy Group Placement Policy[] - id string
The provider-assigned unique ID for this managed resource.
- instance
Schedule GetPolicies Resource Policy Instance Schedule Policy[] - name string
- self
Link string The URI of the resource.
- snapshot
Schedule GetPolicies Resource Policy Snapshot Schedule Policy[] - project string
- region string
- description str
Description of this Resource Policy.
- disk_
consistency_ Sequence[Getgroup_ policies Resource Policy Disk Consistency Group Policy] - group_
placement_ Sequence[Getpolicies Resource Policy Group Placement Policy] - id str
The provider-assigned unique ID for this managed resource.
- instance_
schedule_ Sequence[Getpolicies Resource Policy Instance Schedule Policy] - name str
- self_
link str The URI of the resource.
- snapshot_
schedule_ Sequence[Getpolicies Resource Policy Snapshot Schedule Policy] - project str
- region str
- description String
Description of this Resource Policy.
- disk
Consistency List<Property Map>Group Policies - group
Placement List<Property Map>Policies - id String
The provider-assigned unique ID for this managed resource.
- instance
Schedule List<Property Map>Policies - name String
- self
Link String The URI of the resource.
- snapshot
Schedule List<Property Map>Policies - project String
- region String
Supporting Types
GetResourcePolicyDiskConsistencyGroupPolicy
- Enabled bool
- Enabled bool
- enabled Boolean
- enabled boolean
- enabled bool
- enabled Boolean
GetResourcePolicyGroupPlacementPolicy
- Availability
Domain intCount - Collocation string
- Max
Distance int - Vm
Count int
- Availability
Domain intCount - Collocation string
- Max
Distance int - Vm
Count int
- availability
Domain IntegerCount - collocation String
- max
Distance Integer - vm
Count Integer
- availability
Domain numberCount - collocation string
- max
Distance number - vm
Count number
- availability_
domain_ intcount - collocation str
- max_
distance int - vm_
count int
- availability
Domain NumberCount - collocation String
- max
Distance Number - vm
Count Number
GetResourcePolicyInstanceSchedulePolicy
GetResourcePolicyInstanceSchedulePolicyVmStartSchedule
- Schedule string
- Schedule string
- schedule String
- schedule string
- schedule str
- schedule String
GetResourcePolicyInstanceSchedulePolicyVmStopSchedule
- Schedule string
- Schedule string
- schedule String
- schedule string
- schedule str
- schedule String
GetResourcePolicySnapshotSchedulePolicy
GetResourcePolicySnapshotSchedulePolicyRetentionPolicy
- Max
Retention intDays - On
Source stringDisk Delete
- Max
Retention intDays - On
Source stringDisk Delete
- max
Retention IntegerDays - on
Source StringDisk Delete
- max
Retention numberDays - on
Source stringDisk Delete
- max
Retention NumberDays - on
Source StringDisk Delete
GetResourcePolicySnapshotSchedulePolicySchedule
GetResourcePolicySnapshotSchedulePolicyScheduleDailySchedule
- Days
In intCycle - Start
Time string
- Days
In intCycle - Start
Time string
- days
In IntegerCycle - start
Time String
- days
In numberCycle - start
Time string
- days_
in_ intcycle - start_
time str
- days
In NumberCycle - start
Time String
GetResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule
- Hours
In intCycle - Start
Time string
- Hours
In intCycle - Start
Time string
- hours
In IntegerCycle - start
Time String
- hours
In numberCycle - start
Time string
- hours_
in_ intcycle - start_
time str
- hours
In NumberCycle - start
Time String
GetResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule
GetResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeek
- day str
- start_
time str
GetResourcePolicySnapshotSchedulePolicySnapshotProperty
- Chain
Name string - Guest
Flush bool - Labels Dictionary<string, string>
- Storage
Locations List<string>
- Chain
Name string - Guest
Flush bool - Labels map[string]string
- Storage
Locations []string
- chain
Name String - guest
Flush Boolean - labels Map<String,String>
- storage
Locations List<String>
- chain
Name string - guest
Flush boolean - labels {[key: string]: string}
- storage
Locations string[]
- chain_
name str - guest_
flush bool - labels Mapping[str, str]
- storage_
locations Sequence[str]
- chain
Name String - guest
Flush Boolean - labels Map<String>
- storage
Locations 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.