All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.organizations.kotlin.IamAuditConfigArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.organizations.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.organizations.IamAuditConfigArgs.builder
import com.pulumi.gcp.organizations.kotlin.inputs.IamAuditConfigAuditLogConfigArgs
import com.pulumi.gcp.organizations.kotlin.inputs.IamAuditConfigAuditLogConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Allows management of audit logging config for a given service for a Google Cloud Platform Organization.
 * ## Example Usage
 * 
 * ```typescript
 * 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"],
 *     }],
 * });
 * ```
 * ```python
 * 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"],
 *     )])
 * ```
 * ```csharp
 * 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:[email protected]",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * 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:[email protected]"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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:[email protected]")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   config:
 *     type: gcp:organizations:IamAuditConfig
 *     properties:
 *       orgId: your-organization-id
 *       service: allServices
 *       auditLogConfigs:
 *         - logType: DATA_READ
 *           exemptedMembers:
 *             - user:[email protected]
 * ```
 * 
 * ## Import
 * IAM audit config imports use the identifier of the resource in question and the service, e.g.
 * ```sh
 * $ pulumi import gcp:organizations/iamAuditConfig:IamAuditConfig config "your-organization-id foo.googleapis.com"
 * ```
 * @property auditLogConfigs The configuration for logging of each type of permission.  This can be specified multiple times.  Structure is documented below.
 * @property orgId The numeric ID of the organization in which you want to manage the audit logging config.
 * @property service 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 both `allServices` and a specific service then the union of the two AuditConfigs is used for that service: the `log_types` specified in each `audit_log_config` are enabled, and the `exempted_members` in each `audit_log_config` are exempted.
 */
public data class IamAuditConfigArgs(
    public val auditLogConfigs: Output>? = null,
    public val orgId: Output? = null,
    public val service: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.organizations.IamAuditConfigArgs =
        com.pulumi.gcp.organizations.IamAuditConfigArgs.builder()
            .auditLogConfigs(
                auditLogConfigs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .orgId(orgId?.applyValue({ args0 -> args0 }))
            .service(service?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [IamAuditConfigArgs].
 */
@PulumiTagMarker
public class IamAuditConfigArgsBuilder internal constructor() {
    private var auditLogConfigs: Output>? = null

    private var orgId: Output? = null

    private var service: Output? = null

    /**
     * @param value The configuration for logging of each type of permission.  This can be specified multiple times.  Structure is documented below.
     */
    @JvmName("gvqaomffuqanhjfn")
    public suspend fun auditLogConfigs(`value`: Output>) {
        this.auditLogConfigs = value
    }

    @JvmName("kcnxchtmabrumxss")
    public suspend fun auditLogConfigs(vararg values: Output) {
        this.auditLogConfigs = Output.all(values.asList())
    }

    /**
     * @param values The configuration for logging of each type of permission.  This can be specified multiple times.  Structure is documented below.
     */
    @JvmName("kiguaaovtjjnxvmg")
    public suspend fun auditLogConfigs(values: List>) {
        this.auditLogConfigs = Output.all(values)
    }

    /**
     * @param value The numeric ID of the organization in which you want to manage the audit logging config.
     */
    @JvmName("btrhtevrudqequwb")
    public suspend fun orgId(`value`: Output) {
        this.orgId = value
    }

    /**
     * @param value 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 both `allServices` and a specific service then the union of the two AuditConfigs is used for that service: the `log_types` specified in each `audit_log_config` are enabled, and the `exempted_members` in each `audit_log_config` are exempted.
     */
    @JvmName("simrcwtpqmpvhdcp")
    public suspend fun service(`value`: Output) {
        this.service = value
    }

    /**
     * @param value The configuration for logging of each type of permission.  This can be specified multiple times.  Structure is documented below.
     */
    @JvmName("gdlhhbojlrfsaias")
    public suspend fun auditLogConfigs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.auditLogConfigs = mapped
    }

    /**
     * @param argument The configuration for logging of each type of permission.  This can be specified multiple times.  Structure is documented below.
     */
    @JvmName("kfxswxgbcnscsvwh")
    public suspend fun auditLogConfigs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            IamAuditConfigAuditLogConfigArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.auditLogConfigs = mapped
    }

    /**
     * @param argument The configuration for logging of each type of permission.  This can be specified multiple times.  Structure is documented below.
     */
    @JvmName("lyqkeegheecrduac")
    public suspend fun auditLogConfigs(vararg argument: suspend IamAuditConfigAuditLogConfigArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            IamAuditConfigAuditLogConfigArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.auditLogConfigs = mapped
    }

    /**
     * @param argument The configuration for logging of each type of permission.  This can be specified multiple times.  Structure is documented below.
     */
    @JvmName("kfetyulwemeypdof")
    public suspend fun auditLogConfigs(argument: suspend IamAuditConfigAuditLogConfigArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            IamAuditConfigAuditLogConfigArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.auditLogConfigs = mapped
    }

    /**
     * @param values The configuration for logging of each type of permission.  This can be specified multiple times.  Structure is documented below.
     */
    @JvmName("ehexdhwhdocvhwxy")
    public suspend fun auditLogConfigs(vararg values: IamAuditConfigAuditLogConfigArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.auditLogConfigs = mapped
    }

    /**
     * @param value The numeric ID of the organization in which you want to manage the audit logging config.
     */
    @JvmName("ptnnjwmvtictjixp")
    public suspend fun orgId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.orgId = mapped
    }

    /**
     * @param value 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 both `allServices` and a specific service then the union of the two AuditConfigs is used for that service: the `log_types` specified in each `audit_log_config` are enabled, and the `exempted_members` in each `audit_log_config` are exempted.
     */
    @JvmName("fdesgvgdunmusdic")
    public suspend fun service(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.service = mapped
    }

    internal fun build(): IamAuditConfigArgs = IamAuditConfigArgs(
        auditLogConfigs = auditLogConfigs,
        orgId = orgId,
        service = service,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy