Tagging an Object Storage Bucket at Creation
Add metadata to an Object Storage bucket when you first create it. This metadata enables you to define keys and values and associate them with resources.
For more information, see Overview of Tagging.
Use the
--defined-tags
or--freeform-tags
options when running the oci os bucket create command to tag a bucket at the time of its creation:oci os bucket create --compartment-id compartment_ocid --defined-tags JSON_formatted_defined_tag --freeform-tags JSON_formatted_free-form_tag [OPTIONS]
Provide key-value pair input for
--defined-tags
and--freeform-tags
as valid formatted JSON. See Passing Complex Input and Using a JSON File for Complex Input for information about JSON formatting.For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the CreateBucket operation to create a bucket. Include the
definedTags
andfreeformTags
attributes and their values.When accessing the Object Storage API, the bucket name is used with the Object Storage namespace name to form the request URL:
n/object_storage_namespace/b/bucket