import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * This resource provides the Tag resource in Oracle Cloud Infrastructure Identity service. * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/identity/latest/Tag * * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/identity * * Creates a new tag in the specified tag namespace. * * The tag requires either the OCID or the name of the tag namespace that will contain this * tag definition. * * You must specify a *name* for the tag, which must be unique across all tags in the tag namespace * and cannot be changed. The name can contain any ASCII character except the space (_) or period (.) characters. * Names are case insensitive. That means, for example, "myTag" and "mytag" are not allowed in the same namespace. * If you specify a name that's already in use in the tag namespace, a 409 error is returned. * * The tag must have a *description*. It does not have to be unique, and you can change it with * [UpdateTag](https://docs.cloud.oracle.com/iaas/api/#/en/identity/latest/Tag/UpdateTag). * * The tag must have a value type, which is specified with a validator. Tags can use either a * static value or a list of possible values. Static values are entered by a user applying the tag * to a resource. Lists are created by you and the user must apply a value from the list. Lists * are validiated. * * * If no `validator` is set, the user applying the tag to a resource can type in a static * value or leave the tag value empty. * * If a `validator` is set, the user applying the tag to a resource must select from a list * of values that you supply with [EnumTagDefinitionValidator](https://docs.cloud.oracle.com/iaas/api/#/en/identity/latest/datatypes/EnumTagDefinitionValidator). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as oci from "@pulumi/oci"; * * const testTag = new oci.identity.Tag("test_tag", { * description: tagDescription, * name: tagName, * tagNamespaceId: testTagNamespace.id, * definedTags: { * "Operations.CostCenter": "42", * }, * freeformTags: { * Department: "Finance", * }, * isCostTracking: tagIsCostTracking === "true", * validator: { * validatorType: tagValidatorValidatorType, * values: tagValidatorValues, * }, * isRetired: false, * }); * ``` * * ## Import * * Tags can be imported using the `tagNamespaceId` and `tagName`, e.g. * * ```sh * $ pulumi import oci:Identity/tag:Tag test_tag "tagNamespaces/{tagNamespaceId}/tags/{tagName}" * ``` */ export declare class Tag extends pulumi.CustomResource { /** * Get an existing Tag resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: TagState, opts?: pulumi.CustomResourceOptions): Tag; /** * Returns true if the given object is an instance of Tag. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Tag; /** * (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` */ readonly definedTags: pulumi.Output<{ [key: string]: string; }>; /** * (Updatable) The description you assign to the tag during creation. */ readonly description: pulumi.Output; /** * (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` */ readonly freeformTags: pulumi.Output<{ [key: string]: string; }>; /** * (Updatable) Indicates whether the tag is enabled for cost tracking. */ readonly isCostTracking: pulumi.Output; /** * (Updatable) Indicates whether the tag is retired. See [Retiring Key Definitions and Namespace Definitions](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). * * ** IMPORTANT ** * Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values */ readonly isRetired: pulumi.Output; /** * The name you assign to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed. */ readonly name: pulumi.Output; /** * The tag's current state. After creating a tag, make sure its `lifecycleState` is ACTIVE before using it. After retiring a tag, make sure its `lifecycleState` is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's `lifecycleState` changes from DELETING to DELETED. */ readonly state: pulumi.Output; /** * The OCID of the tag namespace. */ readonly tagNamespaceId: pulumi.Output; /** * Date and time the tag was created, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` */ readonly timeCreated: pulumi.Output; /** * (Updatable) Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see [Limits on Tags](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/taggingoverview.htm#Limits). * * If you define a validator after a value has been set for a defined tag, then any updates that attempt to change the value must pass the additional validation defined by the current rule. Previously set values (even those that would fail the current validation) are not updated. You can still update other attributes to resources that contain a non-valid defined tag. * * To clear the validator call UpdateTag with [DefaultTagDefinitionValidator](https://docs.cloud.oracle.com/iaas/api/#/en/identity/latest/datatypes/DefaultTagDefinitionValidator). */ readonly validator: pulumi.Output; /** * Create a Tag resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: TagArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Tag resources. */ export interface TagState { /** * (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` */ definedTags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * (Updatable) The description you assign to the tag during creation. */ description?: pulumi.Input; /** * (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` */ freeformTags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * (Updatable) Indicates whether the tag is enabled for cost tracking. */ isCostTracking?: pulumi.Input; /** * (Updatable) Indicates whether the tag is retired. See [Retiring Key Definitions and Namespace Definitions](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). * * ** IMPORTANT ** * Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values */ isRetired?: pulumi.Input; /** * The name you assign to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed. */ name?: pulumi.Input; /** * The tag's current state. After creating a tag, make sure its `lifecycleState` is ACTIVE before using it. After retiring a tag, make sure its `lifecycleState` is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's `lifecycleState` changes from DELETING to DELETED. */ state?: pulumi.Input; /** * The OCID of the tag namespace. */ tagNamespaceId?: pulumi.Input; /** * Date and time the tag was created, in the format defined by RFC3339. Example: `2016-08-25T21:10:29.600Z` */ timeCreated?: pulumi.Input; /** * (Updatable) Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see [Limits on Tags](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/taggingoverview.htm#Limits). * * If you define a validator after a value has been set for a defined tag, then any updates that attempt to change the value must pass the additional validation defined by the current rule. Previously set values (even those that would fail the current validation) are not updated. You can still update other attributes to resources that contain a non-valid defined tag. * * To clear the validator call UpdateTag with [DefaultTagDefinitionValidator](https://docs.cloud.oracle.com/iaas/api/#/en/identity/latest/datatypes/DefaultTagDefinitionValidator). */ validator?: pulumi.Input; } /** * The set of arguments for constructing a Tag resource. */ export interface TagArgs { /** * (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` */ definedTags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * (Updatable) The description you assign to the tag during creation. */ description: pulumi.Input; /** * (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` */ freeformTags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * (Updatable) Indicates whether the tag is enabled for cost tracking. */ isCostTracking?: pulumi.Input; /** * (Updatable) Indicates whether the tag is retired. See [Retiring Key Definitions and Namespace Definitions](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/taggingoverview.htm#Retiring). * * ** IMPORTANT ** * Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values */ isRetired?: pulumi.Input; /** * The name you assign to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed. */ name?: pulumi.Input; /** * The OCID of the tag namespace. */ tagNamespaceId: pulumi.Input; /** * (Updatable) Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see [Limits on Tags](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/taggingoverview.htm#Limits). * * If you define a validator after a value has been set for a defined tag, then any updates that attempt to change the value must pass the additional validation defined by the current rule. Previously set values (even those that would fail the current validation) are not updated. You can still update other attributes to resources that contain a non-valid defined tag. * * To clear the validator call UpdateTag with [DefaultTagDefinitionValidator](https://docs.cloud.oracle.com/iaas/api/#/en/identity/latest/datatypes/DefaultTagDefinitionValidator). */ validator?: pulumi.Input; } //# sourceMappingURL=tag.d.ts.map