Skip to content

ECI-1126 [OCI] - Support Tag Defaults in OCI Quickstart#96

Open
EamonBrady1 wants to merge 3 commits intomasterfrom
EamonBrady1/ECI-1126-Support-Mandatory-Tags-in-OCI-Quickstart
Open

ECI-1126 [OCI] - Support Tag Defaults in OCI Quickstart#96
EamonBrady1 wants to merge 3 commits intomasterfrom
EamonBrady1/ECI-1126-Support-Mandatory-Tags-in-OCI-Quickstart

Conversation

@EamonBrady1
Copy link
Contributor

@EamonBrady1 EamonBrady1 commented Feb 27, 2026

What

  • Adds support for tag defaults in OCI Quickstart
  • Adds new policy enabling Datadog to use defined tags, which is a requirement for creating connector hubs in compartments with default tag requirements
  • Collects the default tags for the compartment, then provides these tags when creating each resource so they are included.
  • Updates subnet creation as a necessity of supporting defined tags
  • For some of the regional stack creation code, the defined tags had to be passed as json, which is the reason for some of the more expanded parsing/formatting rules in this PR
  • Had to add defined tags to the deletion job as well, since we "create" a deletion job in the compartment

Why

Customers can have tag defaults (see link below) requiring resources created in a compartment to have certain defined tags. This update automatically detects and applies those tags when necessary in the user's compartment.

The policy allowing Datadog to use defined tags is not conditional on whether or not the compartment has defined tags in order to remain future compatible, if the user eventually adds these, so that it will not break their integration.

Testing

  • Verified that quickstart works in scenarios requiring these tags, and also in scenarios that do not require them.
  • Also verified necessity of adding single permissions policy - ability to use defined tags in the compartment.
  • Additionally, modified some of the subnet code, so verified that subnets still generate and work as expects, even when the user provides their own subnets.
  • Code works across regions as well

https://www.ateam-oracle.com/oracle-cloud-infrastructure-tagging-best-practices-enable-mandatory-tagging-for-compartments

@EamonBrady1 EamonBrady1 marked this pull request as ready for review February 27, 2026 20:25
Co-authored-by: Ben Gillman <165046932+bengillmandd@users.noreply.github.com>
Comment on lines +10 to +11
for td in data.oci_identity_tag_defaults.compartment.tag_defaults :
"${local.tag_defaults_namespace_names[td.tag_namespace_id]}.${td.tag_definition_name}" => td.value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, for tag defaults, does there always exist a value from the data block ? From what I can recall, some defaults can require a manual entry from the user creating the resource. Is that not the case ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are correct and I verified this behavior. Right now, the response returns "[CANNOT BE EMPTY]" if a tag key requires an input, but does not have a default value. So, right now I am using that as the entered value, to satisfy the constraints for creating the resource.

On a generated vcn when testing, one of the tags was "eamon-test.eamon:[CANNOT BE EMPTY]" as a result of this, which satisfied the constraint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants