com.pulumi.gcp.gkehub.kotlin.GkehubFunctions.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.gkehub.kotlin
import com.pulumi.gcp.gkehub.GkehubFunctions.getFeatureIamPolicyPlain
import com.pulumi.gcp.gkehub.GkehubFunctions.getMembershipIamPolicyPlain
import com.pulumi.gcp.gkehub.GkehubFunctions.getScopeIamPolicyPlain
import com.pulumi.gcp.gkehub.kotlin.inputs.GetFeatureIamPolicyPlainArgs
import com.pulumi.gcp.gkehub.kotlin.inputs.GetFeatureIamPolicyPlainArgsBuilder
import com.pulumi.gcp.gkehub.kotlin.inputs.GetMembershipIamPolicyPlainArgs
import com.pulumi.gcp.gkehub.kotlin.inputs.GetMembershipIamPolicyPlainArgsBuilder
import com.pulumi.gcp.gkehub.kotlin.inputs.GetScopeIamPolicyPlainArgs
import com.pulumi.gcp.gkehub.kotlin.inputs.GetScopeIamPolicyPlainArgsBuilder
import com.pulumi.gcp.gkehub.kotlin.outputs.GetFeatureIamPolicyResult
import com.pulumi.gcp.gkehub.kotlin.outputs.GetMembershipIamPolicyResult
import com.pulumi.gcp.gkehub.kotlin.outputs.GetScopeIamPolicyResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.gkehub.kotlin.outputs.GetFeatureIamPolicyResult.Companion.toKotlin as getFeatureIamPolicyResultToKotlin
import com.pulumi.gcp.gkehub.kotlin.outputs.GetMembershipIamPolicyResult.Companion.toKotlin as getMembershipIamPolicyResultToKotlin
import com.pulumi.gcp.gkehub.kotlin.outputs.GetScopeIamPolicyResult.Companion.toKotlin as getScopeIamPolicyResultToKotlin
public object GkehubFunctions {
/**
* Retrieves the current IAM policy data for feature
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.gkehub.getFeatureIamPolicy({
* project: feature.project,
* location: feature.location,
* name: feature.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.gkehub.get_feature_iam_policy(project=feature["project"],
* location=feature["location"],
* name=feature["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.GkeHub.GetFeatureIamPolicy.Invoke(new()
* {
* Project = feature.Project,
* Location = feature.Location,
* Name = feature.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := gkehub.LookupFeatureIamPolicy(ctx, &gkehub.LookupFeatureIamPolicyArgs{
* Project: pulumi.StringRef(feature.Project),
* Location: pulumi.StringRef(feature.Location),
* Name: feature.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.gkehub.GkehubFunctions;
* import com.pulumi.gcp.gkehub.inputs.GetFeatureIamPolicyArgs;
* 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 = GkehubFunctions.getFeatureIamPolicy(GetFeatureIamPolicyArgs.builder()
* .project(feature.project())
* .location(feature.location())
* .name(feature.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:gkehub:getFeatureIamPolicy
* Arguments:
* project: ${feature.project}
* location: ${feature.location}
* name: ${feature.name}
* ```
*
* @param argument A collection of arguments for invoking getFeatureIamPolicy.
* @return A collection of values returned by getFeatureIamPolicy.
*/
public suspend fun getFeatureIamPolicy(argument: GetFeatureIamPolicyPlainArgs): GetFeatureIamPolicyResult =
getFeatureIamPolicyResultToKotlin(getFeatureIamPolicyPlain(argument.toJava()).await())
/**
* @see [getFeatureIamPolicy].
* @param location The location for the resource Used to find the parent resource to bind the IAM policy to
* @param name 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 getFeatureIamPolicy.
*/
public suspend fun getFeatureIamPolicy(
location: String? = null,
name: String,
project: String? = null,
): GetFeatureIamPolicyResult {
val argument = GetFeatureIamPolicyPlainArgs(
location = location,
name = name,
project = project,
)
return getFeatureIamPolicyResultToKotlin(getFeatureIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getFeatureIamPolicy].
* @param argument Builder for [com.pulumi.gcp.gkehub.kotlin.inputs.GetFeatureIamPolicyPlainArgs].
* @return A collection of values returned by getFeatureIamPolicy.
*/
public suspend fun getFeatureIamPolicy(argument: suspend GetFeatureIamPolicyPlainArgsBuilder.() -> Unit): GetFeatureIamPolicyResult {
val builder = GetFeatureIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getFeatureIamPolicyResultToKotlin(getFeatureIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for membership
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.gkehub.getMembershipIamPolicy({
* project: membership.project,
* location: membership.location,
* membershipId: membership.membershipId,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.gkehub.get_membership_iam_policy(project=membership["project"],
* location=membership["location"],
* membership_id=membership["membershipId"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.GkeHub.GetMembershipIamPolicy.Invoke(new()
* {
* Project = membership.Project,
* Location = membership.Location,
* MembershipId = membership.MembershipId,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := gkehub.LookupMembershipIamPolicy(ctx, &gkehub.LookupMembershipIamPolicyArgs{
* Project: pulumi.StringRef(membership.Project),
* Location: pulumi.StringRef(membership.Location),
* MembershipId: membership.MembershipId,
* }, 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.gkehub.GkehubFunctions;
* import com.pulumi.gcp.gkehub.inputs.GetMembershipIamPolicyArgs;
* 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 = GkehubFunctions.getMembershipIamPolicy(GetMembershipIamPolicyArgs.builder()
* .project(membership.project())
* .location(membership.location())
* .membershipId(membership.membershipId())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:gkehub:getMembershipIamPolicy
* Arguments:
* project: ${membership.project}
* location: ${membership.location}
* membershipId: ${membership.membershipId}
* ```
*
* @param argument A collection of arguments for invoking getMembershipIamPolicy.
* @return A collection of values returned by getMembershipIamPolicy.
*/
public suspend fun getMembershipIamPolicy(argument: GetMembershipIamPolicyPlainArgs): GetMembershipIamPolicyResult =
getMembershipIamPolicyResultToKotlin(getMembershipIamPolicyPlain(argument.toJava()).await())
/**
* @see [getMembershipIamPolicy].
* @param location Location of the membership.
* The default value is `global`.
* Used to find the parent resource to bind the IAM policy to
* @param membershipId
* @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 getMembershipIamPolicy.
*/
public suspend fun getMembershipIamPolicy(
location: String? = null,
membershipId: String,
project: String? = null,
): GetMembershipIamPolicyResult {
val argument = GetMembershipIamPolicyPlainArgs(
location = location,
membershipId = membershipId,
project = project,
)
return getMembershipIamPolicyResultToKotlin(getMembershipIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getMembershipIamPolicy].
* @param argument Builder for [com.pulumi.gcp.gkehub.kotlin.inputs.GetMembershipIamPolicyPlainArgs].
* @return A collection of values returned by getMembershipIamPolicy.
*/
public suspend fun getMembershipIamPolicy(argument: suspend GetMembershipIamPolicyPlainArgsBuilder.() -> Unit): GetMembershipIamPolicyResult {
val builder = GetMembershipIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getMembershipIamPolicyResultToKotlin(getMembershipIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for scope
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.gkehub.getScopeIamPolicy({
* project: scope.project,
* scopeId: scope.scopeId,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.gkehub.get_scope_iam_policy(project=scope["project"],
* scope_id=scope["scopeId"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.GkeHub.GetScopeIamPolicy.Invoke(new()
* {
* Project = scope.Project,
* ScopeId = scope.ScopeId,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := gkehub.LookupScopeIamPolicy(ctx, &gkehub.LookupScopeIamPolicyArgs{
* Project: pulumi.StringRef(scope.Project),
* ScopeId: scope.ScopeId,
* }, 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.gkehub.GkehubFunctions;
* import com.pulumi.gcp.gkehub.inputs.GetScopeIamPolicyArgs;
* 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 = GkehubFunctions.getScopeIamPolicy(GetScopeIamPolicyArgs.builder()
* .project(scope.project())
* .scopeId(scope.scopeId())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:gkehub:getScopeIamPolicy
* Arguments:
* project: ${scope.project}
* scopeId: ${scope.scopeId}
* ```
*
* @param argument A collection of arguments for invoking getScopeIamPolicy.
* @return A collection of values returned by getScopeIamPolicy.
*/
public suspend fun getScopeIamPolicy(argument: GetScopeIamPolicyPlainArgs): GetScopeIamPolicyResult =
getScopeIamPolicyResultToKotlin(getScopeIamPolicyPlain(argument.toJava()).await())
/**
* @see [getScopeIamPolicy].
* @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.
* @param scopeId
* @return A collection of values returned by getScopeIamPolicy.
*/
public suspend fun getScopeIamPolicy(project: String? = null, scopeId: String): GetScopeIamPolicyResult {
val argument = GetScopeIamPolicyPlainArgs(
project = project,
scopeId = scopeId,
)
return getScopeIamPolicyResultToKotlin(getScopeIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getScopeIamPolicy].
* @param argument Builder for [com.pulumi.gcp.gkehub.kotlin.inputs.GetScopeIamPolicyPlainArgs].
* @return A collection of values returned by getScopeIamPolicy.
*/
public suspend fun getScopeIamPolicy(argument: suspend GetScopeIamPolicyPlainArgsBuilder.() -> Unit): GetScopeIamPolicyResult {
val builder = GetScopeIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getScopeIamPolicyResultToKotlin(getScopeIamPolicyPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy