gcp.organizations.IamAuditConfig
Explore with Pulumi AI
Allows management of audit logging config for a given service for a Google Cloud Platform Organization.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const config = new gcp.organizations.IamAuditConfig("config", {
orgId: "your-organization-id",
service: "allServices",
auditLogConfigs: [{
logType: "DATA_READ",
exemptedMembers: ["user:joebloggs@example.com"],
}],
});
import pulumi
import pulumi_gcp as gcp
config = gcp.organizations.IamAuditConfig("config",
org_id="your-organization-id",
service="allServices",
audit_log_configs=[gcp.organizations.IamAuditConfigAuditLogConfigArgs(
log_type="DATA_READ",
exempted_members=["user:joebloggs@example.com"],
)])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organizations.NewIamAuditConfig(ctx, "config", &organizations.IamAuditConfigArgs{
OrgId: pulumi.String("your-organization-id"),
Service: pulumi.String("allServices"),
AuditLogConfigs: organizations.IamAuditConfigAuditLogConfigArray{
&organizations.IamAuditConfigAuditLogConfigArgs{
LogType: pulumi.String("DATA_READ"),
ExemptedMembers: pulumi.StringArray{
pulumi.String("user:joebloggs@example.com"),
},
},
},
})
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 config = new Gcp.Organizations.IamAuditConfig("config", new()
{
OrgId = "your-organization-id",
Service = "allServices",
AuditLogConfigs = new[]
{
new Gcp.Organizations.Inputs.IamAuditConfigAuditLogConfigArgs
{
LogType = "DATA_READ",
ExemptedMembers = new[]
{
"user:joebloggs@example.com",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.IamAuditConfig;
import com.pulumi.gcp.organizations.IamAuditConfigArgs;
import com.pulumi.gcp.organizations.inputs.IamAuditConfigAuditLogConfigArgs;
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) {
var config = new IamAuditConfig("config", IamAuditConfigArgs.builder()
.orgId("your-organization-id")
.service("allServices")
.auditLogConfigs(IamAuditConfigAuditLogConfigArgs.builder()
.logType("DATA_READ")
.exemptedMembers("user:joebloggs@example.com")
.build())
.build());
}
}
resources:
config:
type: gcp:organizations:IamAuditConfig
properties:
orgId: your-organization-id
service: allServices
auditLogConfigs:
- logType: DATA_READ
exemptedMembers:
- user:joebloggs@example.com
Create IamAuditConfig Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IamAuditConfig(name: string, args: IamAuditConfigArgs, opts?: CustomResourceOptions);
@overload
def IamAuditConfig(resource_name: str,
args: IamAuditConfigArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IamAuditConfig(resource_name: str,
opts: Optional[ResourceOptions] = None,
audit_log_configs: Optional[Sequence[IamAuditConfigAuditLogConfigArgs]] = None,
org_id: Optional[str] = None,
service: Optional[str] = None)
func NewIamAuditConfig(ctx *Context, name string, args IamAuditConfigArgs, opts ...ResourceOption) (*IamAuditConfig, error)
public IamAuditConfig(string name, IamAuditConfigArgs args, CustomResourceOptions? opts = null)
public IamAuditConfig(String name, IamAuditConfigArgs args)
public IamAuditConfig(String name, IamAuditConfigArgs args, CustomResourceOptions options)
type: gcp:organizations:IamAuditConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args IamAuditConfigArgs
- 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 IamAuditConfigArgs
- 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 IamAuditConfigArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IamAuditConfigArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IamAuditConfigArgs
- 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 gcpIamAuditConfigResource = new Gcp.Organizations.IamAuditConfig("gcpIamAuditConfigResource", new()
{
AuditLogConfigs = new[]
{
new Gcp.Organizations.Inputs.IamAuditConfigAuditLogConfigArgs
{
LogType = "string",
ExemptedMembers = new[]
{
"string",
},
},
},
OrgId = "string",
Service = "string",
});
example, err := organizations.NewIamAuditConfig(ctx, "gcpIamAuditConfigResource", &organizations.IamAuditConfigArgs{
AuditLogConfigs: organizations.IamAuditConfigAuditLogConfigArray{
&organizations.IamAuditConfigAuditLogConfigArgs{
LogType: pulumi.String("string"),
ExemptedMembers: pulumi.StringArray{
pulumi.String("string"),
},
},
},
OrgId: pulumi.String("string"),
Service: pulumi.String("string"),
})
var gcpIamAuditConfigResource = new IamAuditConfig("gcpIamAuditConfigResource", IamAuditConfigArgs.builder()
.auditLogConfigs(IamAuditConfigAuditLogConfigArgs.builder()
.logType("string")
.exemptedMembers("string")
.build())
.orgId("string")
.service("string")
.build());
gcp_iam_audit_config_resource = gcp.organizations.IamAuditConfig("gcpIamAuditConfigResource",
audit_log_configs=[gcp.organizations.IamAuditConfigAuditLogConfigArgs(
log_type="string",
exempted_members=["string"],
)],
org_id="string",
service="string")
const gcpIamAuditConfigResource = new gcp.organizations.IamAuditConfig("gcpIamAuditConfigResource", {
auditLogConfigs: [{
logType: "string",
exemptedMembers: ["string"],
}],
orgId: "string",
service: "string",
});
type: gcp:organizations:IamAuditConfig
properties:
auditLogConfigs:
- exemptedMembers:
- string
logType: string
orgId: string
service: string
IamAuditConfig Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The IamAuditConfig resource accepts the following input properties:
- Audit
Log List<IamConfigs Audit Config Audit Log Config> - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- Org
Id string - The numeric ID of the organization in which you want to manage the audit logging config.
- Service string
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- Audit
Log []IamConfigs Audit Config Audit Log Config Args - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- Org
Id string - The numeric ID of the organization in which you want to manage the audit logging config.
- Service string
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- audit
Log List<IamConfigs Audit Config Audit Log Config> - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- org
Id String - The numeric ID of the organization in which you want to manage the audit logging config.
- service String
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- audit
Log IamConfigs Audit Config Audit Log Config[] - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- org
Id string - The numeric ID of the organization in which you want to manage the audit logging config.
- service string
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- audit_
log_ Sequence[Iamconfigs Audit Config Audit Log Config Args] - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- org_
id str - The numeric ID of the organization in which you want to manage the audit logging config.
- service str
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- audit
Log List<Property Map>Configs - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- org
Id String - The numeric ID of the organization in which you want to manage the audit logging config.
- service String
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
Outputs
All input properties are implicitly available as output properties. Additionally, the IamAuditConfig resource produces the following output properties:
Look up Existing IamAuditConfig Resource
Get an existing IamAuditConfig 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?: IamAuditConfigState, opts?: CustomResourceOptions): IamAuditConfig
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
audit_log_configs: Optional[Sequence[IamAuditConfigAuditLogConfigArgs]] = None,
etag: Optional[str] = None,
org_id: Optional[str] = None,
service: Optional[str] = None) -> IamAuditConfig
func GetIamAuditConfig(ctx *Context, name string, id IDInput, state *IamAuditConfigState, opts ...ResourceOption) (*IamAuditConfig, error)
public static IamAuditConfig Get(string name, Input<string> id, IamAuditConfigState? state, CustomResourceOptions? opts = null)
public static IamAuditConfig get(String name, Output<String> id, IamAuditConfigState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Audit
Log List<IamConfigs Audit Config Audit Log Config> - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- Etag string
- The etag of iam policy
- Org
Id string - The numeric ID of the organization in which you want to manage the audit logging config.
- Service string
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- Audit
Log []IamConfigs Audit Config Audit Log Config Args - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- Etag string
- The etag of iam policy
- Org
Id string - The numeric ID of the organization in which you want to manage the audit logging config.
- Service string
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- audit
Log List<IamConfigs Audit Config Audit Log Config> - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- etag String
- The etag of iam policy
- org
Id String - The numeric ID of the organization in which you want to manage the audit logging config.
- service String
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- audit
Log IamConfigs Audit Config Audit Log Config[] - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- etag string
- The etag of iam policy
- org
Id string - The numeric ID of the organization in which you want to manage the audit logging config.
- service string
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- audit_
log_ Sequence[Iamconfigs Audit Config Audit Log Config Args] - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- etag str
- The etag of iam policy
- org_
id str - The numeric ID of the organization in which you want to manage the audit logging config.
- service str
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
- audit
Log List<Property Map>Configs - The configuration for logging of each type of permission. This can be specified multiple times. Structure is documented below.
- etag String
- The etag of iam policy
- org
Id String - The numeric ID of the organization in which you want to manage the audit logging config.
- service String
- Service which will be enabled for audit logging. The special value
allServices
covers all services. Note that if there are google_organization_iam_audit_config resources covering bothallServices
and a specific service then the union of the two AuditConfigs is used for that service: thelog_types
specified in eachaudit_log_config
are enabled, and theexempted_members
in eachaudit_log_config
are exempted.
Supporting Types
IamAuditConfigAuditLogConfig, IamAuditConfigAuditLogConfigArgs
- Log
Type string - Permission type for which logging is to be configured. Must be one of
DATA_READ
,DATA_WRITE
, orADMIN_READ
. - Exempted
Members List<string> - Identities that do not cause logging for this type of permission.
Each entry can have one of the following values:
- user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.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.
- Log
Type string - Permission type for which logging is to be configured. Must be one of
DATA_READ
,DATA_WRITE
, orADMIN_READ
. - Exempted
Members []string - Identities that do not cause logging for this type of permission.
Each entry can have one of the following values:
- user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.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.
- log
Type String - Permission type for which logging is to be configured. Must be one of
DATA_READ
,DATA_WRITE
, orADMIN_READ
. - exempted
Members List<String> - Identities that do not cause logging for this type of permission.
Each entry can have one of the following values:
- user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.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.
- log
Type string - Permission type for which logging is to be configured. Must be one of
DATA_READ
,DATA_WRITE
, orADMIN_READ
. - exempted
Members string[] - Identities that do not cause logging for this type of permission.
Each entry can have one of the following values:
- user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.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.
- log_
type str - Permission type for which logging is to be configured. Must be one of
DATA_READ
,DATA_WRITE
, orADMIN_READ
. - exempted_
members Sequence[str] - Identities that do not cause logging for this type of permission.
Each entry can have one of the following values:
- user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.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.
- log
Type String - Permission type for which logging is to be configured. Must be one of
DATA_READ
,DATA_WRITE
, orADMIN_READ
. - exempted
Members List<String> - Identities that do not cause logging for this type of permission.
Each entry can have one of the following values:
- user:{emailid}: An email address that represents a specific Google account. For example, alice@gmail.com or joe@example.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.
Import
IAM audit config imports use the identifier of the resource in question and the service, e.g.
$ pulumi import gcp:organizations/iamAuditConfig:IamAuditConfig config "your-organization-id foo.googleapis.com"
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.