Skip to content

Conversation

@mik-ky
Copy link
Contributor

@mik-ky mik-ky commented Nov 16, 2025

This PR adds support for Scoped Tenant Variables.

Project Tenant Variables

  • environment_id becomes optional, but the variable must be scoped to an environment via the scope.
  • Backwards compatible -- if server does not support this, it will call the existing V1 endpoint. If it does, it will migrate existing state and will use V2 endpoint.
  • Import updated to allow v2 variables

Common Tenant Variables

  • Adds scope block
  • Backwards compatible -- same as Project Tenant Variables
  • Import updated to allow v2 variables

Other changes

  • (V1) Terraform state keeps ids as a composite key. In V2, we use TenantVariableId as the id as now there could be multiple environments scoped to a single variable.
  • Adds an option to override feature flags in our test provider in tests
  • Because of the Tenant Variable API, it can't run in parallel. A keyed mutex was added to ensure we don't run into concurrency issues

[sc-93478]

@mik-ky mik-ky changed the title Fnm/feat/scoped tenant variables Scoped Tenant Variables Nov 16, 2025
@mik-ky mik-ky force-pushed the fnm/feat/scoped-tenant-variables branch 7 times, most recently from 531ae1b to 820da5c Compare November 18, 2025 21:41
@mik-ky mik-ky changed the title Scoped Tenant Variables feat: scoped tenant variables Nov 18, 2025
@mik-ky mik-ky force-pushed the fnm/feat/scoped-tenant-variables branch from 820da5c to 1afad5e Compare November 18, 2025 21:46
}

func getEnvironmentsResourceSchema() resourceSchema.Attribute {
func getEnvironmentsResourceSchema(description string) resourceSchema.Attribute {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not so much related to tenant variables, but a minor reusability change on a generic schema

@mik-ky mik-ky marked this pull request as ready for review November 18, 2025 22:18
@mik-ky mik-ky force-pushed the fnm/feat/scoped-tenant-variables branch from 1afad5e to 4b2ae00 Compare November 19, 2025 02:17
Copy link
Contributor

@bec-callow-oct bec-callow-oct left a comment

Choose a reason for hiding this comment

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

Looks good, and the issues we discussed are resolved

@mik-ky mik-ky merged commit a679a2e into main Nov 23, 2025
19 checks passed
@mik-ky mik-ky deleted the fnm/feat/scoped-tenant-variables branch November 23, 2025 21:18
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