TagKey class
A TagKey, used to group a set of TagValues.
To get more information about TagKey, see:
- API documentation
- How-to Guides
- Official Documentation
Example Usage
Tag Key Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const key = new gcp.tags.TagKey("key", {
parent: "organizations/123456789",
shortName: "keyname",
description: "For keyname resources.",
});
import pulumi
import pulumi_gcp as gcp
key = gcp.tags.TagKey("key",
parent="organizations/123456789",
short_name="keyname",
description="For keyname resources.")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var key = new Gcp.Tags.TagKey("key", new()
{
Parent = "organizations/123456789",
ShortName = "keyname",
Description = "For keyname resources.",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/tags"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tags.NewTagKey(ctx, "key", &tags.TagKeyArgs{
Parent: pulumi.String("organizations/123456789"),
ShortName: pulumi.String("keyname"),
Description: pulumi.String("For keyname resources."),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_tags_tagkey" "key" {
parent = "organizations/123456789"
short_name = "keyname"
description = "For keyname resources."
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.tags.TagKey;
import com.pulumi.gcp.tags.TagKeyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
var key = new TagKey("key", TagKeyArgs.builder()
.parent("organizations/123456789")
.shortName("keyname")
.description("For keyname resources.")
.build());
}
}
resources:
key:
type: gcp:tags:TagKey
properties:
parent: organizations/123456789
shortName: keyname
description: For keyname resources.
Import
TagKey can be imported using any of these accepted formats:
tagKeys/{{name}}{{name}}
When using the pulumi import command, TagKey can be imported using one of the formats above. For example:
$ pulumi import gcp:tags/tagKey:TagKey default tagKeys/{{name}}
$ pulumi import gcp:tags/tagKey:TagKey default {{name}}
Constructors
- TagKey(String name, {TagKeyArgs? args, CustomResourceOptions? options})
-
Creates a new TagKey.
nameThe Pulumi resource name.argsArguments used to configure this TagKey. The set of arguments for TagKey.optionsResource options controlling this resource's behavior. - TagKey.reference(String urn)
- Creates a typed reference to an existing TagKey resource.
Properties
-
allowedValuesRegex
↔ Output<
String?> -
Regular expression constraint for dynamic tag values, follows RE2 syntax. If present, it implicitly allows dynamic values (constrained by the regex).
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createTime
↔ Output<
String> -
Output only. 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".
latefinal
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
-
description
↔ Output<
String?> -
User-assigned description of the TagKey. Must not exceed 256 characters.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
name
↔ Output<
String> -
The generated numeric id for the TagKey.
latefinal
-
namespacedName
↔ Output<
String> -
Output only. Namespaced name of the TagKey.
latefinal
-
parent
↔ Output<
String> -
Input only. The resource name of the new TagKey's parent. Must be of the form organizations/{org_id} or projects/{project_id_or_number}.
latefinal
-
purpose
↔ Output<
String?> -
Optional. A purpose cannot be changed once set.
A purpose denotes that this Tag is intended for use in policies of a specific policy engine, and will involve that policy engine in management operations involving this Tag.
Possible values are:
GCE_FIREWALL,DATA_GOVERNANCE.latefinal -
purposeData
↔ Output<
Map< String, String> ?> -
Optional. Purpose data cannot be changed once set.
Purpose data corresponds to the policy system that the tag is intended for. For example, the GCE_FIREWALL purpose expects data in the following format:
network = "<project-name>/<vpc-name>".latefinal -
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shortName
↔ Output<
String> -
Input only. The user friendly name for a TagKey. The short name should be unique for TagKeys within the same tag namespace.
The short name can have a maximum length of 256 characters. The permitted character set for the shortName includes all UTF-8 encoded Unicode characters except single quotes ('), double quotes ("), backslashes (\), and forward slashes (/).
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
updateTime
↔ Output<
String> -
Output only. 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".
latefinal
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited