Google Cloud v8.14.0 published on Wednesday, Jan 15, 2025 by Pulumi
gcp.tags.getTagValues
Explore with Pulumi AI
Get tag values from a parent key.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const environmentTagValues = gcp.tags.getTagValues({
    parent: "tagKeys/56789",
});
import pulumi
import pulumi_gcp as gcp
environment_tag_values = gcp.tags.get_tag_values(parent="tagKeys/56789")
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.GetTagValues(ctx, &tags.GetTagValuesArgs{
			Parent: "tagKeys/56789",
		}, 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 environmentTagValues = Gcp.Tags.GetTagValues.Invoke(new()
    {
        Parent = "tagKeys/56789",
    });
});
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.GetTagValuesArgs;
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 environmentTagValues = TagsFunctions.getTagValues(GetTagValuesArgs.builder()
            .parent("tagKeys/56789")
            .build());
    }
}
variables:
  environmentTagValues:
    fn::invoke:
      function: gcp:tags:getTagValues
      arguments:
        parent: tagKeys/56789
Using getTagValues
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 getTagValues(args: GetTagValuesArgs, opts?: InvokeOptions): Promise<GetTagValuesResult>
function getTagValuesOutput(args: GetTagValuesOutputArgs, opts?: InvokeOptions): Output<GetTagValuesResult>def get_tag_values(parent: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetTagValuesResult
def get_tag_values_output(parent: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetTagValuesResult]func GetTagValues(ctx *Context, args *GetTagValuesArgs, opts ...InvokeOption) (*GetTagValuesResult, error)
func GetTagValuesOutput(ctx *Context, args *GetTagValuesOutputArgs, opts ...InvokeOption) GetTagValuesResultOutput> Note: This function is named GetTagValues in the Go SDK.
public static class GetTagValues 
{
    public static Task<GetTagValuesResult> InvokeAsync(GetTagValuesArgs args, InvokeOptions? opts = null)
    public static Output<GetTagValuesResult> Invoke(GetTagValuesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetTagValuesResult> getTagValues(GetTagValuesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: gcp:tags/getTagValues:getTagValues
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Parent string
 - The resource name of the parent tagKey in format 
tagKey/{name}. 
- Parent string
 - The resource name of the parent tagKey in format 
tagKey/{name}. 
- parent String
 - The resource name of the parent tagKey in format 
tagKey/{name}. 
- parent string
 - The resource name of the parent tagKey in format 
tagKey/{name}. 
- parent str
 - The resource name of the parent tagKey in format 
tagKey/{name}. 
- parent String
 - The resource name of the parent tagKey in format 
tagKey/{name}. 
getTagValues Result
The following output properties are available:
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Parent string
 - The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id}.
 - Values
List<Get
Tag Values Value>  
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Parent string
 - The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id}.
 - Values
[]Get
Tag Values Value  
- id String
 - The provider-assigned unique ID for this managed resource.
 - parent String
 - The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id}.
 - values
List<Get
Tag Values Value>  
- id string
 - The provider-assigned unique ID for this managed resource.
 - parent string
 - The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id}.
 - values
Get
Tag Values Value[]  
- id str
 - The provider-assigned unique ID for this managed resource.
 - parent str
 - The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id}.
 - values
Sequence[Get
Tag Values Value]  
- id String
 - The provider-assigned unique ID for this managed resource.
 - parent String
 - The resource name of the new TagValue's parent TagKey. Must be of the form tagKeys/{tag_key_id}.
 - values List<Property Map>
 
Supporting Types
GetTagValuesValue   
- Create
Time string - Creation time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 - Description string
 - User-assigned description of the TagValue.
 - Name string
 - an identifier for the resource with format 
tagValues/{{name}} - Namespaced
Name string - Namespaced name of the TagValue.
 - Parent string
 - The resource name of the parent tagKey in format 
tagKey/{name}. - Short
Name string - User-assigned short name for TagValue. The short name should be unique for TagValues within the same parent TagKey.
 - Update
Time string - Update time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 
- Create
Time string - Creation time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 - Description string
 - User-assigned description of the TagValue.
 - Name string
 - an identifier for the resource with format 
tagValues/{{name}} - Namespaced
Name string - Namespaced name of the TagValue.
 - Parent string
 - The resource name of the parent tagKey in format 
tagKey/{name}. - Short
Name string - User-assigned short name for TagValue. The short name should be unique for TagValues within the same parent TagKey.
 - Update
Time string - Update time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 
- create
Time String - Creation time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 - description String
 - User-assigned description of the TagValue.
 - name String
 - an identifier for the resource with format 
tagValues/{{name}} - namespaced
Name String - Namespaced name of the TagValue.
 - parent String
 - The resource name of the parent tagKey in format 
tagKey/{name}. - short
Name String - User-assigned short name for TagValue. The short name should be unique for TagValues within the same parent TagKey.
 - update
Time String - Update time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 
- create
Time string - Creation time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 - description string
 - User-assigned description of the TagValue.
 - name string
 - an identifier for the resource with format 
tagValues/{{name}} - namespaced
Name string - Namespaced name of the TagValue.
 - parent string
 - The resource name of the parent tagKey in format 
tagKey/{name}. - short
Name string - User-assigned short name for TagValue. The short name should be unique for TagValues within the same parent TagKey.
 - update
Time string - Update time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 
- create_
time str - Creation time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 - description str
 - User-assigned description of the TagValue.
 - name str
 - an identifier for the resource with format 
tagValues/{{name}} - namespaced_
name str - Namespaced name of the TagValue.
 - parent str
 - The resource name of the parent tagKey in format 
tagKey/{name}. - short_
name str - User-assigned short name for TagValue. The short name should be unique for TagValues within the same parent TagKey.
 - update_
time str - Update time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 
- create
Time String - Creation time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 - description String
 - User-assigned description of the TagValue.
 - name String
 - an identifier for the resource with format 
tagValues/{{name}} - namespaced
Name String - Namespaced name of the TagValue.
 - parent String
 - The resource name of the parent tagKey in format 
tagKey/{name}. - short
Name String - User-assigned short name for TagValue. The short name should be unique for TagValues within the same parent TagKey.
 - update
Time String - Update time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
 
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.