Skip to content

Commit

Permalink
docs: tenant descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
henryde committed Jun 10, 2024
1 parent 2da1237 commit 3d36f57
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
16 changes: 8 additions & 8 deletions docs/resources/tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ Single tenant by workspace, project, and platform.

Required:

- `owned_by_project` (String)
- `owned_by_workspace` (String)
- `platform_identifier` (String)
- `owned_by_project` (String) Identifier of the project the tenant belongs to.
- `owned_by_workspace` (String) Identifier of the workspace the tenant belongs to.
- `platform_identifier` (String) Identifier of the target platform.

Read-Only:

- `assigned_tags` (Map of List of String)
- `deleted_on` (String)
- `assigned_tags` (Map of List of String) Tags assigned to this tenant originating from workspace, payment method and project.
- `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).


<a id="nestedatt--spec"></a>
### Nested Schema for `spec`

Optional:

- `landing_zone_identifier` (String)
- `local_id` (String)
- `quotas` (Attributes List) (see [below for nested schema](#nestedatt--spec--quotas))
- `landing_zone_identifier` (String) Identifier of landing zone to assign to this tenant.
- `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.
- `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))

<a id="nestedatt--spec--quotas"></a>
### Nested Schema for `spec.quotas`
Expand Down
40 changes: 28 additions & 12 deletions internal/provider/tenant_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,26 @@ func (r *tenantResource) Schema(_ context.Context, _ resource.SchemaRequest, res
Required: true,
PlanModifiers: []planmodifier.Object{objectplanmodifier.RequiresReplace()},
Attributes: map[string]schema.Attribute{
"owned_by_workspace": schema.StringAttribute{Required: true},
"owned_by_project": schema.StringAttribute{Required: true},
"platform_identifier": schema.StringAttribute{Required: true},
"deleted_on": schema.StringAttribute{Computed: true},
"owned_by_workspace": schema.StringAttribute{
MarkdownDescription: "Identifier of the workspace the tenant belongs to.",
Required: true,
},
"owned_by_project": schema.StringAttribute{
MarkdownDescription: "Identifier of the project the tenant belongs to.",
Required: true,
},
"platform_identifier": schema.StringAttribute{
MarkdownDescription: "Identifier of the target platform.",
Required: true,
},
"deleted_on": schema.StringAttribute{
MarkdownDescription: "If the tenant has been submitted for deletion by a workspace manager, the date is shown here (e.g. 2020-12-22T09:37:43Z).",
Computed: true,
},
"assigned_tags": schema.MapAttribute{
ElementType: types.ListType{ElemType: types.StringType},
Computed: true,
MarkdownDescription: "Tags assigned to this tenant originating from workspace, payment method and project.",
ElementType: types.ListType{ElemType: types.StringType},
Computed: true,
},
},
},
Expand All @@ -94,16 +107,19 @@ func (r *tenantResource) Schema(_ context.Context, _ resource.SchemaRequest, res
Required: true,
Attributes: map[string]schema.Attribute{
"local_id": schema.StringAttribute{
Optional: true,
Computed: true,
MarkdownDescription: "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.",
Optional: true,
Computed: true,
},
"landing_zone_identifier": schema.StringAttribute{
Optional: true,
Computed: true,
MarkdownDescription: "Identifier of landing zone to assign to this tenant.",
Optional: true,
Computed: true,
},
"quotas": schema.ListNestedAttribute{
Optional: true,
Computed: true,
MarkdownDescription: "Set of applied tenant quotas. By default the landing zone quotas are applied to new tenants.",
Optional: true,
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"key": schema.StringAttribute{Computed: true},
Expand Down

0 comments on commit 3d36f57

Please sign in to comment.