/
getRegionSnapshotIamPolicy.go
110 lines (91 loc) · 9.14 KB
/
getRegionSnapshotIamPolicy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package alpha
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets the access control policy for a resource. May be empty if no such policy or resource exists.
func LookupRegionSnapshotIamPolicy(ctx *pulumi.Context, args *LookupRegionSnapshotIamPolicyArgs, opts ...pulumi.InvokeOption) (*LookupRegionSnapshotIamPolicyResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupRegionSnapshotIamPolicyResult
err := ctx.Invoke("google-native:compute/alpha:getRegionSnapshotIamPolicy", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupRegionSnapshotIamPolicyArgs struct {
OptionsRequestedPolicyVersion *int `pulumi:"optionsRequestedPolicyVersion"`
Project *string `pulumi:"project"`
Region string `pulumi:"region"`
Resource string `pulumi:"resource"`
}
type LookupRegionSnapshotIamPolicyResult struct {
// Specifies cloud audit logging configuration for this policy.
AuditConfigs []AuditConfigResponse `pulumi:"auditConfigs"`
// Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.
Bindings []BindingResponse `pulumi:"bindings"`
// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
Etag string `pulumi:"etag"`
// This is deprecated and has no effect. Do not use.
Rules []RuleResponse `pulumi:"rules"`
// Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Version int `pulumi:"version"`
}
func LookupRegionSnapshotIamPolicyOutput(ctx *pulumi.Context, args LookupRegionSnapshotIamPolicyOutputArgs, opts ...pulumi.InvokeOption) LookupRegionSnapshotIamPolicyResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupRegionSnapshotIamPolicyResult, error) {
args := v.(LookupRegionSnapshotIamPolicyArgs)
r, err := LookupRegionSnapshotIamPolicy(ctx, &args, opts...)
var s LookupRegionSnapshotIamPolicyResult
if r != nil {
s = *r
}
return s, err
}).(LookupRegionSnapshotIamPolicyResultOutput)
}
type LookupRegionSnapshotIamPolicyOutputArgs struct {
OptionsRequestedPolicyVersion pulumi.IntPtrInput `pulumi:"optionsRequestedPolicyVersion"`
Project pulumi.StringPtrInput `pulumi:"project"`
Region pulumi.StringInput `pulumi:"region"`
Resource pulumi.StringInput `pulumi:"resource"`
}
func (LookupRegionSnapshotIamPolicyOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupRegionSnapshotIamPolicyArgs)(nil)).Elem()
}
type LookupRegionSnapshotIamPolicyResultOutput struct{ *pulumi.OutputState }
func (LookupRegionSnapshotIamPolicyResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupRegionSnapshotIamPolicyResult)(nil)).Elem()
}
func (o LookupRegionSnapshotIamPolicyResultOutput) ToLookupRegionSnapshotIamPolicyResultOutput() LookupRegionSnapshotIamPolicyResultOutput {
return o
}
func (o LookupRegionSnapshotIamPolicyResultOutput) ToLookupRegionSnapshotIamPolicyResultOutputWithContext(ctx context.Context) LookupRegionSnapshotIamPolicyResultOutput {
return o
}
// Specifies cloud audit logging configuration for this policy.
func (o LookupRegionSnapshotIamPolicyResultOutput) AuditConfigs() AuditConfigResponseArrayOutput {
return o.ApplyT(func(v LookupRegionSnapshotIamPolicyResult) []AuditConfigResponse { return v.AuditConfigs }).(AuditConfigResponseArrayOutput)
}
// Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`.
func (o LookupRegionSnapshotIamPolicyResultOutput) Bindings() BindingResponseArrayOutput {
return o.ApplyT(func(v LookupRegionSnapshotIamPolicyResult) []BindingResponse { return v.Bindings }).(BindingResponseArrayOutput)
}
// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
func (o LookupRegionSnapshotIamPolicyResultOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionSnapshotIamPolicyResult) string { return v.Etag }).(pulumi.StringOutput)
}
// This is deprecated and has no effect. Do not use.
func (o LookupRegionSnapshotIamPolicyResultOutput) Rules() RuleResponseArrayOutput {
return o.ApplyT(func(v LookupRegionSnapshotIamPolicyResult) []RuleResponse { return v.Rules }).(RuleResponseArrayOutput)
}
// Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
func (o LookupRegionSnapshotIamPolicyResultOutput) Version() pulumi.IntOutput {
return o.ApplyT(func(v LookupRegionSnapshotIamPolicyResult) int { return v.Version }).(pulumi.IntOutput)
}
func init() {
pulumi.RegisterOutputType(LookupRegionSnapshotIamPolicyResultOutput{})
}