UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

293 lines (292 loc) • 14.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * An Entitlement defines the eligibility of a set of users to obtain a predefined access for some time possibly after going through an approval workflow. * * To get more information about Entitlement, see: * * * [API documentation](https://cloud.google.com/iam/docs/reference/pam/rest) * * How-to Guides * * [How to create an Entitlement](https://cloud.google.com/iam/docs/pam-create-entitlements) * * [Official Documentation](https://cloud.google.com/iam/docs/pam-overview) * * ## 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"], * }, * }], * }, * }, * }); * ``` * * ## 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}} * ``` */ export declare class Entitlement extends pulumi.CustomResource { /** * Get an existing Entitlement resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EntitlementState, opts?: pulumi.CustomResourceOptions): Entitlement; /** * Returns true if the given object is an instance of Entitlement. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Entitlement; /** * AdditionalNotificationTargets includes email addresses to be notified. * Structure is documented below. */ readonly additionalNotificationTargets: pulumi.Output<outputs.privilegedaccessmanager.EntitlementAdditionalNotificationTargets | undefined>; /** * 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. * Structure is documented below. */ readonly approvalWorkflow: pulumi.Output<outputs.privilegedaccessmanager.EntitlementApprovalWorkflow | undefined>; /** * Output only. Create time stamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z" */ readonly createTime: pulumi.Output<string>; /** * Who can create Grants using Entitlement. This list should contain at most one entry * Structure is documented below. */ readonly eligibleUsers: pulumi.Output<outputs.privilegedaccessmanager.EntitlementEligibleUser[]>; /** * 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`. */ readonly entitlementId: pulumi.Output<string>; /** * For Resource freshness validation (https://google.aip.dev/154) */ readonly etag: pulumi.Output<string>; /** * The region of the Entitlement resource. */ readonly location: pulumi.Output<string>; /** * 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" */ readonly maxRequestDuration: pulumi.Output<string>; /** * Output Only. The entitlement's name follows a hierarchical structure, comprising the organization, folder, or project, alongside the region and a unique entitlement ID. * Formats: organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}, folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}, and projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}. */ readonly name: pulumi.Output<string>; /** * Format: projects/{project-id|project-number} or organizations/{organization-number} or folders/{folder-number} */ readonly parent: pulumi.Output<string>; /** * Privileged access that this service can be used to gate. * Structure is documented below. */ readonly privilegedAccess: pulumi.Output<outputs.privilegedaccessmanager.EntitlementPrivilegedAccess>; /** * Defines the ways in which a requester should provide the justification while requesting for access. * Structure is documented below. */ readonly requesterJustificationConfig: pulumi.Output<outputs.privilegedaccessmanager.EntitlementRequesterJustificationConfig>; /** * Output only. The current state of the Entitlement. */ readonly state: pulumi.Output<string>; /** * Output only. Update time stamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". */ readonly updateTime: pulumi.Output<string>; /** * Create a Entitlement resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: EntitlementArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering entitlement resources. */ export interface EntitlementState { /** * AdditionalNotificationTargets includes email addresses to be notified. * Structure is documented below. */ additionalNotificationTargets?: pulumi.Input<inputs.privilegedaccessmanager.EntitlementAdditionalNotificationTargets>; /** * 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. * Structure is documented below. */ approvalWorkflow?: pulumi.Input<inputs.privilegedaccessmanager.EntitlementApprovalWorkflow>; /** * Output only. Create time stamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z" */ createTime?: pulumi.Input<string>; /** * Who can create Grants using Entitlement. This list should contain at most one entry * Structure is documented below. */ eligibleUsers?: pulumi.Input<pulumi.Input<inputs.privilegedaccessmanager.EntitlementEligibleUser>[]>; /** * 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`. */ entitlementId?: pulumi.Input<string>; /** * For Resource freshness validation (https://google.aip.dev/154) */ etag?: pulumi.Input<string>; /** * The region of the Entitlement resource. */ location?: pulumi.Input<string>; /** * 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" */ maxRequestDuration?: pulumi.Input<string>; /** * Output Only. The entitlement's name follows a hierarchical structure, comprising the organization, folder, or project, alongside the region and a unique entitlement ID. * Formats: organizations/{organization-number}/locations/{region}/entitlements/{entitlement-id}, folders/{folder-number}/locations/{region}/entitlements/{entitlement-id}, and projects/{project-id|project-number}/locations/{region}/entitlements/{entitlement-id}. */ name?: pulumi.Input<string>; /** * Format: projects/{project-id|project-number} or organizations/{organization-number} or folders/{folder-number} */ parent?: pulumi.Input<string>; /** * Privileged access that this service can be used to gate. * Structure is documented below. */ privilegedAccess?: pulumi.Input<inputs.privilegedaccessmanager.EntitlementPrivilegedAccess>; /** * Defines the ways in which a requester should provide the justification while requesting for access. * Structure is documented below. */ requesterJustificationConfig?: pulumi.Input<inputs.privilegedaccessmanager.EntitlementRequesterJustificationConfig>; /** * Output only. The current state of the Entitlement. */ state?: pulumi.Input<string>; /** * Output only. Update time stamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". */ updateTime?: pulumi.Input<string>; } /** * The set of arguments for constructing a Entitlement resource. */ export interface EntitlementArgs { /** * AdditionalNotificationTargets includes email addresses to be notified. * Structure is documented below. */ additionalNotificationTargets?: pulumi.Input<inputs.privilegedaccessmanager.EntitlementAdditionalNotificationTargets>; /** * 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. * Structure is documented below. */ approvalWorkflow?: pulumi.Input<inputs.privilegedaccessmanager.EntitlementApprovalWorkflow>; /** * Who can create Grants using Entitlement. This list should contain at most one entry * Structure is documented below. */ eligibleUsers: pulumi.Input<pulumi.Input<inputs.privilegedaccessmanager.EntitlementEligibleUser>[]>; /** * 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`. */ entitlementId: pulumi.Input<string>; /** * The region of the Entitlement resource. */ location: pulumi.Input<string>; /** * 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" */ maxRequestDuration: pulumi.Input<string>; /** * Format: projects/{project-id|project-number} or organizations/{organization-number} or folders/{folder-number} */ parent: pulumi.Input<string>; /** * Privileged access that this service can be used to gate. * Structure is documented below. */ privilegedAccess: pulumi.Input<inputs.privilegedaccessmanager.EntitlementPrivilegedAccess>; /** * Defines the ways in which a requester should provide the justification while requesting for access. * Structure is documented below. */ requesterJustificationConfig: pulumi.Input<inputs.privilegedaccessmanager.EntitlementRequesterJustificationConfig>; }