Skip to content

feat: Add additional_tags to CE logic - #155

Open
mitch-hamm wants to merge 5 commits into
mainfrom
mh/support-additional-tags-on-ce
Open

feat: Add additional_tags to CE logic#155
mitch-hamm wants to merge 5 commits into
mainfrom
mh/support-additional-tags-on-ce

Conversation

@mitch-hamm

@mitch-hamm mitch-hamm commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds additional_tags support to the streamnative_cloud_environment resource.

  • New optional additional_tags field (TypeMap of string) on the streamnative_cloud_environment resource
  • On create/update, the map is JSON-serialized and stored as a single annotation: cloud.streamnative.io/environment-parameter-additional_tags
  • On read, the annotation is deserialized back into state
  • On update, the annotation is replaced when the field changes, and removed when set to empty

Example usage

resource "streamnative_cloud_environment" "example" {
  organization          = "o-example"
  region                = "us-east-1"
  cloud_connection_name = "my-connection"
  network {
    cidr = "10.0.0.0/16"
  }
  additional_tags = {
    test  = "test"
  }
}

This produces the annotation:

cloud.streamnative.io/environment-parameter-additional_tags: {"test":"test"}

Screenshot 2026-06-03 at 4 21 50 PM

@mitch-hamm
mitch-hamm requested a review from a team as a code owner June 3, 2026 23:25
@mitch-hamm
mitch-hamm requested review from ciiiii and maxsxu June 4, 2026 01:54
@mitch-hamm

Copy link
Copy Markdown
Contributor Author

Let's run toLower() if that tf var is defined on the GCP resource

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an additional_tags map attribute to streamnative_cloud_environment, persisting it into a Kubernetes annotation and hydrating it back into Terraform state on read.

Changes:

  • Adds optional additional_tags (map of strings) to the cloud environment resource schema.
  • Serializes/deserializes additional_tags as JSON in the cloud.streamnative.io/environment-parameter-additional_tags annotation on create/update/read.
  • Adds provider description text for the new field.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cloud/resource_cloud_environment.go Adds schema + create/update/write/read logic to persist additional_tags via a single JSON annotation.
cloud/provider.go Adds the additional_tags field description string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cloud/resource_cloud_environment.go Outdated
Comment thread cloud/provider.go Outdated
mitch-hamm and others added 2 commits June 8, 2026 13:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mitch-hamm

Copy link
Copy Markdown
Contributor Author

@maxsxu I validated this but looks like something unrelated in the test suite is now failing. Can we merge and then fix the acceptance tests?

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.

2 participants