oci.Identity.TagDefault
Explore with Pulumi AI
This resource provides the Tag Default resource in Oracle Cloud Infrastructure Identity service.
Creates a new tag default in the specified compartment for the specified tag definition.
If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to “true”, the value is set during resource creation. - If the
isRequired
flag is set to “false”, the value you enter is set during resource creation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testTagDefault = new oci.identity.TagDefault("test_tag_default", {
compartmentId: compartmentId,
tagDefinitionId: testTagDefinition.id,
value: tagDefaultValue,
isRequired: tagDefaultIsRequired,
});
import pulumi
import pulumi_oci as oci
test_tag_default = oci.identity.TagDefault("test_tag_default",
compartment_id=compartment_id,
tag_definition_id=test_tag_definition["id"],
value=tag_default_value,
is_required=tag_default_is_required)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Identity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Identity.NewTagDefault(ctx, "test_tag_default", &Identity.TagDefaultArgs{
CompartmentId: pulumi.Any(compartmentId),
TagDefinitionId: pulumi.Any(testTagDefinition.Id),
Value: pulumi.Any(tagDefaultValue),
IsRequired: pulumi.Any(tagDefaultIsRequired),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testTagDefault = new Oci.Identity.TagDefault("test_tag_default", new()
{
CompartmentId = compartmentId,
TagDefinitionId = testTagDefinition.Id,
Value = tagDefaultValue,
IsRequired = tagDefaultIsRequired,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.TagDefault;
import com.pulumi.oci.Identity.TagDefaultArgs;
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) {
var testTagDefault = new TagDefault("testTagDefault", TagDefaultArgs.builder()
.compartmentId(compartmentId)
.tagDefinitionId(testTagDefinition.id())
.value(tagDefaultValue)
.isRequired(tagDefaultIsRequired)
.build());
}
}
resources:
testTagDefault:
type: oci:Identity:TagDefault
name: test_tag_default
properties:
compartmentId: ${compartmentId}
tagDefinitionId: ${testTagDefinition.id}
value: ${tagDefaultValue}
isRequired: ${tagDefaultIsRequired}
Create TagDefault Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TagDefault(name: string, args: TagDefaultArgs, opts?: CustomResourceOptions);
@overload
def TagDefault(resource_name: str,
args: TagDefaultArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TagDefault(resource_name: str,
opts: Optional[ResourceOptions] = None,
compartment_id: Optional[str] = None,
tag_definition_id: Optional[str] = None,
value: Optional[str] = None,
is_required: Optional[bool] = None)
func NewTagDefault(ctx *Context, name string, args TagDefaultArgs, opts ...ResourceOption) (*TagDefault, error)
public TagDefault(string name, TagDefaultArgs args, CustomResourceOptions? opts = null)
public TagDefault(String name, TagDefaultArgs args)
public TagDefault(String name, TagDefaultArgs args, CustomResourceOptions options)
type: oci:Identity:TagDefault
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TagDefaultArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TagDefaultArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TagDefaultArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TagDefaultArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TagDefaultArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var tagDefaultResource = new Oci.Identity.TagDefault("tagDefaultResource", new()
{
CompartmentId = "string",
TagDefinitionId = "string",
Value = "string",
IsRequired = false,
});
example, err := Identity.NewTagDefault(ctx, "tagDefaultResource", &Identity.TagDefaultArgs{
CompartmentId: pulumi.String("string"),
TagDefinitionId: pulumi.String("string"),
Value: pulumi.String("string"),
IsRequired: pulumi.Bool(false),
})
var tagDefaultResource = new TagDefault("tagDefaultResource", TagDefaultArgs.builder()
.compartmentId("string")
.tagDefinitionId("string")
.value("string")
.isRequired(false)
.build());
tag_default_resource = oci.identity.TagDefault("tagDefaultResource",
compartment_id="string",
tag_definition_id="string",
value="string",
is_required=False)
const tagDefaultResource = new oci.identity.TagDefault("tagDefaultResource", {
compartmentId: "string",
tagDefinitionId: "string",
value: "string",
isRequired: false,
});
type: oci:Identity:TagDefault
properties:
compartmentId: string
isRequired: false
tagDefinitionId: string
value: string
TagDefault Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The TagDefault resource accepts the following input properties:
- Compartment
Id string - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- Tag
Definition stringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- Value string
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- Is
Required bool (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- Compartment
Id string - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- Tag
Definition stringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- Value string
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- Is
Required bool (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- compartment
Id String - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- tag
Definition StringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- value String
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- is
Required Boolean (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- compartment
Id string - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- tag
Definition stringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- value string
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- is
Required boolean (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- compartment_
id str - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- tag_
definition_ strid - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- value str
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- is_
required bool (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- compartment
Id String - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- tag
Definition StringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- value String
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- is
Required Boolean (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
Outputs
All input properties are implicitly available as output properties. Additionally, the TagDefault resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- State string
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - Tag
Definition stringName - The name used in the tag definition. This field is informational in the context of the tag default.
- Tag
Namespace stringId - The OCID of the tag namespace that contains the tag definition.
- Time
Created string - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- Id string
- The provider-assigned unique ID for this managed resource.
- State string
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - Tag
Definition stringName - The name used in the tag definition. This field is informational in the context of the tag default.
- Tag
Namespace stringId - The OCID of the tag namespace that contains the tag definition.
- Time
Created string - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- id String
- The provider-assigned unique ID for this managed resource.
- state String
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - tag
Definition StringName - The name used in the tag definition. This field is informational in the context of the tag default.
- tag
Namespace StringId - The OCID of the tag namespace that contains the tag definition.
- time
Created String - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- id string
- The provider-assigned unique ID for this managed resource.
- state string
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - tag
Definition stringName - The name used in the tag definition. This field is informational in the context of the tag default.
- tag
Namespace stringId - The OCID of the tag namespace that contains the tag definition.
- time
Created string - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- id str
- The provider-assigned unique ID for this managed resource.
- state str
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - tag_
definition_ strname - The name used in the tag definition. This field is informational in the context of the tag default.
- tag_
namespace_ strid - The OCID of the tag namespace that contains the tag definition.
- time_
created str - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- id String
- The provider-assigned unique ID for this managed resource.
- state String
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - tag
Definition StringName - The name used in the tag definition. This field is informational in the context of the tag default.
- tag
Namespace StringId - The OCID of the tag namespace that contains the tag definition.
- time
Created String - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
Look up Existing TagDefault Resource
Get an existing TagDefault resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TagDefaultState, opts?: CustomResourceOptions): TagDefault
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compartment_id: Optional[str] = None,
is_required: Optional[bool] = None,
state: Optional[str] = None,
tag_definition_id: Optional[str] = None,
tag_definition_name: Optional[str] = None,
tag_namespace_id: Optional[str] = None,
time_created: Optional[str] = None,
value: Optional[str] = None) -> TagDefault
func GetTagDefault(ctx *Context, name string, id IDInput, state *TagDefaultState, opts ...ResourceOption) (*TagDefault, error)
public static TagDefault Get(string name, Input<string> id, TagDefaultState? state, CustomResourceOptions? opts = null)
public static TagDefault get(String name, Output<String> id, TagDefaultState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Compartment
Id string - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- Is
Required bool (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- State string
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - Tag
Definition stringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- Tag
Definition stringName - The name used in the tag definition. This field is informational in the context of the tag default.
- Tag
Namespace stringId - The OCID of the tag namespace that contains the tag definition.
- Time
Created string - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- Value string
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- Compartment
Id string - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- Is
Required bool (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- State string
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - Tag
Definition stringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- Tag
Definition stringName - The name used in the tag definition. This field is informational in the context of the tag default.
- Tag
Namespace stringId - The OCID of the tag namespace that contains the tag definition.
- Time
Created string - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- Value string
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- compartment
Id String - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- is
Required Boolean (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- state String
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - tag
Definition StringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- tag
Definition StringName - The name used in the tag definition. This field is informational in the context of the tag default.
- tag
Namespace StringId - The OCID of the tag namespace that contains the tag definition.
- time
Created String - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- value String
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- compartment
Id string - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- is
Required boolean (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- state string
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - tag
Definition stringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- tag
Definition stringName - The name used in the tag definition. This field is informational in the context of the tag default.
- tag
Namespace stringId - The OCID of the tag namespace that contains the tag definition.
- time
Created string - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- value string
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- compartment_
id str - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- is_
required bool (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- state str
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - tag_
definition_ strid - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- tag_
definition_ strname - The name used in the tag definition. This field is informational in the context of the tag default.
- tag_
namespace_ strid - The OCID of the tag namespace that contains the tag definition.
- time_
created str - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- value str
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
- compartment
Id String - The OCID of the compartment. The tag default will be applied to all new resources created in this compartment.
- is
Required Boolean (Updatable) If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.
- If the
isRequired
flag is set to "true", the value is set during resource creation. - If the
isRequired
flag is set to "false", the value you enter is set during resource creation.
Example:
false
- If the
- state String
- The tag default's current state. After creating a
TagDefault
, make sure itslifecycleState
is ACTIVE before using it. - tag
Definition StringId - The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
- tag
Definition StringName - The name used in the tag definition. This field is informational in the context of the tag default.
- tag
Namespace StringId - The OCID of the tag namespace that contains the tag definition.
- time
Created String - Date and time the
TagDefault
object was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
- value String
(Updatable) The default value for the tag definition. This will be applied to all new resources created in the compartment.
** 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
Import
TagDefaults can be imported using the id
, e.g.
$ pulumi import oci:Identity/tagDefault:TagDefault test_tag_default "id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.