You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: back meshstack_tenant with the v4 tenant API + migration
Reimplement meshstack_tenant on the shared v4 body (platform_ref, landing_zone_ref,
platform_tenant_id, status, ref, wait_for_completion):
- v3->v4 state upgrade (SchemaVersion 1): the upgrader resolves the tenant via the list
endpoint (Configure runs before UpgradeResourceState) and backfills uuid + refs.
- moved support from meshstack_tenant_v4 (shared body -> non-destructive).
- import accepts a tenant UUID or the legacy workspace.project.location.platform composite.
- singular data source reimplemented over TenantV4.List (composite key).
- deprecate the meshstack_tenant_v4 resource (-> meshstack_tenant + moved) and the singular
meshstack_tenant / meshstack_tenant_v4 data sources (-> plural meshstack_tenants).
- rename the plural tenants data source's internal identifiers off the _v4 suffix (HCL name
meshstack_tenants unchanged).
Shared the v4 body schema + state mapping between meshstack_tenant and meshstack_tenant_v4.
Adds a WithRawBlock test helper for moved-block configs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,24 @@
1
1
# v0.24.0
2
2
3
3
BREAKING CHANGES:
4
-
-`meshstack_tenant_v4`: the tenant now references its platform and landing zone by ref instead of by identifier, aligning with other meshObject references. `spec.platform_identifier` (a string) is replaced by `spec.platform_ref` (`{uuid, kind}`) and `spec.landing_zone_identifier` (a string) by `spec.landing_zone_ref` (`{name, kind}`, where `name` is the landing zone identifier). Assign the referenced resources' computed `ref` outputs directly, e.g. `platform_ref = meshstack_platform.example.ref` and `landing_zone_ref = meshstack_landingzone.example.ref`. Both data sources expose the refs as computed outputs. Requires meshStack with the meshTenant v4 API carrying `platformRef`/`landingZoneRef`.
5
-
6
-
FEATURES:
7
-
-`meshstack_landingzone` resource and data source now expose a computed `ref` output (`{name, kind}`) suitable for use as `landing_zone_ref` in `meshstack_tenant_v4`, matching the existing `ref` outputs on other resources.
4
+
-`meshstack_tenant` now runs on the meshTenant v4 API and the resource body changed accordingly (the move itself upgrades state in place, without recreating the tenant): `metadata.platform_identifier` → `spec.platform_ref` (`{uuid, kind}`), `spec.local_id` → `spec.platform_tenant_id`, `spec.landing_zone_identifier` → `spec.landing_zone_ref` (`{name, kind}`), `metadata.assigned_tags` → `status.tags`, and `spec.quotas` is now a set. New computed `ref`, richer `status`, and a `wait_for_completion` toggle. Import accepts either the tenant UUID or the legacy `workspace.project.location.platform` composite. Requires meshStack with the meshTenant v4 API carrying `platformRef`/`landingZoneRef`. Upgrade caveats: the automatic state upgrade queries the backend and expects exactly one active tenant for the composite (it errors otherwise); and if you previously omitted the landing zone, set `landing_zone_ref` after upgrading, because it is `RequiresReplace` — leaving it unset forces a tenant recreate.
5
+
-`meshstack_tenant_v4`: references its platform and landing zone by ref instead of by identifier. `spec.platform_identifier` → `spec.platform_ref` (`{uuid, kind}`) and `spec.landing_zone_identifier` → `spec.landing_zone_ref` (`{name, kind}`, where `name` is the landing zone identifier). Assign the referenced resources' computed `ref` outputs directly, e.g. `platform_ref = meshstack_platform.example.ref` and `landing_zone_ref = meshstack_landingzone.example.ref`.
8
6
9
7
FEATURES:
8
+
-`meshstack_landingzone` resource and data source now expose a computed `ref` output (`{name, kind}`) suitable for use as `landing_zone_ref` in tenant resources, matching the existing `ref` outputs on other resources.
9
+
-`meshstack_tenant` supports migrating from `meshstack_tenant_v4` with a `moved` block (both share the v4 body, so the move is non-destructive).
10
10
-`meshstack_building_block_definition`: `version_spec.inputs` and `version_spec.outputs` now support an optional `display_order` (number) attribute that controls how inputs/outputs are arranged in meshPanel. It defaults to the already set value when omitted, or `0` if there is none.
11
11
12
12
FIXES:
13
13
-`meshstack_building_block`: A `content_hash` wired from a definition's computed `content_hash` no longer triggers a re-run when the value changed only because the hash-algorithm version changed (e.g. after upgrading the provider). Such version-only differences are now recognized and ignored, while genuine content changes still re-run. Setting an arbitrary (non-versioned) `content_hash` to force a manual re-run continues to work.
14
14
15
+
DEPRECATIONS:
16
+
-`meshstack_tenant_v4` (resource) is deprecated in favor of `meshstack_tenant`; migrate with a `moved` block. The resource stays registered for now.
17
+
- The singular tenant data sources `meshstack_tenant` and `meshstack_tenant_v4` are deprecated in favor of the plural `meshstack_tenants` data source (which filters by workspace/project/platform).
18
+
19
+
NOTES:
20
+
- The plural tenants data source is `meshstack_tenants` (the internal `*_v4` naming was dropped; the HCL type name is unchanged).
Copy file name to clipboardExpand all lines: docs/data-sources/tenant.md
+44-7Lines changed: 44 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,15 @@ page_title: "meshstack_tenant Data Source - terraform-provider-meshstack"
4
4
subcategory: ""
5
5
description: |-
6
6
Single tenant by workspace, project, and platform.
7
+
~> Preview: This resource is in preview. Breaking changes are possible without prior notice due to changes in the underlying meshStack preview API https://docs.meshcloud.io/api/technical-specifications#preview-endpoints or due to changes in this provider. Please ensure you are running the latest version of the provider and report any bugs via GitHub issues https://github.com/meshcloud/terraform-provider-meshstack/issues or via support@meshcloud.io.
7
8
---
8
9
9
10
# meshstack_tenant (Data Source)
10
11
11
12
Single tenant by workspace, project, and platform.
12
13
14
+
~> **Preview:** This resource is in preview. Breaking changes are possible without prior notice due to changes in the underlying [meshStack preview API](https://docs.meshcloud.io/api/technical-specifications#preview-endpoints) or due to changes in this provider. Please ensure you are running the latest version of the provider and report any bugs via [GitHub issues](https://github.com/meshcloud/terraform-provider-meshstack/issues) or via support@meshcloud.io.
15
+
13
16
## Example Usage
14
17
15
18
```terraform
@@ -32,30 +35,52 @@ data "meshstack_tenant" "name" {
32
35
### Read-Only
33
36
34
37
-`spec` (Attributes) Tenant specification. (see [below for nested schema](#nestedatt--spec))
38
+
-`status` (Attributes) Tenant status. (see [below for nested schema](#nestedatt--status))
35
39
36
40
<aid="nestedatt--metadata"></a>
37
41
### Nested Schema for `metadata`
38
42
39
43
Required:
40
44
41
-
-`owned_by_project` (String)
42
-
-`owned_by_workspace` (String)
43
-
-`platform_identifier` (String)
45
+
-`owned_by_project` (String) Identifier of the project the tenant belongs to.
46
+
-`owned_by_workspace` (String) Identifier of the workspace the tenant belongs to.
47
+
-`platform_identifier` (String) Identifier of the target platform (`<platform>.<location>`).
44
48
45
49
Read-Only:
46
50
47
-
-`assigned_tags` (Map of List of String)
51
+
-`created_on` (String)
48
52
-`deleted_on` (String)
53
+
-`marked_for_deletion_on` (String)
54
+
-`uuid` (String) The unique identifier (UUID) of the tenant.
49
55
50
56
51
57
<aid="nestedatt--spec"></a>
52
58
### Nested Schema for `spec`
53
59
54
60
Read-Only:
55
61
56
-
-`landing_zone_identifier` (String)
57
-
-`local_id` (String)
58
-
-`quotas` (Attributes List) (see [below for nested schema](#nestedatt--spec--quotas))
62
+
-`landing_zone_ref` (Attributes) (see [below for nested schema](#nestedatt--spec--landing_zone_ref))
63
+
-`platform_ref` (Attributes) (see [below for nested schema](#nestedatt--spec--platform_ref))
64
+
-`platform_tenant_id` (String)
65
+
-`quotas` (Attributes Set) (see [below for nested schema](#nestedatt--spec--quotas))
Single tenant by workspace, project, and platform.
6
+
Manages a meshTenant.
7
+
~> Preview: This resource is in preview. Breaking changes are possible without prior notice due to changes in the underlying meshStack preview API https://docs.meshcloud.io/api/technical-specifications#preview-endpoints or due to changes in this provider. Please ensure you are running the latest version of the provider and report any bugs via GitHub issues https://github.com/meshcloud/terraform-provider-meshstack/issues or via support@meshcloud.io.
7
8
---
8
9
9
10
# meshstack_tenant (Resource)
10
11
11
-
Single tenant by workspace, project, and platform.
12
+
Manages a `meshTenant`.
13
+
14
+
~> **Preview:** This resource is in preview. Breaking changes are possible without prior notice due to changes in the underlying [meshStack preview API](https://docs.meshcloud.io/api/technical-specifications#preview-endpoints) or due to changes in this provider. Please ensure you are running the latest version of the provider and report any bugs via [GitHub issues](https://github.com/meshcloud/terraform-provider-meshstack/issues) or via support@meshcloud.io.
-`metadata` (Attributes) Tenant metadata. Workspace, project and platform of the target tenant must be set here. (see [below for nested schema](#nestedatt--metadata))
39
+
-`metadata` (Attributes) Metadata of the tenant. The `owned_by_workspace` and `owned_by_project` attributes must be set here. (see [below for nested schema](#nestedatt--metadata))
35
40
-`spec` (Attributes) Tenant specification. (see [below for nested schema](#nestedatt--spec))
36
41
42
+
### Optional
43
+
44
+
-`wait_for_completion` (Boolean) Wait for tenant creation/deletion to complete. Note that tenant creation is considered complete when `spec.platformTenantId` is set and not necessarily when replication is finished. Defaults to `true`.
45
+
46
+
### Read-Only
47
+
48
+
-`ref` (Attributes) Reference to this tenant, can be used as `target_ref` in building block resources. (see [below for nested schema](#nestedatt--ref))
49
+
-`status` (Attributes) Tenant status. (see [below for nested schema](#nestedatt--status))
50
+
37
51
<aid="nestedatt--metadata"></a>
38
52
### Nested Schema for `metadata`
39
53
40
54
Required:
41
55
42
-
-`owned_by_project` (String) Identifier of the project the tenant belongs to.
43
-
-`owned_by_workspace` (String) Identifier of the workspace the tenant belongs to.
44
-
-`platform_identifier` (String) Identifier of the target platform.
56
+
-`owned_by_project` (String) The identifier of the project that the tenant belongs to.
57
+
-`owned_by_workspace` (String) The identifier of the workspace that the tenant belongs to.
45
58
46
59
Read-Only:
47
60
48
-
-`assigned_tags` (Map of List of String) Tags assigned to this tenant originating from workspace, payment method and project.
49
-
-`deleted_on` (String) If the tenant has been submitted for deletion by a workspace manager, the date is shown here (e.g. 2020-12-22T09:37:43Z).
61
+
-`created_on` (String) The creation timestamp of the meshTenant (e.g. `2020-12-22T09:37:43Z`).
62
+
-`deleted_on` (String) The deletion timestamp of the tenant (e.g. `2020-12-22T09:37:43Z`).
63
+
-`marked_for_deletion_on` (String) The timestamp when the tenant was marked for deletion (e.g. `2020-12-22T09:37:43Z`).
64
+
-`uuid` (String) The unique identifier (UUID) of the tenant.
50
65
51
66
52
67
<aid="nestedatt--spec"></a>
53
68
### Nested Schema for `spec`
54
69
70
+
Required:
71
+
72
+
-`platform_ref` (Attributes) Reference to the platform this tenant belongs to, identified by its uuid. (see [below for nested schema](#nestedatt--spec--platform_ref))
73
+
74
+
Optional:
75
+
76
+
-`landing_zone_ref` (Attributes) Reference to the landing zone to assign to this tenant, identified by its name (the landing zone identifier). (see [below for nested schema](#nestedatt--spec--landing_zone_ref))
77
+
-`platform_tenant_id` (String) The identifier of the tenant on the platform (e.g. GCP project ID or Azure subscription ID). If this is not set, a new tenant will be created. If this is set, an existing tenant will be imported. Otherwise, this field will be empty until a successful replication has run.
78
+
-`quotas` (Attributes Set) Landing zone quota settings will be applied by default but can be changed here. (see [below for nested schema](#nestedatt--spec--quotas))
-`name` (String) The name (identifier) of the landing zone.
98
+
55
99
Optional:
56
100
57
-
-`landing_zone_identifier` (String) Identifier of landing zone to assign to this tenant. **Note:** This field is only optional for platform type SERVICEREGISTRY, otherwise it is required.
58
-
-`local_id` (String) Tenant ID local to the platform (e.g. GCP project ID, Azure subscription ID). Setting the local ID means that a tenant with this ID should be imported into meshStack. Not setting a local ID means that a new tenant should be created. Field will be empty until a successful replication has run. **Note:** Importing is a high-privileged operation and setting this field is possible only when using API Keys with admin permissions for saving tenants.
59
-
-`quotas` (Attributes List) Set of applied tenant quotas. By default the landing zone quotas are applied to new tenants. (see [below for nested schema](#nestedatt--spec--quotas))
-`platform_type_identifier` (String) Identifier of the platform type.
129
+
-`platform_workspace_identifier` (String) Some platforms create representations of workspaces, in such cases this will contain the identifier of the workspace on the platform.
130
+
-`quotas` (Attributes Set) The effective quotas applied to the tenant. (see [below for nested schema](#nestedatt--status--quotas))
131
+
-`tags` (Map of List of String) Tags assigned to this tenant.
132
+
-`tenant_name` (String) The full tenant name, a concatenation of the workspace identifier, project identifier and platform identifier.
0 commit comments