com.pulumi.gcp.binaryauthorization.kotlin.BinaryauthorizationFunctions.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.binaryauthorization.kotlin
import com.pulumi.gcp.binaryauthorization.BinaryauthorizationFunctions.getAttestorIamPolicyPlain
import com.pulumi.gcp.binaryauthorization.kotlin.inputs.GetAttestorIamPolicyPlainArgs
import com.pulumi.gcp.binaryauthorization.kotlin.inputs.GetAttestorIamPolicyPlainArgsBuilder
import com.pulumi.gcp.binaryauthorization.kotlin.outputs.GetAttestorIamPolicyResult
import com.pulumi.gcp.binaryauthorization.kotlin.outputs.GetAttestorIamPolicyResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object BinaryauthorizationFunctions {
/**
* Retrieves the current IAM policy data for attestor
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.binaryauthorization.getAttestorIamPolicy({
* project: attestor.project,
* attestor: attestor.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.binaryauthorization.get_attestor_iam_policy(project=attestor["project"],
* attestor=attestor["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.BinaryAuthorization.GetAttestorIamPolicy.Invoke(new()
* {
* Project = attestor.Project,
* Attestor = attestor.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/binaryauthorization"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := binaryauthorization.LookupAttestorIamPolicy(ctx, &binaryauthorization.LookupAttestorIamPolicyArgs{
* Project: pulumi.StringRef(attestor.Project),
* Attestor: attestor.Name,
* }, 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.binaryauthorization.BinaryauthorizationFunctions;
* import com.pulumi.gcp.binaryauthorization.inputs.GetAttestorIamPolicyArgs;
* 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 policy = BinaryauthorizationFunctions.getAttestorIamPolicy(GetAttestorIamPolicyArgs.builder()
* .project(attestor.project())
* .attestor(attestor.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:binaryauthorization:getAttestorIamPolicy
* Arguments:
* project: ${attestor.project}
* attestor: ${attestor.name}
* ```
*
* @param argument A collection of arguments for invoking getAttestorIamPolicy.
* @return A collection of values returned by getAttestorIamPolicy.
*/
public suspend fun getAttestorIamPolicy(argument: GetAttestorIamPolicyPlainArgs): GetAttestorIamPolicyResult = toKotlin(getAttestorIamPolicyPlain(argument.toJava()).await())
/**
* @see [getAttestorIamPolicy].
* @param attestor Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getAttestorIamPolicy.
*/
public suspend fun getAttestorIamPolicy(attestor: String, project: String? = null): GetAttestorIamPolicyResult {
val argument = GetAttestorIamPolicyPlainArgs(
attestor = attestor,
project = project,
)
return toKotlin(getAttestorIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getAttestorIamPolicy].
* @param argument Builder for [com.pulumi.gcp.binaryauthorization.kotlin.inputs.GetAttestorIamPolicyPlainArgs].
* @return A collection of values returned by getAttestorIamPolicy.
*/
public suspend fun getAttestorIamPolicy(argument: suspend GetAttestorIamPolicyPlainArgsBuilder.() -> Unit): GetAttestorIamPolicyResult {
val builder = GetAttestorIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getAttestorIamPolicyPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy