com.pulumi.gcp.privilegedaccessmanager.kotlin.EntitlementArgs.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.privilegedaccessmanager.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.privilegedaccessmanager.EntitlementArgs.builder
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementAdditionalNotificationTargetsArgs
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementAdditionalNotificationTargetsArgsBuilder
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementApprovalWorkflowArgs
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementApprovalWorkflowArgsBuilder
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementEligibleUserArgs
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementEligibleUserArgsBuilder
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementPrivilegedAccessArgs
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementPrivilegedAccessArgsBuilder
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementRequesterJustificationConfigArgs
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.EntitlementRequesterJustificationConfigArgsBuilder
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
/**
* ## Example Usage
* ### Privileged Access Manager Entitlement Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const tfentitlement = new gcp.privilegedaccessmanager.Entitlement("tfentitlement", {
* entitlementId: "example-entitlement",
* location: "global",
* maxRequestDuration: "43200s",
* parent: "projects/my-project-name",
* requesterJustificationConfig: {
* unstructured: {},
* },
* eligibleUsers: [{
* principals: ["group:test@google.com"],
* }],
* privilegedAccess: {
* gcpIamAccess: {
* roleBindings: [{
* role: "roles/storage.admin",
* conditionExpression: "request.time < timestamp(\"2024-04-23T18:30:00.000Z\")",
* }],
* resource: "//cloudresourcemanager.googleapis.com/projects/my-project-name",
* resourceType: "cloudresourcemanager.googleapis.com/Project",
* },
* },
* additionalNotificationTargets: {
* adminEmailRecipients: ["user@example.com"],
* requesterEmailRecipients: ["user@example.com"],
* },
* approvalWorkflow: {
* manualApprovals: {
* requireApproverJustification: true,
* steps: [{
* approvalsNeeded: 1,
* approverEmailRecipients: ["user@example.com"],
* approvers: {
* principals: ["group:test@google.com"],
* },
* }],
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* tfentitlement = gcp.privilegedaccessmanager.Entitlement("tfentitlement",
* entitlement_id="example-entitlement",
* location="global",
* max_request_duration="43200s",
* parent="projects/my-project-name",
* requester_justification_config=gcp.privilegedaccessmanager.EntitlementRequesterJustificationConfigArgs(
* unstructured=gcp.privilegedaccessmanager.EntitlementRequesterJustificationConfigUnstructuredArgs(),
* ),
* eligible_users=[gcp.privilegedaccessmanager.EntitlementEligibleUserArgs(
* principals=["group:test@google.com"],
* )],
* privileged_access=gcp.privilegedaccessmanager.EntitlementPrivilegedAccessArgs(
* gcp_iam_access=gcp.privilegedaccessmanager.EntitlementPrivilegedAccessGcpIamAccessArgs(
* role_bindings=[gcp.privilegedaccessmanager.EntitlementPrivilegedAccessGcpIamAccessRoleBindingArgs(
* role="roles/storage.admin",
* condition_expression="request.time < timestamp(\"2024-04-23T18:30:00.000Z\")",
* )],
* resource="//cloudresourcemanager.googleapis.com/projects/my-project-name",
* resource_type="cloudresourcemanager.googleapis.com/Project",
* ),
* ),
* additional_notification_targets=gcp.privilegedaccessmanager.EntitlementAdditionalNotificationTargetsArgs(
* admin_email_recipients=["user@example.com"],
* requester_email_recipients=["user@example.com"],
* ),
* approval_workflow=gcp.privilegedaccessmanager.EntitlementApprovalWorkflowArgs(
* manual_approvals=gcp.privilegedaccessmanager.EntitlementApprovalWorkflowManualApprovalsArgs(
* require_approver_justification=True,
* steps=[gcp.privilegedaccessmanager.EntitlementApprovalWorkflowManualApprovalsStepArgs(
* approvals_needed=1,
* approver_email_recipients=["user@example.com"],
* approvers=gcp.privilegedaccessmanager.EntitlementApprovalWorkflowManualApprovalsStepApproversArgs(
* principals=["group:test@google.com"],
* ),
* )],
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var tfentitlement = new Gcp.PrivilegedAccessManager.Entitlement("tfentitlement", new()
* {
* EntitlementId = "example-entitlement",
* Location = "global",
* MaxRequestDuration = "43200s",
* Parent = "projects/my-project-name",
* RequesterJustificationConfig = new Gcp.PrivilegedAccessManager.Inputs.EntitlementRequesterJustificationConfigArgs
* {
* Unstructured = null,
* },
* EligibleUsers = new[]
* {
* new Gcp.PrivilegedAccessManager.Inputs.EntitlementEligibleUserArgs
* {
* Principals = new[]
* {
* "group:[email protected]",
* },
* },
* },
* PrivilegedAccess = new Gcp.PrivilegedAccessManager.Inputs.EntitlementPrivilegedAccessArgs
* {
* GcpIamAccess = new Gcp.PrivilegedAccessManager.Inputs.EntitlementPrivilegedAccessGcpIamAccessArgs
* {
* RoleBindings = new[]
* {
* new Gcp.PrivilegedAccessManager.Inputs.EntitlementPrivilegedAccessGcpIamAccessRoleBindingArgs
* {
* Role = "roles/storage.admin",
* ConditionExpression = "request.time < timestamp(\"2024-04-23T18:30:00.000Z\")",
* },
* },
* Resource = "//cloudresourcemanager.googleapis.com/projects/my-project-name",
* ResourceType = "cloudresourcemanager.googleapis.com/Project",
* },
* },
* AdditionalNotificationTargets = new Gcp.PrivilegedAccessManager.Inputs.EntitlementAdditionalNotificationTargetsArgs
* {
* AdminEmailRecipients = new[]
* {
* "[email protected]",
* },
* RequesterEmailRecipients = new[]
* {
* "[email protected]",
* },
* },
* ApprovalWorkflow = new Gcp.PrivilegedAccessManager.Inputs.EntitlementApprovalWorkflowArgs
* {
* ManualApprovals = new Gcp.PrivilegedAccessManager.Inputs.EntitlementApprovalWorkflowManualApprovalsArgs
* {
* RequireApproverJustification = true,
* Steps = new[]
* {
* new Gcp.PrivilegedAccessManager.Inputs.EntitlementApprovalWorkflowManualApprovalsStepArgs
* {
* ApprovalsNeeded = 1,
* ApproverEmailRecipients = new[]
* {
* "[email protected]",
* },
* Approvers = new Gcp.PrivilegedAccessManager.Inputs.EntitlementApprovalWorkflowManualApprovalsStepApproversArgs
* {
* Principals = new[]
* {
* "group:[email protected]",
* },
* },
* },
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/privilegedaccessmanager"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := privilegedaccessmanager.Newentitlement(ctx, "tfentitlement", &privilegedaccessmanager.entitlementArgs{
* EntitlementId: pulumi.String("example-entitlement"),
* Location: pulumi.String("global"),
* MaxRequestDuration: pulumi.String("43200s"),
* Parent: pulumi.String("projects/my-project-name"),
* RequesterJustificationConfig: &privilegedaccessmanager.EntitlementRequesterJustificationConfigArgs{
* Unstructured: nil,
* },
* EligibleUsers: privilegedaccessmanager.EntitlementEligibleUserArray{
* &privilegedaccessmanager.EntitlementEligibleUserArgs{
* Principals: pulumi.StringArray{
* pulumi.String("group:[email protected]"),
* },
* },
* },
* PrivilegedAccess: &privilegedaccessmanager.EntitlementPrivilegedAccessArgs{
* GcpIamAccess: &privilegedaccessmanager.EntitlementPrivilegedAccessGcpIamAccessArgs{
* RoleBindings: privilegedaccessmanager.EntitlementPrivilegedAccessGcpIamAccessRoleBindingArray{
* &privilegedaccessmanager.EntitlementPrivilegedAccessGcpIamAccessRoleBindingArgs{
* Role: pulumi.String("roles/storage.admin"),
* ConditionExpression: pulumi.String("request.time < timestamp(\"2024-04-23T18:30:00.000Z\")"),
* },
* },
* Resource: pulumi.String("//cloudresourcemanager.googleapis.com/projects/my-project-name"),
* ResourceType: pulumi.String("cloudresourcemanager.googleapis.com/Project"),
* },
* },
* AdditionalNotificationTargets: &privilegedaccessmanager.EntitlementAdditionalNotificationTargetsArgs{
* AdminEmailRecipients: pulumi.StringArray{
* pulumi.String("[email protected]"),
* },
* RequesterEmailRecipients: pulumi.StringArray{
* pulumi.String("[email protected]"),
* },
* },
* ApprovalWorkflow: &privilegedaccessmanager.EntitlementApprovalWorkflowArgs{
* ManualApprovals: &privilegedaccessmanager.EntitlementApprovalWorkflowManualApprovalsArgs{
* RequireApproverJustification: pulumi.Bool(true),
* Steps: privilegedaccessmanager.EntitlementApprovalWorkflowManualApprovalsStepArray{
* &privilegedaccessmanager.EntitlementApprovalWorkflowManualApprovalsStepArgs{
* ApprovalsNeeded: pulumi.Int(1),
* ApproverEmailRecipients: pulumi.StringArray{
* pulumi.String("[email protected]"),
* },
* Approvers: &privilegedaccessmanager.EntitlementApprovalWorkflowManualApprovalsStepApproversArgs{
* Principals: pulumi.StringArray{
* pulumi.String("group:[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.privilegedaccessmanager.entitlement;
* import com.pulumi.gcp.privilegedaccessmanager.EntitlementArgs;
* import com.pulumi.gcp.privilegedaccessmanager.inputs.EntitlementRequesterJustificationConfigArgs;
* import com.pulumi.gcp.privilegedaccessmanager.inputs.EntitlementRequesterJustificationConfigUnstructuredArgs;
* import com.pulumi.gcp.privilegedaccessmanager.inputs.EntitlementEligibleUserArgs;
* import com.pulumi.gcp.privilegedaccessmanager.inputs.EntitlementPrivilegedAccessArgs;
* import com.pulumi.gcp.privilegedaccessmanager.inputs.EntitlementPrivilegedAccessGcpIamAccessArgs;
* import com.pulumi.gcp.privilegedaccessmanager.inputs.EntitlementAdditionalNotificationTargetsArgs;
* import com.pulumi.gcp.privilegedaccessmanager.inputs.EntitlementApprovalWorkflowArgs;
* import com.pulumi.gcp.privilegedaccessmanager.inputs.EntitlementApprovalWorkflowManualApprovalsArgs;
* 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 tfentitlement = new Entitlement("tfentitlement", EntitlementArgs.builder()
* .entitlementId("example-entitlement")
* .location("global")
* .maxRequestDuration("43200s")
* .parent("projects/my-project-name")
* .requesterJustificationConfig(EntitlementRequesterJustificationConfigArgs.builder()
* .unstructured()
* .build())
* .eligibleUsers(EntitlementEligibleUserArgs.builder()
* .principals("group:[email protected]")
* .build())
* .privilegedAccess(EntitlementPrivilegedAccessArgs.builder()
* .gcpIamAccess(EntitlementPrivilegedAccessGcpIamAccessArgs.builder()
* .roleBindings(EntitlementPrivilegedAccessGcpIamAccessRoleBindingArgs.builder()
* .role("roles/storage.admin")
* .conditionExpression("request.time < timestamp(\"2024-04-23T18:30:00.000Z\")")
* .build())
* .resource("//cloudresourcemanager.googleapis.com/projects/my-project-name")
* .resourceType("cloudresourcemanager.googleapis.com/Project")
* .build())
* .build())
* .additionalNotificationTargets(EntitlementAdditionalNotificationTargetsArgs.builder()
* .adminEmailRecipients("[email protected]")
* .requesterEmailRecipients("[email protected]")
* .build())
* .approvalWorkflow(EntitlementApprovalWorkflowArgs.builder()
* .manualApprovals(EntitlementApprovalWorkflowManualApprovalsArgs.builder()
* .requireApproverJustification(true)
* .steps(EntitlementApprovalWorkflowManualApprovalsStepArgs.builder()
* .approvalsNeeded(1)
* .approverEmailRecipients("[email protected]")
* .approvers(EntitlementApprovalWorkflowManualApprovalsStepApproversArgs.builder()
* .principals("group:[email protected]")
* .build())
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* tfentitlement:
* type: gcp:privilegedaccessmanager:entitlement
* properties:
* entitlementId: example-entitlement
* location: global
* maxRequestDuration: 43200s
* parent: projects/my-project-name
* requesterJustificationConfig:
* unstructured: {}
* eligibleUsers:
* - principals:
* - group:[email protected]
* privilegedAccess:
* gcpIamAccess:
* roleBindings:
* - role: roles/storage.admin
* conditionExpression: request.time < timestamp("2024-04-23T18:30:00.000Z")
* resource: //cloudresourcemanager.googleapis.com/projects/my-project-name
* resourceType: cloudresourcemanager.googleapis.com/Project
* additionalNotificationTargets:
* adminEmailRecipients:
* - [email protected]
* requesterEmailRecipients:
* - [email protected]
* approvalWorkflow:
* manualApprovals:
* requireApproverJustification: true
* steps:
* - approvalsNeeded: 1
* approverEmailRecipients:
* - [email protected]
* approvers:
* principals:
* - group:[email protected]
* ```
*
* ## Import
* Entitlement can be imported using any of these accepted formats:
* * `{{parent}}/locations/{{location}}/entitlements/{{entitlement_id}}`
* When using the `pulumi import` command, Entitlement can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:privilegedaccessmanager/entitlement:entitlement default {{parent}}/locations/{{location}}/entitlements/{{entitlement_id}}
* ```
* @property additionalNotificationTargets AdditionalNotificationTargets includes email addresses to be notified.
* @property approvalWorkflow The approvals needed before access will be granted to a requester. No approvals will be needed if this field is null.
* Different types of approval workflows that can be used to gate privileged access granting.
* @property eligibleUsers Who can create Grants using Entitlement. This list should contain at most one entry
* Structure is documented below.
* @property entitlementId The ID to use for this Entitlement. This will become the last part of the resource name.
* This value should be 4-63 characters, and valid characters are "[a-z]", "[0-9]", and "-". The first character should be from [a-z].
* This value should be unique among all other Entitlements under the specified `parent`.
* @property location The region of the Entitlement resource.
* @property maxRequestDuration The maximum amount of time for which access would be granted for a request.
* A requester can choose to ask for access for less than this duration but never more.
* Format: calculate the time in seconds and concatenate it with 's' i.e. 2 hours = "7200s", 45 minutes = "2700s"
* @property parent Format: project/{project_id} or organization/{organization_number} or folder/{folder_number}
* @property privilegedAccess Privileged access that this service can be used to gate.
* Structure is documented below.
* @property requesterJustificationConfig Defines the ways in which a requester should provide the justification while requesting for access.
* Structure is documented below.
*/
public data class EntitlementArgs(
public val additionalNotificationTargets: Output? =
null,
public val approvalWorkflow: Output? = null,
public val eligibleUsers: Output>? = null,
public val entitlementId: Output? = null,
public val location: Output? = null,
public val maxRequestDuration: Output? = null,
public val parent: Output? = null,
public val privilegedAccess: Output? = null,
public val requesterJustificationConfig: Output? =
null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.privilegedaccessmanager.EntitlementArgs =
com.pulumi.gcp.privilegedaccessmanager.EntitlementArgs.builder()
.additionalNotificationTargets(
additionalNotificationTargets?.applyValue({ args0 ->
args0.let({ args0 -> args0.toJava() })
}),
)
.approvalWorkflow(approvalWorkflow?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.eligibleUsers(
eligibleUsers?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.entitlementId(entitlementId?.applyValue({ args0 -> args0 }))
.location(location?.applyValue({ args0 -> args0 }))
.maxRequestDuration(maxRequestDuration?.applyValue({ args0 -> args0 }))
.parent(parent?.applyValue({ args0 -> args0 }))
.privilegedAccess(privilegedAccess?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.requesterJustificationConfig(
requesterJustificationConfig?.applyValue({ args0 ->
args0.let({ args0 -> args0.toJava() })
}),
).build()
}
/**
* Builder for [EntitlementArgs].
*/
@PulumiTagMarker
public class EntitlementArgsBuilder internal constructor() {
private var additionalNotificationTargets: Output? =
null
private var approvalWorkflow: Output? = null
private var eligibleUsers: Output>? = null
private var entitlementId: Output? = null
private var location: Output? = null
private var maxRequestDuration: Output? = null
private var parent: Output? = null
private var privilegedAccess: Output? = null
private var requesterJustificationConfig: Output? =
null
/**
* @param value AdditionalNotificationTargets includes email addresses to be notified.
*/
@JvmName("ollsjjgxgedjeois")
public suspend fun additionalNotificationTargets(`value`: Output) {
this.additionalNotificationTargets = value
}
/**
* @param value The approvals needed before access will be granted to a requester. No approvals will be needed if this field is null.
* Different types of approval workflows that can be used to gate privileged access granting.
*/
@JvmName("qreclxvtxdthbrfa")
public suspend fun approvalWorkflow(`value`: Output) {
this.approvalWorkflow = value
}
/**
* @param value Who can create Grants using Entitlement. This list should contain at most one entry
* Structure is documented below.
*/
@JvmName("aocchvijbbyhifhs")
public suspend fun eligibleUsers(`value`: Output>) {
this.eligibleUsers = value
}
@JvmName("fvjammmadvbhdhhy")
public suspend fun eligibleUsers(vararg values: Output) {
this.eligibleUsers = Output.all(values.asList())
}
/**
* @param values Who can create Grants using Entitlement. This list should contain at most one entry
* Structure is documented below.
*/
@JvmName("enwlpyxrdaeffiqo")
public suspend fun eligibleUsers(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy