Skip to content

Commit 918f3cf

Browse files
committed
feat: add support for custom landing zone
CU-86c68mqgp
1 parent 244e2c8 commit 918f3cf

File tree

8 files changed

+84
-0
lines changed

8 files changed

+84
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.17.5
2+
3+
FEATURES:
4+
5+
- `meshstack_landingzone`: Added support for `custom` platform type.
6+
17
## v0.17.4
28

39
FEATURES:

client/landingzone.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type MeshLandingZonePlatformProperties struct {
4949
Aks *AksPlatformProperties `json:"aks" tfsdk:"aks"`
5050
Azure *AzurePlatformProperties `json:"azure" tfsdk:"azure"`
5151
AzureRg *AzureRgPlatformProperties `json:"azurerg" tfsdk:"azurerg"`
52+
Custom *CustomPlatformProperties `json:"custom" tfsdk:"custom"`
5253
Gcp *GcpPlatformProperties `json:"gcp" tfsdk:"gcp"`
5354
Kubernetes *KubernetesPlatformProperties `json:"kubernetes" tfsdk:"kubernetes"`
5455
OpenShift *OpenShiftPlatformProperties `json:"openshift" tfsdk:"openshift"`
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package client
2+
3+
type CustomPlatformProperties struct {
4+
// Intentionally left empty, as custom platforms do not have any properties.
5+
}

docs/data-sources/landingzone.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Optional:
8181
- `aws` (Attributes) AWS platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--aws))
8282
- `azure` (Attributes) Azure platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--azure))
8383
- `azurerg` (Attributes) Azure Resource Group platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--azurerg))
84+
- `custom` (Attributes) Custom platform properties. Custom platforms do not require any platform-specific configuration properties, so this is intentionally an empty object (`{}`). Simply set `custom = {}` in your Terraform configuration. (see [below for nested schema](#nestedatt--spec--platform_properties--custom))
8485
- `gcp` (Attributes) GCP platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--gcp))
8586
- `kubernetes` (Attributes) Kubernetes platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--kubernetes))
8687
- `openshift` (Attributes) OpenShift platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--openshift))
@@ -241,6 +242,10 @@ Required:
241242

242243

243244

245+
<a id="nestedatt--spec--platform_properties--custom"></a>
246+
### Nested Schema for `spec.platform_properties.custom`
247+
248+
244249
<a id="nestedatt--spec--platform_properties--gcp"></a>
245250
### Nested Schema for `spec.platform_properties.gcp`
246251

docs/resources/landingzone.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,32 @@ resource "meshstack_landingzone" "example" {
5252
}
5353
}
5454
}
55+
56+
resource "meshstack_landingzone" "custom_example" {
57+
metadata = {
58+
name = "new-landing-zone-custom-1"
59+
owned_by_workspace = "managed-customer"
60+
tags = {}
61+
}
62+
63+
spec = {
64+
display_name = "New Landing Zone custom"
65+
description = "A new custom landing zone for testing"
66+
automate_deletion_approval = false
67+
automate_deletion_replication = false
68+
info_link = "https://example.com"
69+
70+
platform_ref = {
71+
// UUID of an existing custom platform.
72+
uuid = "7035ad04-f912-44d5-98ce-ddcc2cf84b10"
73+
}
74+
75+
platform_properties = {
76+
// Nothing to be specified for custom platforms, but the block must be present.
77+
custom = {}
78+
}
79+
}
80+
}
5581
```
5682

5783
<!-- schema generated by tfplugindocs -->
@@ -109,6 +135,7 @@ Optional:
109135
- `aws` (Attributes) AWS platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--aws))
110136
- `azure` (Attributes) Azure platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--azure))
111137
- `azurerg` (Attributes) Azure Resource Group platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--azurerg))
138+
- `custom` (Attributes) Custom platform properties. Custom platforms do not require any platform-specific configuration properties, so this is intentionally an empty object (`{}`). Simply set `custom = {}` in your Terraform configuration. (see [below for nested schema](#nestedatt--spec--platform_properties--custom))
112139
- `gcp` (Attributes) GCP platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--gcp))
113140
- `kubernetes` (Attributes) Kubernetes platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--kubernetes))
114141
- `openshift` (Attributes) OpenShift platform properties. (see [below for nested schema](#nestedatt--spec--platform_properties--openshift))
@@ -269,6 +296,10 @@ Required:
269296

270297

271298

299+
<a id="nestedatt--spec--platform_properties--custom"></a>
300+
### Nested Schema for `spec.platform_properties.custom`
301+
302+
272303
<a id="nestedatt--spec--platform_properties--gcp"></a>
273304
### Nested Schema for `spec.platform_properties.gcp`
274305

examples/resources/meshstack_landingzone/resource.tf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,29 @@ resource "meshstack_landingzone" "example" {
3737
}
3838
}
3939
}
40+
41+
resource "meshstack_landingzone" "custom_example" {
42+
metadata = {
43+
name = "new-landing-zone-custom-1"
44+
owned_by_workspace = "managed-customer"
45+
tags = {}
46+
}
47+
48+
spec = {
49+
display_name = "New Landing Zone custom"
50+
description = "A new custom landing zone for testing"
51+
automate_deletion_approval = false
52+
automate_deletion_replication = false
53+
info_link = "https://example.com"
54+
55+
platform_ref = {
56+
// UUID of an existing custom platform.
57+
uuid = "7035ad04-f912-44d5-98ce-ddcc2cf84b10"
58+
}
59+
60+
platform_properties = {
61+
// Nothing to be specified for custom platforms, but the block must be present.
62+
custom = {}
63+
}
64+
}
65+
}

internal/provider/landingzone_data_source.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func (d *landingZoneDataSource) Schema(_ context.Context, _ datasource.SchemaReq
109109
"aks": aksPlatformConfigSchema(),
110110
"azure": azurePlatformConfigSchema(),
111111
"azurerg": azureRgPlatformConfigSchema(),
112+
"custom": customPlatformConfigSchema(),
112113
"gcp": gcpPlatformConfigSchema(),
113114
"kubernetes": kubernetesPlatformConfigSchema(),
114115
"openshift": openShiftPlatformConfigSchema(),

internal/provider/landingzone_resource.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func (r *landingZoneResource) Schema(_ context.Context, _ resource.SchemaRequest
155155
"aks": aksPlatformConfigSchema(),
156156
"azure": azurePlatformConfigSchema(),
157157
"azurerg": azureRgPlatformConfigSchema(),
158+
"custom": customPlatformConfigSchema(),
158159
"gcp": gcpPlatformConfigSchema(),
159160
"kubernetes": kubernetesPlatformConfigSchema(),
160161
"openshift": openShiftPlatformConfigSchema(),
@@ -489,6 +490,14 @@ func openShiftPlatformConfigSchema() schema.Attribute {
489490
}
490491
}
491492

493+
func customPlatformConfigSchema() schema.Attribute {
494+
return schema.SingleNestedAttribute{
495+
MarkdownDescription: "Custom platform properties. Custom platforms do not require any platform-specific configuration properties, so this is intentionally an empty object (`{}`). Simply set `custom = {}` in your Terraform configuration.",
496+
Optional: true,
497+
Attributes: map[string]schema.Attribute{},
498+
}
499+
}
500+
492501
func (r *landingZoneResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
493502
landingZone := client.MeshLandingZoneCreate{
494503
Metadata: client.MeshLandingZoneMetadata{},

0 commit comments

Comments
 (0)