com.pulumi.gcp.iam.kotlin.WorkforcePoolArgs.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.iam.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.iam.WorkforcePoolArgs.builder
import com.pulumi.gcp.iam.kotlin.inputs.WorkforcePoolAccessRestrictionsArgs
import com.pulumi.gcp.iam.kotlin.inputs.WorkforcePoolAccessRestrictionsArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* Represents a collection of external workforces. Provides namespaces for
* federated users that can be referenced in IAM policies.
* To get more information about WorkforcePool, see:
* * [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools)
* * How-to Guides
* * [Manage pools](https://cloud.google.com/iam/docs/manage-workforce-identity-pools-providers#manage_pools)
* > **Note:** Ask your Google Cloud account team to request access to workforce identity federation for
* your billing/quota project. The account team notifies you when the project is granted access.
* ## Example Usage
* ### Iam Workforce Pool Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const example = new gcp.iam.WorkforcePool("example", {
* workforcePoolId: "example-pool",
* parent: "organizations/123456789",
* location: "global",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.iam.WorkforcePool("example",
* workforce_pool_id="example-pool",
* parent="organizations/123456789",
* location="global")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var example = new Gcp.Iam.WorkforcePool("example", new()
* {
* WorkforcePoolId = "example-pool",
* Parent = "organizations/123456789",
* Location = "global",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/iam"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := iam.NewWorkforcePool(ctx, "example", &iam.WorkforcePoolArgs{
* WorkforcePoolId: pulumi.String("example-pool"),
* Parent: pulumi.String("organizations/123456789"),
* Location: pulumi.String("global"),
* })
* 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.iam.WorkforcePool;
* import com.pulumi.gcp.iam.WorkforcePoolArgs;
* 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 example = new WorkforcePool("example", WorkforcePoolArgs.builder()
* .workforcePoolId("example-pool")
* .parent("organizations/123456789")
* .location("global")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:iam:WorkforcePool
* properties:
* workforcePoolId: example-pool
* parent: organizations/123456789
* location: global
* ```
*
* ### Iam Workforce Pool Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const example = new gcp.iam.WorkforcePool("example", {
* workforcePoolId: "example-pool",
* parent: "organizations/123456789",
* location: "global",
* displayName: "Display name",
* description: "A sample workforce pool.",
* disabled: false,
* sessionDuration: "7200s",
* accessRestrictions: {
* allowedServices: [{
* domain: "backstory.chronicle.security",
* }],
* disableProgrammaticSignin: false,
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.iam.WorkforcePool("example",
* workforce_pool_id="example-pool",
* parent="organizations/123456789",
* location="global",
* display_name="Display name",
* description="A sample workforce pool.",
* disabled=False,
* session_duration="7200s",
* access_restrictions=gcp.iam.WorkforcePoolAccessRestrictionsArgs(
* allowed_services=[gcp.iam.WorkforcePoolAccessRestrictionsAllowedServiceArgs(
* domain="backstory.chronicle.security",
* )],
* disable_programmatic_signin=False,
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var example = new Gcp.Iam.WorkforcePool("example", new()
* {
* WorkforcePoolId = "example-pool",
* Parent = "organizations/123456789",
* Location = "global",
* DisplayName = "Display name",
* Description = "A sample workforce pool.",
* Disabled = false,
* SessionDuration = "7200s",
* AccessRestrictions = new Gcp.Iam.Inputs.WorkforcePoolAccessRestrictionsArgs
* {
* AllowedServices = new[]
* {
* new Gcp.Iam.Inputs.WorkforcePoolAccessRestrictionsAllowedServiceArgs
* {
* Domain = "backstory.chronicle.security",
* },
* },
* DisableProgrammaticSignin = false,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/iam"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := iam.NewWorkforcePool(ctx, "example", &iam.WorkforcePoolArgs{
* WorkforcePoolId: pulumi.String("example-pool"),
* Parent: pulumi.String("organizations/123456789"),
* Location: pulumi.String("global"),
* DisplayName: pulumi.String("Display name"),
* Description: pulumi.String("A sample workforce pool."),
* Disabled: pulumi.Bool(false),
* SessionDuration: pulumi.String("7200s"),
* AccessRestrictions: &iam.WorkforcePoolAccessRestrictionsArgs{
* AllowedServices: iam.WorkforcePoolAccessRestrictionsAllowedServiceArray{
* &iam.WorkforcePoolAccessRestrictionsAllowedServiceArgs{
* Domain: pulumi.String("backstory.chronicle.security"),
* },
* },
* DisableProgrammaticSignin: pulumi.Bool(false),
* },
* })
* 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.iam.WorkforcePool;
* import com.pulumi.gcp.iam.WorkforcePoolArgs;
* import com.pulumi.gcp.iam.inputs.WorkforcePoolAccessRestrictionsArgs;
* 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 example = new WorkforcePool("example", WorkforcePoolArgs.builder()
* .workforcePoolId("example-pool")
* .parent("organizations/123456789")
* .location("global")
* .displayName("Display name")
* .description("A sample workforce pool.")
* .disabled(false)
* .sessionDuration("7200s")
* .accessRestrictions(WorkforcePoolAccessRestrictionsArgs.builder()
* .allowedServices(WorkforcePoolAccessRestrictionsAllowedServiceArgs.builder()
* .domain("backstory.chronicle.security")
* .build())
* .disableProgrammaticSignin(false)
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: gcp:iam:WorkforcePool
* properties:
* workforcePoolId: example-pool
* parent: organizations/123456789
* location: global
* displayName: Display name
* description: A sample workforce pool.
* disabled: false
* sessionDuration: 7200s
* accessRestrictions:
* allowedServices:
* - domain: backstory.chronicle.security
* disableProgrammaticSignin: false
* ```
*
* ## Import
* WorkforcePool can be imported using any of these accepted formats:
* * `locations/{{location}}/workforcePools/{{workforce_pool_id}}`
* * `{{location}}/{{workforce_pool_id}}`
* When using the `pulumi import` command, WorkforcePool can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:iam/workforcePool:WorkforcePool default locations/{{location}}/workforcePools/{{workforce_pool_id}}
* ```
* ```sh
* $ pulumi import gcp:iam/workforcePool:WorkforcePool default {{location}}/{{workforce_pool_id}}
* ```
* @property accessRestrictions Configure access restrictions on the workforce pool users. This is an optional field. If specified web
* sign-in can be restricted to given set of services or programmatic sign-in can be disabled for pool users.
* Structure is documented below.
* @property description A user-specified description of the pool. Cannot exceed 256 characters.
* @property disabled Whether the pool is disabled. You cannot use a disabled pool to exchange tokens,
* or use existing tokens to access resources. If the pool is re-enabled, existing tokens grant access again.
* @property displayName A user-specified display name of the pool in Google Cloud Console. Cannot exceed 32 characters.
* @property location The location for the resource.
* @property parent Immutable. The resource name of the parent. Format: `organizations/{org-id}`.
* - - -
* @property sessionDuration Duration that the Google Cloud access tokens, console sign-in sessions,
* and `gcloud` sign-in sessions from this pool are valid.
* Must be greater than 15 minutes (900s) and less than 12 hours (43200s).
* If `sessionDuration` is not configured, minted credentials have a default duration of one hour (3600s).
* A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: "`3.5s`".
* @property workforcePoolId The name of the pool. The ID must be a globally unique string of 6 to 63 lowercase letters,
* digits, or hyphens. It must start with a letter, and cannot have a trailing hyphen.
* The prefix `gcp-` is reserved for use by Google, and may not be specified.
*/
public data class WorkforcePoolArgs(
public val accessRestrictions: Output? = null,
public val description: Output? = null,
public val disabled: Output? = null,
public val displayName: Output? = null,
public val location: Output? = null,
public val parent: Output? = null,
public val sessionDuration: Output? = null,
public val workforcePoolId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.iam.WorkforcePoolArgs =
com.pulumi.gcp.iam.WorkforcePoolArgs.builder()
.accessRestrictions(
accessRestrictions?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.description(description?.applyValue({ args0 -> args0 }))
.disabled(disabled?.applyValue({ args0 -> args0 }))
.displayName(displayName?.applyValue({ args0 -> args0 }))
.location(location?.applyValue({ args0 -> args0 }))
.parent(parent?.applyValue({ args0 -> args0 }))
.sessionDuration(sessionDuration?.applyValue({ args0 -> args0 }))
.workforcePoolId(workforcePoolId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [WorkforcePoolArgs].
*/
@PulumiTagMarker
public class WorkforcePoolArgsBuilder internal constructor() {
private var accessRestrictions: Output? = null
private var description: Output? = null
private var disabled: Output? = null
private var displayName: Output? = null
private var location: Output? = null
private var parent: Output? = null
private var sessionDuration: Output? = null
private var workforcePoolId: Output? = null
/**
* @param value Configure access restrictions on the workforce pool users. This is an optional field. If specified web
* sign-in can be restricted to given set of services or programmatic sign-in can be disabled for pool users.
* Structure is documented below.
*/
@JvmName("vlvpxbwggyyokgod")
public suspend fun accessRestrictions(`value`: Output) {
this.accessRestrictions = value
}
/**
* @param value A user-specified description of the pool. Cannot exceed 256 characters.
*/
@JvmName("jrmkiovrkoqwglds")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value Whether the pool is disabled. You cannot use a disabled pool to exchange tokens,
* or use existing tokens to access resources. If the pool is re-enabled, existing tokens grant access again.
*/
@JvmName("ahrhewuahvceebxr")
public suspend fun disabled(`value`: Output) {
this.disabled = value
}
/**
* @param value A user-specified display name of the pool in Google Cloud Console. Cannot exceed 32 characters.
*/
@JvmName("dspshfnobsctkido")
public suspend fun displayName(`value`: Output) {
this.displayName = value
}
/**
* @param value The location for the resource.
*/
@JvmName("ddriptdxndiruejx")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value Immutable. The resource name of the parent. Format: `organizations/{org-id}`.
* - - -
*/
@JvmName("jywabvydepahykga")
public suspend fun parent(`value`: Output) {
this.parent = value
}
/**
* @param value Duration that the Google Cloud access tokens, console sign-in sessions,
* and `gcloud` sign-in sessions from this pool are valid.
* Must be greater than 15 minutes (900s) and less than 12 hours (43200s).
* If `sessionDuration` is not configured, minted credentials have a default duration of one hour (3600s).
* A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: "`3.5s`".
*/
@JvmName("rsvjwgnllertqalj")
public suspend fun sessionDuration(`value`: Output) {
this.sessionDuration = value
}
/**
* @param value The name of the pool. The ID must be a globally unique string of 6 to 63 lowercase letters,
* digits, or hyphens. It must start with a letter, and cannot have a trailing hyphen.
* The prefix `gcp-` is reserved for use by Google, and may not be specified.
*/
@JvmName("ywnbeixqcaychvts")
public suspend fun workforcePoolId(`value`: Output) {
this.workforcePoolId = value
}
/**
* @param value Configure access restrictions on the workforce pool users. This is an optional field. If specified web
* sign-in can be restricted to given set of services or programmatic sign-in can be disabled for pool users.
* Structure is documented below.
*/
@JvmName("waakofaibesqbypw")
public suspend fun accessRestrictions(`value`: WorkforcePoolAccessRestrictionsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.accessRestrictions = mapped
}
/**
* @param argument Configure access restrictions on the workforce pool users. This is an optional field. If specified web
* sign-in can be restricted to given set of services or programmatic sign-in can be disabled for pool users.
* Structure is documented below.
*/
@JvmName("yjsvlepytponocxx")
public suspend fun accessRestrictions(argument: suspend WorkforcePoolAccessRestrictionsArgsBuilder.() -> Unit) {
val toBeMapped = WorkforcePoolAccessRestrictionsArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.accessRestrictions = mapped
}
/**
* @param value A user-specified description of the pool. Cannot exceed 256 characters.
*/
@JvmName("istfhtqxolefdoxm")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value Whether the pool is disabled. You cannot use a disabled pool to exchange tokens,
* or use existing tokens to access resources. If the pool is re-enabled, existing tokens grant access again.
*/
@JvmName("ncvkanodnpnrdkpn")
public suspend fun disabled(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.disabled = mapped
}
/**
* @param value A user-specified display name of the pool in Google Cloud Console. Cannot exceed 32 characters.
*/
@JvmName("tktiamhiiwdvdtmm")
public suspend fun displayName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.displayName = mapped
}
/**
* @param value The location for the resource.
*/
@JvmName("pbrjoewfonrcokdq")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value Immutable. The resource name of the parent. Format: `organizations/{org-id}`.
* - - -
*/
@JvmName("yvsitblklfavmlwj")
public suspend fun parent(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.parent = mapped
}
/**
* @param value Duration that the Google Cloud access tokens, console sign-in sessions,
* and `gcloud` sign-in sessions from this pool are valid.
* Must be greater than 15 minutes (900s) and less than 12 hours (43200s).
* If `sessionDuration` is not configured, minted credentials have a default duration of one hour (3600s).
* A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: "`3.5s`".
*/
@JvmName("fjsxvgjvjmqrvwew")
public suspend fun sessionDuration(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sessionDuration = mapped
}
/**
* @param value The name of the pool. The ID must be a globally unique string of 6 to 63 lowercase letters,
* digits, or hyphens. It must start with a letter, and cannot have a trailing hyphen.
* The prefix `gcp-` is reserved for use by Google, and may not be specified.
*/
@JvmName("rcjghusnmgdbptpa")
public suspend fun workforcePoolId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.workforcePoolId = mapped
}
internal fun build(): WorkforcePoolArgs = WorkforcePoolArgs(
accessRestrictions = accessRestrictions,
description = description,
disabled = disabled,
displayName = displayName,
location = location,
parent = parent,
sessionDuration = sessionDuration,
workforcePoolId = workforcePoolId,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy