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

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

package com.pulumi.gcp.securitycenter.kotlin

import com.pulumi.gcp.securitycenter.SecuritycenterFunctions.getSourceIamPolicyPlain
import com.pulumi.gcp.securitycenter.kotlin.inputs.GetSourceIamPolicyPlainArgs
import com.pulumi.gcp.securitycenter.kotlin.inputs.GetSourceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.securitycenter.kotlin.outputs.GetSourceIamPolicyResult
import com.pulumi.gcp.securitycenter.kotlin.outputs.GetSourceIamPolicyResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object SecuritycenterFunctions {
    /**
     * Retrieves the current IAM policy data for source
     * ## example
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const policy = gcp.securitycenter.getSourceIamPolicy({
     *     source: customSource.name,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * policy = gcp.securitycenter.get_source_iam_policy(source=custom_source["name"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var policy = Gcp.SecurityCenter.GetSourceIamPolicy.Invoke(new()
     *     {
     *         Source = customSource.Name,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/securitycenter"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := securitycenter.LookupSourceIamPolicy(ctx, &securitycenter.LookupSourceIamPolicyArgs{
     * 			Source: customSource.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.securitycenter.SecuritycenterFunctions;
     * import com.pulumi.gcp.securitycenter.inputs.GetSourceIamPolicyArgs;
     * 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 = SecuritycenterFunctions.getSourceIamPolicy(GetSourceIamPolicyArgs.builder()
     *             .source(customSource.name())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   policy:
     *     fn::invoke:
     *       Function: gcp:securitycenter:getSourceIamPolicy
     *       Arguments:
     *         source: ${customSource.name}
     * ```
     * 
     * @param argument A collection of arguments for invoking getSourceIamPolicy.
     * @return A collection of values returned by getSourceIamPolicy.
     */
    public suspend fun getSourceIamPolicy(argument: GetSourceIamPolicyPlainArgs): GetSourceIamPolicyResult = toKotlin(getSourceIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getSourceIamPolicy].
     * @param organization
     * @param source Used to find the parent resource to bind the IAM policy to
     * @return A collection of values returned by getSourceIamPolicy.
     */
    public suspend fun getSourceIamPolicy(organization: String, source: String): GetSourceIamPolicyResult {
        val argument = GetSourceIamPolicyPlainArgs(
            organization = organization,
            source = source,
        )
        return toKotlin(getSourceIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getSourceIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.securitycenter.kotlin.inputs.GetSourceIamPolicyPlainArgs].
     * @return A collection of values returned by getSourceIamPolicy.
     */
    public suspend fun getSourceIamPolicy(argument: suspend GetSourceIamPolicyPlainArgsBuilder.() -> Unit): GetSourceIamPolicyResult {
        val builder = GetSourceIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getSourceIamPolicyPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy