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

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

package com.pulumi.gcp.privilegedaccessmanager.kotlin

import com.pulumi.gcp.privilegedaccessmanager.PrivilegedaccessmanagerFunctions.getEntitlementPlain
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.GetEntitlementPlainArgs
import com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.GetEntitlementPlainArgsBuilder
import com.pulumi.gcp.privilegedaccessmanager.kotlin.outputs.GetEntitlementResult
import com.pulumi.gcp.privilegedaccessmanager.kotlin.outputs.GetEntitlementResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object PrivilegedaccessmanagerFunctions {
    /**
     * Use this data source to get information about a Google Cloud Privileged Access Manager Entitlement.
     * To get more information about Privileged Access Manager, see:
     * * [API Documentation](https://cloud.google.com/iam/docs/reference/pam/rest)
     * * How-to guides
     *   * [Official documentation](https://cloud.google.com/iam/docs/pam-overview)
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const my-entitlement = gcp.privilegedaccessmanager.getEntitlement({
     *     parent: "projects/my-project",
     *     location: "global",
     *     entitlementId: "my-entitlement",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * my_entitlement = gcp.privilegedaccessmanager.get_entitlement(parent="projects/my-project",
     *     location="global",
     *     entitlement_id="my-entitlement")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var my_entitlement = Gcp.PrivilegedAccessManager.GetEntitlement.Invoke(new()
     *     {
     *         Parent = "projects/my-project",
     *         Location = "global",
     *         EntitlementId = "my-entitlement",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/privilegedaccessmanager"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := privilegedaccessmanager.LookupEntitlement(ctx, &privilegedaccessmanager.LookupEntitlementArgs{
     * 			Parent:        pulumi.StringRef("projects/my-project"),
     * 			Location:      pulumi.StringRef("global"),
     * 			EntitlementId: pulumi.StringRef("my-entitlement"),
     * 		}, nil)
     * 		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.PrivilegedaccessmanagerFunctions;
     * import com.pulumi.gcp.privilegedaccessmanager.inputs.GetEntitlementArgs;
     * 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) {
     *         final var my-entitlement = PrivilegedaccessmanagerFunctions.getEntitlement(GetEntitlementArgs.builder()
     *             .parent("projects/my-project")
     *             .location("global")
     *             .entitlementId("my-entitlement")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   my-entitlement:
     *     fn::invoke:
     *       function: gcp:privilegedaccessmanager:getEntitlement
     *       arguments:
     *         parent: projects/my-project
     *         location: global
     *         entitlementId: my-entitlement
     * ```
     * 
     * @param argument A collection of arguments for invoking getEntitlement.
     * @return A collection of values returned by getEntitlement.
     */
    public suspend fun getEntitlement(argument: GetEntitlementPlainArgs): GetEntitlementResult =
        toKotlin(getEntitlementPlain(argument.toJava()).await())

    /**
     * @see [getEntitlement].
     * @param entitlementId ID of the Entitlement resource. This is the last part of the Entitlement's full name which is of the format `{parent}/locations/{location}/entitlements/{entitlement_id}`.
     * @param location The region of the Entitlement resource.
     * @param parent The project or folder or organization that contains the resource. Format: projects/{project-id|project-number} or folders/{folder-number}  or organizations/{organization-number}
     * @return A collection of values returned by getEntitlement.
     */
    public suspend fun getEntitlement(
        entitlementId: String? = null,
        location: String? = null,
        parent: String? = null,
    ): GetEntitlementResult {
        val argument = GetEntitlementPlainArgs(
            entitlementId = entitlementId,
            location = location,
            parent = parent,
        )
        return toKotlin(getEntitlementPlain(argument.toJava()).await())
    }

    /**
     * @see [getEntitlement].
     * @param argument Builder for [com.pulumi.gcp.privilegedaccessmanager.kotlin.inputs.GetEntitlementPlainArgs].
     * @return A collection of values returned by getEntitlement.
     */
    public suspend fun getEntitlement(argument: suspend GetEntitlementPlainArgsBuilder.() -> Unit): GetEntitlementResult {
        val builder = GetEntitlementPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getEntitlementPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy