com.pulumi.gcp.securesourcemanager.kotlin.SecuresourcemanagerFunctions.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.securesourcemanager.kotlin
import com.pulumi.gcp.securesourcemanager.SecuresourcemanagerFunctions.getInstanceIamPolicyPlain
import com.pulumi.gcp.securesourcemanager.kotlin.inputs.GetInstanceIamPolicyPlainArgs
import com.pulumi.gcp.securesourcemanager.kotlin.inputs.GetInstanceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.securesourcemanager.kotlin.outputs.GetInstanceIamPolicyResult
import com.pulumi.gcp.securesourcemanager.kotlin.outputs.GetInstanceIamPolicyResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object SecuresourcemanagerFunctions {
/**
* Retrieves the current IAM policy data for instance
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.securesourcemanager.getInstanceIamPolicy({
* project: _default.project,
* location: _default.location,
* instanceId: _default.instanceId,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.securesourcemanager.get_instance_iam_policy(project=default["project"],
* location=default["location"],
* instance_id=default["instanceId"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.SecureSourceManager.GetInstanceIamPolicy.Invoke(new()
* {
* Project = @default.Project,
* Location = @default.Location,
* InstanceId = @default.InstanceId,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/securesourcemanager"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := securesourcemanager.LookupInstanceIamPolicy(ctx, &securesourcemanager.LookupInstanceIamPolicyArgs{
* Project: pulumi.StringRef(_default.Project),
* Location: pulumi.StringRef(_default.Location),
* InstanceId: _default.InstanceId,
* }, 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.securesourcemanager.SecuresourcemanagerFunctions;
* import com.pulumi.gcp.securesourcemanager.inputs.GetInstanceIamPolicyArgs;
* 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 = SecuresourcemanagerFunctions.getInstanceIamPolicy(GetInstanceIamPolicyArgs.builder()
* .project(default_.project())
* .location(default_.location())
* .instanceId(default_.instanceId())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:securesourcemanager:getInstanceIamPolicy
* Arguments:
* project: ${default.project}
* location: ${default.location}
* instanceId: ${default.instanceId}
* ```
*
* @param argument A collection of arguments for invoking getInstanceIamPolicy.
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(argument: GetInstanceIamPolicyPlainArgs): GetInstanceIamPolicyResult = toKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
/**
* @see [getInstanceIamPolicy].
* @param instanceId The name for the Instance.
* Used to find the parent resource to bind the IAM policy to
* @param location The location for the Instance.
* 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 getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(
instanceId: String,
location: String? = null,
project: String? = null,
): GetInstanceIamPolicyResult {
val argument = GetInstanceIamPolicyPlainArgs(
instanceId = instanceId,
location = location,
project = project,
)
return toKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getInstanceIamPolicy].
* @param argument Builder for [com.pulumi.gcp.securesourcemanager.kotlin.inputs.GetInstanceIamPolicyPlainArgs].
* @return A collection of values returned by getInstanceIamPolicy.
*/
public suspend fun getInstanceIamPolicy(argument: suspend GetInstanceIamPolicyPlainArgsBuilder.() -> Unit): GetInstanceIamPolicyResult {
val builder = GetInstanceIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getInstanceIamPolicyPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy