com.pulumi.gcp.assuredworkloads.kotlin.Workload.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy