1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. tags
  5. getTagKeyIamPolicy
Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi

gcp.tags.getTagKeyIamPolicy

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi

    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/v7/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 dictionary

    The following arguments are supported:

    TagKey string
    Used to find the parent resource to bind the IAM policy to
    TagKey string
    Used to find the parent resource to bind the IAM policy to
    tagKey String
    Used to find the parent resource to bind the IAM policy to
    tagKey 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
    tagKey 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.
    PolicyData string
    (Required only by gcp.tags.TagKeyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    TagKey string
    Etag string
    (Computed) The etag of the IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    PolicyData string
    (Required only by gcp.tags.TagKeyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    TagKey string
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    policyData String
    (Required only by gcp.tags.TagKeyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    tagKey String
    etag string
    (Computed) The etag of the IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    policyData string
    (Required only by gcp.tags.TagKeyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    tagKey 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 a gcp.organizations.getIAMPolicy data source.
    tag_key str
    etag String
    (Computed) The etag of the IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    policyData String
    (Required only by gcp.tags.TagKeyIamPolicy) The policy data generated by a gcp.organizations.getIAMPolicy data source.
    tagKey String

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi