GetIAMPolicy
Generates an IAM policy document that may be referenced by and applied to
other Google Cloud Platform resources, such as the gcp.organizations.Project resource.
Note: Several restrictions apply when setting IAM policies through this API. See the setIamPolicy docs for a list of these restrictions.
This data source is used to define IAM policies to apply to other resources. Currently, defining a policy through a datasource and referencing that policy from another resource is the only way to apply an IAM policy to a resource.
Using GetIAMPolicy
function getIAMPolicy(args: GetIAMPolicyArgs, opts?: InvokeOptions): Promise<GetIAMPolicyResult>function get_iam_policy(audit_configs=None, bindings=None, opts=None)func LookupIAMPolicy(ctx *Context, args *LookupIAMPolicyArgs, opts ...InvokeOption) (*LookupIAMPolicyResult, error)Note: This function is named
LookupIAMPolicyin the Go SDK.
public static class GetIAMPolicy {
public static Task<GetIAMPolicyResult> InvokeAsync(GetIAMPolicyArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Audit
Configs List<GetIAMPolicy Audit Config Args> A nested configuration block that defines logging additional configuration for your project.
- Bindings
List<Get
IAMPolicy Binding Args> A nested configuration block (described below) defining a binding to be included in the policy document. Multiple
bindingarguments are supported.
- Audit
Configs []GetIAMPolicy Audit Config A nested configuration block that defines logging additional configuration for your project.
- Bindings
[]Get
IAMPolicy Binding A nested configuration block (described below) defining a binding to be included in the policy document. Multiple
bindingarguments are supported.
- audit
Configs GetIAMPolicy Audit Config[] A nested configuration block that defines logging additional configuration for your project.
- bindings
Get
IAMPolicy Binding[] A nested configuration block (described below) defining a binding to be included in the policy document. Multiple
bindingarguments are supported.
- audit_
configs List[GetIAMPolicy Audit Config] A nested configuration block that defines logging additional configuration for your project.
- bindings
List[Get
IAMPolicy Binding] A nested configuration block (described below) defining a binding to be included in the policy document. Multiple
bindingarguments are supported.
GetIAMPolicy Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Policy
Data string The above bindings serialized in a format suitable for referencing from a resource that supports IAM.
- Audit
Configs List<GetIAMPolicy Audit Config> - Bindings
List<Get
IAMPolicy Binding>
- Id string
The provider-assigned unique ID for this managed resource.
- Policy
Data string The above bindings serialized in a format suitable for referencing from a resource that supports IAM.
- Audit
Configs []GetIAMPolicy Audit Config - Bindings
[]Get
IAMPolicy Binding
- id string
The provider-assigned unique ID for this managed resource.
- policy
Data string The above bindings serialized in a format suitable for referencing from a resource that supports IAM.
- audit
Configs GetIAMPolicy Audit Config[] - bindings
Get
IAMPolicy Binding[]
- id str
The provider-assigned unique ID for this managed resource.
- policy_
data str The above bindings serialized in a format suitable for referencing from a resource that supports IAM.
- audit_
configs List[GetIAMPolicy Audit Config] - bindings
List[Get
IAMPolicy Binding]
Supporting Types
GetIAMPolicyAuditConfig
- Audit
Log List<GetConfigs IAMPolicy Audit Config Audit Log Config Args> A nested block that defines the operations you’d like to log.
- Service string
Defines a service that will be enabled for audit logging. For example,
storage.googleapis.com,cloudsql.googleapis.com.allServicesis a special value that covers all services.
- Audit
Log []GetConfigs IAMPolicy Audit Config Audit Log Config A nested block that defines the operations you’d like to log.
- Service string
Defines a service that will be enabled for audit logging. For example,
storage.googleapis.com,cloudsql.googleapis.com.allServicesis a special value that covers all services.
- audit
Log GetConfigs IAMPolicy Audit Config Audit Log Config[] A nested block that defines the operations you’d like to log.
- service string
Defines a service that will be enabled for audit logging. For example,
storage.googleapis.com,cloudsql.googleapis.com.allServicesis a special value that covers all services.
- audit_
log_ List[Getconfigs IAMPolicy Audit Config Audit Log Config] A nested block that defines the operations you’d like to log.
- service str
Defines a service that will be enabled for audit logging. For example,
storage.googleapis.com,cloudsql.googleapis.com.allServicesis a special value that covers all services.
GetIAMPolicyAuditConfigAuditLogConfig
- Log
Type string Defines the logging level.
DATA_READ,DATA_WRITEandADMIN_READcapture different types of events. See the audit configuration documentation for more details.- Exempted
Members List<string> Specifies the identities that are exempt from these types of logging operations. Follows the same format of the
membersarray forbinding.
- Log
Type string Defines the logging level.
DATA_READ,DATA_WRITEandADMIN_READcapture different types of events. See the audit configuration documentation for more details.- Exempted
Members []string Specifies the identities that are exempt from these types of logging operations. Follows the same format of the
membersarray forbinding.
- log
Type string Defines the logging level.
DATA_READ,DATA_WRITEandADMIN_READcapture different types of events. See the audit configuration documentation for more details.- exempted
Members string[] Specifies the identities that are exempt from these types of logging operations. Follows the same format of the
membersarray forbinding.
- log
Type str Defines the logging level.
DATA_READ,DATA_WRITEandADMIN_READcapture different types of events. See the audit configuration documentation for more details.- exempted
Members List[str] Specifies the identities that are exempt from these types of logging operations. Follows the same format of the
membersarray forbinding.
GetIAMPolicyBinding
- Members List<string>
An array of identities that will be granted the privilege in the
role. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding Each entry can have one of the following values: * allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account. It can’t be used with thegcp.organizations.Projectresource. * allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account. It can’t be used with thegcp.organizations.Projectresource. * user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com. * serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com. * group:{emailid}: An email address that represents a Google group. For example, admins@example.com. * domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.- Role string
The role/permission that will be granted to the members. See the IAM Roles documentation for a complete list of roles. Note that custom roles must be of the format
[projects|organizations]/{parent-name}/roles/{role-name}.- Condition
Get
IAMPolicy Binding Condition Args
- Members []string
An array of identities that will be granted the privilege in the
role. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding Each entry can have one of the following values: * allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account. It can’t be used with thegcp.organizations.Projectresource. * allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account. It can’t be used with thegcp.organizations.Projectresource. * user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com. * serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com. * group:{emailid}: An email address that represents a Google group. For example, admins@example.com. * domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.- Role string
The role/permission that will be granted to the members. See the IAM Roles documentation for a complete list of roles. Note that custom roles must be of the format
[projects|organizations]/{parent-name}/roles/{role-name}.- Condition
Get
IAMPolicy Binding Condition
- members string[]
An array of identities that will be granted the privilege in the
role. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding Each entry can have one of the following values: * allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account. It can’t be used with thegcp.organizations.Projectresource. * allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account. It can’t be used with thegcp.organizations.Projectresource. * user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com. * serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com. * group:{emailid}: An email address that represents a Google group. For example, admins@example.com. * domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.- role string
The role/permission that will be granted to the members. See the IAM Roles documentation for a complete list of roles. Note that custom roles must be of the format
[projects|organizations]/{parent-name}/roles/{role-name}.- condition
Get
IAMPolicy Binding Condition
- members List[str]
An array of identities that will be granted the privilege in the
role. For more details on format and restrictions see https://cloud.google.com/billing/reference/rest/v1/Policy#Binding Each entry can have one of the following values: * allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account. It can’t be used with thegcp.organizations.Projectresource. * allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account. It can’t be used with thegcp.organizations.Projectresource. * user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com. * serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com. * group:{emailid}: An email address that represents a Google group. For example, admins@example.com. * domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.- role str
The role/permission that will be granted to the members. See the IAM Roles documentation for a complete list of roles. Note that custom roles must be of the format
[projects|organizations]/{parent-name}/roles/{role-name}.- condition
Dict[Get
IAMPolicy Binding Condition]
GetIAMPolicyBindingCondition
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.