Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.tags.getTagKeyIamPolicy
Explore with Pulumi AI
Retrieves the current IAM policy data for tagkey
example
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const policy = gcp.tags.getTagKeyIamPolicy({
    tagKey: key.name,
});
import pulumi
import pulumi_gcp as gcp
policy = gcp.tags.get_tag_key_iam_policy(tag_key=key["name"])
package main
import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/tags"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tags.LookupTagKeyIamPolicy(ctx, &tags.LookupTagKeyIamPolicyArgs{
			TagKey: key.Name,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() => 
{
    var policy = Gcp.Tags.GetTagKeyIamPolicy.Invoke(new()
    {
        TagKey = key.Name,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.tags.TagsFunctions;
import com.pulumi.gcp.tags.inputs.GetTagKeyIamPolicyArgs;
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 = TagsFunctions.getTagKeyIamPolicy(GetTagKeyIamPolicyArgs.builder()
            .tagKey(key.name())
            .build());
    }
}
variables:
  policy:
    fn::invoke:
      Function: gcp:tags:getTagKeyIamPolicy
      Arguments:
        tagKey: ${key.name}
Using getTagKeyIamPolicy
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getTagKeyIamPolicy(args: GetTagKeyIamPolicyArgs, opts?: InvokeOptions): Promise<GetTagKeyIamPolicyResult>
function getTagKeyIamPolicyOutput(args: GetTagKeyIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetTagKeyIamPolicyResult>def get_tag_key_iam_policy(tag_key: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetTagKeyIamPolicyResult
def get_tag_key_iam_policy_output(tag_key: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetTagKeyIamPolicyResult]func LookupTagKeyIamPolicy(ctx *Context, args *LookupTagKeyIamPolicyArgs, opts ...InvokeOption) (*LookupTagKeyIamPolicyResult, error)
func LookupTagKeyIamPolicyOutput(ctx *Context, args *LookupTagKeyIamPolicyOutputArgs, opts ...InvokeOption) LookupTagKeyIamPolicyResultOutput> Note: This function is named LookupTagKeyIamPolicy in the Go SDK.
public static class GetTagKeyIamPolicy 
{
    public static Task<GetTagKeyIamPolicyResult> InvokeAsync(GetTagKeyIamPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetTagKeyIamPolicyResult> Invoke(GetTagKeyIamPolicyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetTagKeyIamPolicyResult> getTagKeyIamPolicy(GetTagKeyIamPolicyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: gcp:tags/getTagKeyIamPolicy:getTagKeyIamPolicy
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Tag
Key string - Used to find the parent resource to bind the IAM policy to
 
- Tag
Key string - Used to find the parent resource to bind the IAM policy to
 
- tag
Key String - Used to find the parent resource to bind the IAM policy to
 
- tag
Key string - Used to find the parent resource to bind the IAM policy to
 
- tag_
key str - Used to find the parent resource to bind the IAM policy to
 
- tag
Key String - Used to find the parent resource to bind the IAM policy to
 
getTagKeyIamPolicy Result
The following output properties are available:
- Etag string
 - (Computed) The etag of the IAM policy.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Policy
Data string - (Required only by 
gcp.tags.TagKeyIamPolicy) The policy data generated by agcp.organizations.getIAMPolicydata source. - Tag
Key string 
- Etag string
 - (Computed) The etag of the IAM policy.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Policy
Data string - (Required only by 
gcp.tags.TagKeyIamPolicy) The policy data generated by agcp.organizations.getIAMPolicydata source. - Tag
Key string 
- etag String
 - (Computed) The etag of the IAM policy.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - policy
Data String - (Required only by 
gcp.tags.TagKeyIamPolicy) The policy data generated by agcp.organizations.getIAMPolicydata source. - tag
Key String 
- etag string
 - (Computed) The etag of the IAM policy.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - policy
Data string - (Required only by 
gcp.tags.TagKeyIamPolicy) The policy data generated by agcp.organizations.getIAMPolicydata source. - tag
Key string 
- etag str
 - (Computed) The etag of the IAM policy.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - policy_
data str - (Required only by 
gcp.tags.TagKeyIamPolicy) The policy data generated by agcp.organizations.getIAMPolicydata source. - tag_
key str 
- etag String
 - (Computed) The etag of the IAM policy.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - policy
Data String - (Required only by 
gcp.tags.TagKeyIamPolicy) The policy data generated by agcp.organizations.getIAMPolicydata source. - tag
Key String 
Package Details
- Repository
 - Google Cloud (GCP) Classic pulumi/pulumi-gcp
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
google-betaTerraform Provider.