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

com.pulumi.gcp.assuredworkloads.kotlin.Workload.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.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.assuredworkloads.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadComplianceStatus
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadEkmProvisioningResponse
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadKmsSettings
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadPartnerPermissions
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadResource
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadResourceSetting
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadSaaEnrollmentResponse
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadComplianceStatus.Companion.toKotlin as workloadComplianceStatusToKotlin
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadEkmProvisioningResponse.Companion.toKotlin as workloadEkmProvisioningResponseToKotlin
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadKmsSettings.Companion.toKotlin as workloadKmsSettingsToKotlin
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadPartnerPermissions.Companion.toKotlin as workloadPartnerPermissionsToKotlin
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadResource.Companion.toKotlin as workloadResourceToKotlin
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadResourceSetting.Companion.toKotlin as workloadResourceSettingToKotlin
import com.pulumi.gcp.assuredworkloads.kotlin.outputs.WorkloadSaaEnrollmentResponse.Companion.toKotlin as workloadSaaEnrollmentResponseToKotlin

/**
 * Builder for [Workload].
 */
@PulumiTagMarker
public class WorkloadResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: WorkloadArgs = WorkloadArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend WorkloadArgsBuilder.() -> Unit) {
        val builder = WorkloadArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Workload {
        val builtJavaResource = com.pulumi.gcp.assuredworkloads.Workload(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Workload(builtJavaResource)
    }
}

/**
 * The AssuredWorkloads Workload resource
 * ## Example Usage
 * ### Basic_workload
 * A basic test of a assuredworkloads api
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const primary = new gcp.assuredworkloads.Workload("primary", {
 *     complianceRegime: "FEDRAMP_MODERATE",
 *     displayName: "{{display}}",
 *     location: "us-west1",
 *     organization: "123456789",
 *     billingAccount: "billingAccounts/000000-0000000-0000000-000000",
 *     kmsSettings: {
 *         nextRotationTime: "9999-10-02T15:01:23Z",
 *         rotationPeriod: "10368000s",
 *     },
 *     provisionedResourcesParent: "folders/519620126891",
 *     resourceSettings: [
 *         {
 *             displayName: "folder-display-name",
 *             resourceType: "CONSUMER_FOLDER",
 *         },
 *         {
 *             resourceType: "ENCRYPTION_KEYS_PROJECT",
 *         },
 *         {
 *             resourceId: "ring",
 *             resourceType: "KEYRING",
 *         },
 *     ],
 *     violationNotificationsEnabled: true,
 *     labels: {
 *         "label-one": "value-one",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * primary = gcp.assuredworkloads.Workload("primary",
 *     compliance_regime="FEDRAMP_MODERATE",
 *     display_name="{{display}}",
 *     location="us-west1",
 *     organization="123456789",
 *     billing_account="billingAccounts/000000-0000000-0000000-000000",
 *     kms_settings=gcp.assuredworkloads.WorkloadKmsSettingsArgs(
 *         next_rotation_time="9999-10-02T15:01:23Z",
 *         rotation_period="10368000s",
 *     ),
 *     provisioned_resources_parent="folders/519620126891",
 *     resource_settings=[
 *         gcp.assuredworkloads.WorkloadResourceSettingArgs(
 *             display_name="folder-display-name",
 *             resource_type="CONSUMER_FOLDER",
 *         ),
 *         gcp.assuredworkloads.WorkloadResourceSettingArgs(
 *             resource_type="ENCRYPTION_KEYS_PROJECT",
 *         ),
 *         gcp.assuredworkloads.WorkloadResourceSettingArgs(
 *             resource_id="ring",
 *             resource_type="KEYRING",
 *         ),
 *     ],
 *     violation_notifications_enabled=True,
 *     labels={
 *         "label-one": "value-one",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var primary = new Gcp.AssuredWorkloads.Workload("primary", new()
 *     {
 *         ComplianceRegime = "FEDRAMP_MODERATE",
 *         DisplayName = "{{display}}",
 *         Location = "us-west1",
 *         Organization = "123456789",
 *         BillingAccount = "billingAccounts/000000-0000000-0000000-000000",
 *         KmsSettings = new Gcp.AssuredWorkloads.Inputs.WorkloadKmsSettingsArgs
 *         {
 *             NextRotationTime = "9999-10-02T15:01:23Z",
 *             RotationPeriod = "10368000s",
 *         },
 *         ProvisionedResourcesParent = "folders/519620126891",
 *         ResourceSettings = new[]
 *         {
 *             new Gcp.AssuredWorkloads.Inputs.WorkloadResourceSettingArgs
 *             {
 *                 DisplayName = "folder-display-name",
 *                 ResourceType = "CONSUMER_FOLDER",
 *             },
 *             new Gcp.AssuredWorkloads.Inputs.WorkloadResourceSettingArgs
 *             {
 *                 ResourceType = "ENCRYPTION_KEYS_PROJECT",
 *             },
 *             new Gcp.AssuredWorkloads.Inputs.WorkloadResourceSettingArgs
 *             {
 *                 ResourceId = "ring",
 *                 ResourceType = "KEYRING",
 *             },
 *         },
 *         ViolationNotificationsEnabled = true,
 *         Labels =
 *         {
 *             { "label-one", "value-one" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/assuredworkloads"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := assuredworkloads.NewWorkload(ctx, "primary", &assuredworkloads.WorkloadArgs{
 * 			ComplianceRegime: pulumi.String("FEDRAMP_MODERATE"),
 * 			DisplayName:      pulumi.String("{{display}}"),
 * 			Location:         pulumi.String("us-west1"),
 * 			Organization:     pulumi.String("123456789"),
 * 			BillingAccount:   pulumi.String("billingAccounts/000000-0000000-0000000-000000"),
 * 			KmsSettings: &assuredworkloads.WorkloadKmsSettingsArgs{
 * 				NextRotationTime: pulumi.String("9999-10-02T15:01:23Z"),
 * 				RotationPeriod:   pulumi.String("10368000s"),
 * 			},
 * 			ProvisionedResourcesParent: pulumi.String("folders/519620126891"),
 * 			ResourceSettings: assuredworkloads.WorkloadResourceSettingArray{
 * 				&assuredworkloads.WorkloadResourceSettingArgs{
 * 					DisplayName:  pulumi.String("folder-display-name"),
 * 					ResourceType: pulumi.String("CONSUMER_FOLDER"),
 * 				},
 * 				&assuredworkloads.WorkloadResourceSettingArgs{
 * 					ResourceType: pulumi.String("ENCRYPTION_KEYS_PROJECT"),
 * 				},
 * 				&assuredworkloads.WorkloadResourceSettingArgs{
 * 					ResourceId:   pulumi.String("ring"),
 * 					ResourceType: pulumi.String("KEYRING"),
 * 				},
 * 			},
 * 			ViolationNotificationsEnabled: pulumi.Bool(true),
 * 			Labels: pulumi.StringMap{
 * 				"label-one": pulumi.String("value-one"),
 * 			},
 * 		})
 * 		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.assuredworkloads.Workload;
 * import com.pulumi.gcp.assuredworkloads.WorkloadArgs;
 * import com.pulumi.gcp.assuredworkloads.inputs.WorkloadKmsSettingsArgs;
 * import com.pulumi.gcp.assuredworkloads.inputs.WorkloadResourceSettingArgs;
 * 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 primary = new Workload("primary", WorkloadArgs.builder()
 *             .complianceRegime("FEDRAMP_MODERATE")
 *             .displayName("{{display}}")
 *             .location("us-west1")
 *             .organization("123456789")
 *             .billingAccount("billingAccounts/000000-0000000-0000000-000000")
 *             .kmsSettings(WorkloadKmsSettingsArgs.builder()
 *                 .nextRotationTime("9999-10-02T15:01:23Z")
 *                 .rotationPeriod("10368000s")
 *                 .build())
 *             .provisionedResourcesParent("folders/519620126891")
 *             .resourceSettings(
 *                 WorkloadResourceSettingArgs.builder()
 *                     .displayName("folder-display-name")
 *                     .resourceType("CONSUMER_FOLDER")
 *                     .build(),
 *                 WorkloadResourceSettingArgs.builder()
 *                     .resourceType("ENCRYPTION_KEYS_PROJECT")
 *                     .build(),
 *                 WorkloadResourceSettingArgs.builder()
 *                     .resourceId("ring")
 *                     .resourceType("KEYRING")
 *                     .build())
 *             .violationNotificationsEnabled(true)
 *             .labels(Map.of("label-one", "value-one"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   primary:
 *     type: gcp:assuredworkloads:Workload
 *     properties:
 *       complianceRegime: FEDRAMP_MODERATE
 *       displayName: '{{display}}'
 *       location: us-west1
 *       organization: '123456789'
 *       billingAccount: billingAccounts/000000-0000000-0000000-000000
 *       kmsSettings:
 *         nextRotationTime: 9999-10-02T15:01:23Z
 *         rotationPeriod: 10368000s
 *       provisionedResourcesParent: folders/519620126891
 *       resourceSettings:
 *         - displayName: folder-display-name
 *           resourceType: CONSUMER_FOLDER
 *         - resourceType: ENCRYPTION_KEYS_PROJECT
 *         - resourceId: ring
 *           resourceType: KEYRING
 *       violationNotificationsEnabled: true
 *       labels:
 *         label-one: value-one
 * ```
 * 
 * ### Sovereign_controls_workload
 * A Sovereign Controls test of the assuredworkloads api
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const primary = new gcp.assuredworkloads.Workload("primary", {
 *     complianceRegime: "EU_REGIONS_AND_SUPPORT",
 *     displayName: "display",
 *     location: "europe-west9",
 *     organization: "123456789",
 *     billingAccount: "billingAccounts/000000-0000000-0000000-000000",
 *     enableSovereignControls: true,
 *     kmsSettings: {
 *         nextRotationTime: "9999-10-02T15:01:23Z",
 *         rotationPeriod: "10368000s",
 *     },
 *     resourceSettings: [
 *         {
 *             resourceType: "CONSUMER_FOLDER",
 *         },
 *         {
 *             resourceType: "ENCRYPTION_KEYS_PROJECT",
 *         },
 *         {
 *             resourceId: "ring",
 *             resourceType: "KEYRING",
 *         },
 *     ],
 *     labels: {
 *         "label-one": "value-one",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * primary = gcp.assuredworkloads.Workload("primary",
 *     compliance_regime="EU_REGIONS_AND_SUPPORT",
 *     display_name="display",
 *     location="europe-west9",
 *     organization="123456789",
 *     billing_account="billingAccounts/000000-0000000-0000000-000000",
 *     enable_sovereign_controls=True,
 *     kms_settings=gcp.assuredworkloads.WorkloadKmsSettingsArgs(
 *         next_rotation_time="9999-10-02T15:01:23Z",
 *         rotation_period="10368000s",
 *     ),
 *     resource_settings=[
 *         gcp.assuredworkloads.WorkloadResourceSettingArgs(
 *             resource_type="CONSUMER_FOLDER",
 *         ),
 *         gcp.assuredworkloads.WorkloadResourceSettingArgs(
 *             resource_type="ENCRYPTION_KEYS_PROJECT",
 *         ),
 *         gcp.assuredworkloads.WorkloadResourceSettingArgs(
 *             resource_id="ring",
 *             resource_type="KEYRING",
 *         ),
 *     ],
 *     labels={
 *         "label-one": "value-one",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var primary = new Gcp.AssuredWorkloads.Workload("primary", new()
 *     {
 *         ComplianceRegime = "EU_REGIONS_AND_SUPPORT",
 *         DisplayName = "display",
 *         Location = "europe-west9",
 *         Organization = "123456789",
 *         BillingAccount = "billingAccounts/000000-0000000-0000000-000000",
 *         EnableSovereignControls = true,
 *         KmsSettings = new Gcp.AssuredWorkloads.Inputs.WorkloadKmsSettingsArgs
 *         {
 *             NextRotationTime = "9999-10-02T15:01:23Z",
 *             RotationPeriod = "10368000s",
 *         },
 *         ResourceSettings = new[]
 *         {
 *             new Gcp.AssuredWorkloads.Inputs.WorkloadResourceSettingArgs
 *             {
 *                 ResourceType = "CONSUMER_FOLDER",
 *             },
 *             new Gcp.AssuredWorkloads.Inputs.WorkloadResourceSettingArgs
 *             {
 *                 ResourceType = "ENCRYPTION_KEYS_PROJECT",
 *             },
 *             new Gcp.AssuredWorkloads.Inputs.WorkloadResourceSettingArgs
 *             {
 *                 ResourceId = "ring",
 *                 ResourceType = "KEYRING",
 *             },
 *         },
 *         Labels =
 *         {
 *             { "label-one", "value-one" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/assuredworkloads"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := assuredworkloads.NewWorkload(ctx, "primary", &assuredworkloads.WorkloadArgs{
 * 			ComplianceRegime:        pulumi.String("EU_REGIONS_AND_SUPPORT"),
 * 			DisplayName:             pulumi.String("display"),
 * 			Location:                pulumi.String("europe-west9"),
 * 			Organization:            pulumi.String("123456789"),
 * 			BillingAccount:          pulumi.String("billingAccounts/000000-0000000-0000000-000000"),
 * 			EnableSovereignControls: pulumi.Bool(true),
 * 			KmsSettings: &assuredworkloads.WorkloadKmsSettingsArgs{
 * 				NextRotationTime: pulumi.String("9999-10-02T15:01:23Z"),
 * 				RotationPeriod:   pulumi.String("10368000s"),
 * 			},
 * 			ResourceSettings: assuredworkloads.WorkloadResourceSettingArray{
 * 				&assuredworkloads.WorkloadResourceSettingArgs{
 * 					ResourceType: pulumi.String("CONSUMER_FOLDER"),
 * 				},
 * 				&assuredworkloads.WorkloadResourceSettingArgs{
 * 					ResourceType: pulumi.String("ENCRYPTION_KEYS_PROJECT"),
 * 				},
 * 				&assuredworkloads.WorkloadResourceSettingArgs{
 * 					ResourceId:   pulumi.String("ring"),
 * 					ResourceType: pulumi.String("KEYRING"),
 * 				},
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"label-one": pulumi.String("value-one"),
 * 			},
 * 		})
 * 		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.assuredworkloads.Workload;
 * import com.pulumi.gcp.assuredworkloads.WorkloadArgs;
 * import com.pulumi.gcp.assuredworkloads.inputs.WorkloadKmsSettingsArgs;
 * import com.pulumi.gcp.assuredworkloads.inputs.WorkloadResourceSettingArgs;
 * 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 primary = new Workload("primary", WorkloadArgs.builder()
 *             .complianceRegime("EU_REGIONS_AND_SUPPORT")
 *             .displayName("display")
 *             .location("europe-west9")
 *             .organization("123456789")
 *             .billingAccount("billingAccounts/000000-0000000-0000000-000000")
 *             .enableSovereignControls(true)
 *             .kmsSettings(WorkloadKmsSettingsArgs.builder()
 *                 .nextRotationTime("9999-10-02T15:01:23Z")
 *                 .rotationPeriod("10368000s")
 *                 .build())
 *             .resourceSettings(
 *                 WorkloadResourceSettingArgs.builder()
 *                     .resourceType("CONSUMER_FOLDER")
 *                     .build(),
 *                 WorkloadResourceSettingArgs.builder()
 *                     .resourceType("ENCRYPTION_KEYS_PROJECT")
 *                     .build(),
 *                 WorkloadResourceSettingArgs.builder()
 *                     .resourceId("ring")
 *                     .resourceType("KEYRING")
 *                     .build())
 *             .labels(Map.of("label-one", "value-one"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   primary:
 *     type: gcp:assuredworkloads:Workload
 *     properties:
 *       complianceRegime: EU_REGIONS_AND_SUPPORT
 *       displayName: display
 *       location: europe-west9
 *       organization: '123456789'
 *       billingAccount: billingAccounts/000000-0000000-0000000-000000
 *       enableSovereignControls: true
 *       kmsSettings:
 *         nextRotationTime: 9999-10-02T15:01:23Z
 *         rotationPeriod: 10368000s
 *       resourceSettings:
 *         - resourceType: CONSUMER_FOLDER
 *         - resourceType: ENCRYPTION_KEYS_PROJECT
 *         - resourceId: ring
 *           resourceType: KEYRING
 *       labels:
 *         label-one: value-one
 * ```
 * 
 * ## Import
 * Workload can be imported using any of these accepted formats:
 * * `organizations/{{organization}}/locations/{{location}}/workloads/{{name}}`
 * * `{{organization}}/{{location}}/{{name}}`
 * When using the `pulumi import` command, Workload can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:assuredworkloads/workload:Workload default organizations/{{organization}}/locations/{{location}}/workloads/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:assuredworkloads/workload:Workload default {{organization}}/{{location}}/{{name}}
 * ```
 */
public class Workload internal constructor(
    override val javaResource: com.pulumi.gcp.assuredworkloads.Workload,
) : KotlinCustomResource(javaResource, WorkloadMapper) {
    /**
     * Optional. Input only. The billing account used for the resources which are direct children of workload. This billing account is initially associated with the resources created as part of Workload creation. After the initial creation of these resources, the customer can change the assigned billing account. The resource name has the form `billingAccounts/{billing_account_id}`. For example, `billingAccounts/012345-567890-ABCDEF`.
     */
    public val billingAccount: Output?
        get() = javaResource.billingAccount().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Required. Immutable. Compliance Regime associated with this workload. Possible values: COMPLIANCE_REGIME_UNSPECIFIED, IL4, CJIS, FEDRAMP_HIGH, FEDRAMP_MODERATE, US_REGIONAL_ACCESS, HIPAA, HITRUST, EU_REGIONS_AND_SUPPORT, CA_REGIONS_AND_SUPPORT, ITAR, AU_REGIONS_AND_US_SUPPORT, ASSURED_WORKLOADS_FOR_PARTNERS, ISR_REGIONS, ISR_REGIONS_AND_SUPPORT, CA_PROTECTED_B, IL5, IL2, JP_REGIONS_AND_SUPPORT
     */
    public val complianceRegime: Output
        get() = javaResource.complianceRegime().applyValue({ args0 -> args0 })

    /**
     * Output only. Count of active Violations in the Workload.
     */
    public val complianceStatuses: Output>
        get() = javaResource.complianceStatuses().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> workloadComplianceStatusToKotlin(args0) })
            })
        })

    /**
     * Output only. Urls for services which are compliant for this Assured Workload, but which are currently disallowed by the ResourceUsageRestriction org policy. Invoke workloads.restrictAllowedResources endpoint to allow your project developers to use these services in their environment.
     */
    public val compliantButDisallowedServices: Output>
        get() = javaResource.compliantButDisallowedServices().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            })
        })

    /**
     * Output only. Immutable. The Workload creation timestamp.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Required. The user-assigned display name of the Workload. When present it must be between 4 to 30 characters. Allowed characters are: lowercase and uppercase letters, numbers, hyphen, and spaces. Example: My Workload
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Optional. Represents the Ekm Provisioning State of the given workload.
     */
    public val ekmProvisioningResponses: Output>
        get() = javaResource.ekmProvisioningResponses().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> workloadEkmProvisioningResponseToKotlin(args0) })
            })
        })

    /**
     * Optional. Indicates the sovereignty status of the given workload. Currently meant to be used by Europe/Canada customers.
     */
    public val enableSovereignControls: Output
        get() = javaResource.enableSovereignControls().applyValue({ args0 -> args0 })

    /**
     * Output only. Represents the KAJ enrollment state of the given workload. Possible values: KAJ_ENROLLMENT_STATE_UNSPECIFIED, KAJ_ENROLLMENT_STATE_PENDING, KAJ_ENROLLMENT_STATE_COMPLETE
     */
    public val kajEnrollmentState: Output
        get() = javaResource.kajEnrollmentState().applyValue({ args0 -> args0 })

    /**
     * **DEPRECATED** Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS CMEK key is provisioned. This field is deprecated as of Feb 28, 2022. In order to create a Keyring, callers should specify, ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
     */
    public val kmsSettings: Output?
        get() = javaResource.kmsSettings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    workloadKmsSettingsToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Optional. Labels applied to the workload.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The location for the resource
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Output only. The resource name of the workload.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The organization for the resource
     * - - -
     */
    public val organization: Output
        get() = javaResource.organization().applyValue({ args0 -> args0 })

    /**
     * Optional. Partner regime associated with this workload. Possible values: PARTNER_UNSPECIFIED, LOCAL_CONTROLS_BY_S3NS, SOVEREIGN_CONTROLS_BY_T_SYSTEMS, SOVEREIGN_CONTROLS_BY_SIA_MINSAIT, SOVEREIGN_CONTROLS_BY_PSN
     */
    public val partner: Output?
        get() = javaResource.partner().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Optional. Permissions granted to the AW Partner SA account for the customer workload
     */
    public val partnerPermissions: Output?
        get() = javaResource.partnerPermissions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> workloadPartnerPermissionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Input only. The parent resource for the resources managed by this Assured Workload. May be either empty or a folder resource which is a child of the Workload parent. If not specified all resources are created under the parent organization. Format: folders/{folder_id}
     */
    public val provisionedResourcesParent: Output?
        get() = javaResource.provisionedResourcesParent().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The combination of labels configured directly on the resource and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Input only. Resource properties that are used to customize workload resources. These properties (such as custom project id) will be used to create workload resources if possible. This field is optional.
     */
    public val resourceSettings: Output>?
        get() = javaResource.resourceSettings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        workloadResourceSettingToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * Output only. The resources associated with this workload. These resources will be created when creating the workload. If any of the projects already exist, the workload creation will fail. Always read only.
     */
    public val resources: Output>
        get() = javaResource.resources().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    workloadResourceToKotlin(args0)
                })
            })
        })

    /**
     * Output only. Represents the SAA enrollment response of the given workload. SAA enrollment response is queried during workloads.get call. In failure cases, user friendly error message is shown in SAA details page.
     */
    public val saaEnrollmentResponses: Output>
        get() = javaResource.saaEnrollmentResponses().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> workloadSaaEnrollmentResponseToKotlin(args0) })
            })
        })

    /**
     * Optional. Indicates whether the e-mail notification for a violation is enabled for a workload. This value will be by default True, and if not present will be considered as true. This should only be updated via updateWorkload call. Any Changes to this field during the createWorkload call will not be honored. This will always be true while creating the workload.
     */
    public val violationNotificationsEnabled: Output
        get() = javaResource.violationNotificationsEnabled().applyValue({ args0 -> args0 })
}

public object WorkloadMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.assuredworkloads.Workload::class == javaResource::class

    override fun map(javaResource: Resource): Workload = Workload(
        javaResource as
            com.pulumi.gcp.assuredworkloads.Workload,
    )
}

/**
 * @see [Workload].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Workload].
 */
public suspend fun workload(name: String, block: suspend WorkloadResourceBuilder.() -> Unit): Workload {
    val builder = WorkloadResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Workload].
 * @param name The _unique_ name of the resulting resource.
 */
public fun workload(name: String): Workload {
    val builder = WorkloadResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy