Skip to content

Commit 012e6b0

Browse files
authored
Add Azure CCES resource (#294)
1 parent af49bd3 commit 012e6b0

File tree

11 files changed

+890
-26
lines changed

11 files changed

+890
-26
lines changed

docs/resources/aws_cloud_cluster.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
---
2-
# generated by https://github.com/hashicorp/terraform-plugin-docs
32
page_title: "polaris_aws_cloud_cluster Resource - terraform-provider-polaris"
43
subcategory: ""
54
description: |-
6-
The polaris_aws_cloud_cluster resource creates an AWS cloud cluster using RSC.
7-
This resource creates a Rubrik Cloud Data Management (CDM) cluster with elastic storage
8-
in AWS using the specified configuration. The cluster will be deployed with the specified
9-
number of nodes, instance types, and network configuration.
10-
~> Note: This resource creates actual AWS infrastructure. Destroying the
11-
resource will attempt to clean up the created resources, but manual cleanup
12-
may be required.
13-
~> Note: The AWS account must be onboarded to RSC with the Server and Apps
14-
feature enabled before creating a cloud cluster.
15-
~> Note: Cloud Cluster Removal is not supported via terraform yet. The cluster
16-
will be removed from state and you must remove the cluster through the RSC UI.
5+
6+
The `polaris_aws_cloud_cluster` resource creates an AWS cloud cluster using RSC.
7+
8+
This resource creates a Rubrik Cloud Data Management (CDM) cluster with elastic storage
9+
in AWS using the specified configuration. The cluster will be deployed with the specified
10+
number of nodes, instance types, and network configuration.
11+
12+
~> **Note:** This resource creates actual AWS infrastructure. Destroying the
13+
resource will attempt to clean up the created resources, but manual cleanup
14+
may be required.
15+
16+
~> **Note:** The AWS account must be onboarded to RSC with the Server and Apps
17+
feature enabled before creating a cloud cluster.
18+
19+
~> **Note:** Cloud Cluster Removal is not supported via terraform yet. The cluster
20+
will be removed from state and you must remove the cluster through the RSC UI.
21+
1722
---
1823

1924
# polaris_aws_cloud_cluster (Resource)
2025

26+
2127
The `polaris_aws_cloud_cluster` resource creates an AWS cloud cluster using RSC.
2228

2329
This resource creates a Rubrik Cloud Data Management (CDM) cluster with elastic storage
@@ -34,6 +40,8 @@ number of nodes, instance types, and network configuration.
3440
~> **Note:** Cloud Cluster Removal is not supported via terraform yet. The cluster
3541
will be removed from state and you must remove the cluster through the RSC UI.
3642

43+
44+
3745
## Example Usage
3846

3947
```terraform
@@ -67,7 +75,6 @@ resource "polaris_aws_cloud_cluster" "example" {
6775
}
6876
```
6977

70-
<!-- schema generated by tfplugindocs -->
7178
## Schema
7279

7380
### Required
@@ -132,6 +139,6 @@ Read-Only:
132139

133140
Optional:
134141

135-
- `create` (String)
136-
- `default` (String)
137-
- `read` (String)
142+
- `create` (String) Create resource timeout (defaults to `60m`).
143+
- `default` (String) Default resource timeout (defaults to `20m`).
144+
- `read` (String) Read resource timeout (defaults to `20m`).
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
page_title: "polaris_azure_cloud_cluster Resource - terraform-provider-polaris"
3+
subcategory: ""
4+
description: |-
5+
6+
The `polaris_azure_cloud_cluster` resource creates an Azure cloud cluster using RSC.
7+
8+
This resource creates a Rubrik Cloud Data Management (CDM) cluster with elastic storage
9+
in Azure using the specified configuration. The cluster will be deployed with the specified
10+
number of nodes, instance types, and network configuration.
11+
12+
~> **Note:** This resource creates actual Azure infrastructure. Destroying the
13+
resource will attempt to clean up the created resources, but manual cleanup
14+
may be required.
15+
16+
~> **Note:** The Azure subscription must be onboarded to RSC with the Server and Apps
17+
feature enabled before creating a cloud cluster.
18+
19+
~> **Note:** Cloud Cluster Removal is not supported via terraform yet. The cluster
20+
will be removed from state and you must remove the cluster through the RSC UI.
21+
22+
---
23+
24+
# polaris_azure_cloud_cluster (Resource)
25+
26+
27+
The `polaris_azure_cloud_cluster` resource creates an Azure cloud cluster using RSC.
28+
29+
This resource creates a Rubrik Cloud Data Management (CDM) cluster with elastic storage
30+
in Azure using the specified configuration. The cluster will be deployed with the specified
31+
number of nodes, instance types, and network configuration.
32+
33+
~> **Note:** This resource creates actual Azure infrastructure. Destroying the
34+
resource will attempt to clean up the created resources, but manual cleanup
35+
may be required.
36+
37+
~> **Note:** The Azure subscription must be onboarded to RSC with the Server and Apps
38+
feature enabled before creating a cloud cluster.
39+
40+
~> **Note:** Cloud Cluster Removal is not supported via terraform yet. The cluster
41+
will be removed from state and you must remove the cluster through the RSC UI.
42+
43+
44+
45+
## Example Usage
46+
47+
```terraform
48+
# Create an Azure cloud cluster using RSC
49+
resource "polaris_azure_cloud_cluster" "example" {
50+
cloud_account_id = "12345678-1234-1234-1234-123456789012"
51+
52+
cluster_config {
53+
cluster_name = "my-cloud-cluster"
54+
admin_email = "[email protected]"
55+
admin_password = "RubrikGoForward!"
56+
dns_name_servers = ["8.8.8.8", "8.8.4.4"]
57+
dns_search_domains = ["example.com"]
58+
ntp_servers = ["pool.ntp.org"]
59+
num_nodes = 3
60+
keep_cluster_on_failure = false
61+
}
62+
63+
vm_config {
64+
cdm_version = "9.2.3-p7-29713"
65+
instance_type = "STANDARD_D8S_V5"
66+
location = "westus"
67+
resource_group = "my-resource-group"
68+
network_resource_group = "my-network-resource-group"
69+
vnet_resource_group = "my-vnet-resource-group"
70+
subnet = "my-subnet"
71+
vnet = "my-vnet"
72+
network_security_group = "my-network-security-group"
73+
network_security_resource_group = "my-network-security-resource-group"
74+
vm_type = "EXTRA_DENSE"
75+
}
76+
}
77+
```
78+
79+
## Schema
80+
81+
### Required
82+
83+
- `cloud_account_id` (String) RSC cloud account ID (UUID).
84+
- `cluster_config` (Block List, Min: 1, Max: 1) Configuration for the cloud cluster. Changing this forces a new resource to be created. (see [below for nested schema](#nestedblock--cluster_config))
85+
- `vm_config` (Block List, Min: 1, Max: 1) VM configuration for the cluster nodes. Changing this forces a new resource to be created. (see [below for nested schema](#nestedblock--vm_config))
86+
87+
### Optional
88+
89+
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
90+
91+
### Read-Only
92+
93+
- `id` (String) Cloud cluster ID (UUID).
94+
95+
<a id="nestedblock--cluster_config"></a>
96+
### Nested Schema for `cluster_config`
97+
98+
Required:
99+
100+
- `admin_email` (String) Email address for the cluster admin user. Changing this value will have no effect on the cluster.
101+
- `admin_password` (String, Sensitive) Password for the cluster admin user. Changing this value will have no effect on the cluster.
102+
- `cluster_name` (String) Unique name to assign to the cloud cluster. Changing this forces a new resource to be created.
103+
- `dns_name_servers` (List of String) DNS name servers for the cluster. Changing this forces a new resource to be created.
104+
- `keep_cluster_on_failure` (Boolean) Whether to keep the cluster on failure (can be useful for troubleshooting). Changing this forces a new resource to be created.
105+
- `ntp_servers` (List of String) NTP servers for the cluster. Changing this forces a new resource to be created.
106+
- `num_nodes` (Number) Number of nodes in the cluster. Changing this forces a new resource to be created.
107+
108+
Optional:
109+
110+
- `dns_search_domains` (List of String) DNS search domains for the cluster. Changing this forces a new resource to be created.
111+
112+
113+
<a id="nestedblock--vm_config"></a>
114+
### Nested Schema for `vm_config`
115+
116+
Required:
117+
118+
- `cdm_version` (String) CDM version to use. Changing this forces a new resource to be created.
119+
- `container_name` (String) Azure storage container name for the cluster. Changing this forces a new resource to be created.
120+
- `enable_immutability` (Boolean) Whether to enable immutability for the storage account. Changing this forces a new resource to be created.
121+
- `instance_type` (String) Azure instance type for the cluster nodes. Allowed values are `STANDARD_DS5_V2`, `STANDARD_D16S_V5`, `STANDARD_D8S_V5`, `STANDARD_D32S_V5`, `STANDARD_E16S_V5`, `STANDARD_D8AS_V5`, `STANDARD_D16AS_V5`, `STANDARD_D32AS_V5` and `STANDARD_E16AS_V5`. Changing this forces a new resource to be created.
122+
- `network_resource_group` (String) Azure resource group name for network resources. Changing this forces a new resource to be created.
123+
- `network_security_group` (String) Azure network security group name. Changing this forces a new resource to be created.
124+
- `network_security_resource_group` (String) Azure resource group name for the network security group. Changing this forces a new resource to be created.
125+
- `region` (String) Azure region to deploy the cluster in. The format should be the native Azure format, e.g. `eastus`, `westus`, etc. Changing this forces a new resource to be created.
126+
- `resource_group_name` (String) Azure resource group name where the cluster will be deployed. Changing this forces a new resource to be created.
127+
- `storage_account_name` (String) Azure storage account name for the cluster. Changing this forces a new resource to be created.
128+
- `subnet` (String) Azure subnet name for the cluster nodes. Changing this forces a new resource to be created.
129+
- `user_assigned_managed_identity_name` (String) Name of the user-assigned managed identity. Changing this forces a new resource to be created.
130+
- `vnet` (String) Azure virtual network name. Changing this forces a new resource to be created.
131+
- `vnet_resource_group` (String) Azure resource group name for the virtual network. Changing this forces a new resource to be created.
132+
133+
Optional:
134+
135+
- `vm_type` (String) VM type for the cluster. Changing this forces a new resource to be created. Possible values are `STANDARD`, `DENSE` and `EXTRA_DENSE`. `DENSE` is recommended for CCES.
136+
137+
Read-Only:
138+
139+
- `cdm_product` (String) CDM Product Code. This is a read-only field and computed based on the CDM version.
140+
141+
142+
<a id="nestedblock--timeouts"></a>
143+
### Nested Schema for `timeouts`
144+
145+
Optional:
146+
147+
- `create` (String) Create resource timeout (defaults to `60m`).
148+
- `default` (String) Default resource timeout (defaults to `20m`).
149+
- `read` (String) Read resource timeout (defaults to `20m`).
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Create an Azure cloud cluster using RSC
2+
resource "polaris_azure_cloud_cluster" "example" {
3+
cloud_account_id = "12345678-1234-1234-1234-123456789012"
4+
5+
cluster_config {
6+
cluster_name = "my-cloud-cluster"
7+
admin_email = "[email protected]"
8+
admin_password = "RubrikGoForward!"
9+
dns_name_servers = ["8.8.8.8", "8.8.4.4"]
10+
dns_search_domains = ["example.com"]
11+
ntp_servers = ["pool.ntp.org"]
12+
num_nodes = 3
13+
keep_cluster_on_failure = false
14+
}
15+
16+
vm_config {
17+
cdm_version = "9.2.3-p7-29713"
18+
instance_type = "STANDARD_D8S_V5"
19+
location = "westus"
20+
resource_group = "my-resource-group"
21+
network_resource_group = "my-network-resource-group"
22+
vnet_resource_group = "my-vnet-resource-group"
23+
subnet = "my-subnet"
24+
vnet = "my-vnet"
25+
network_security_group = "my-network-security-group"
26+
network_security_resource_group = "my-network-security-resource-group"
27+
vm_type = "EXTRA_DENSE"
28+
}
29+
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/hashicorp/terraform-plugin-docs v0.22.0
1010
github.com/hashicorp/terraform-plugin-log v0.9.0
1111
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0
12-
github.com/rubrikinc/rubrik-polaris-sdk-for-go v1.1.10-0.20251022121019-f78d91b1dbf6
12+
github.com/rubrikinc/rubrik-polaris-sdk-for-go v1.1.9-0.20251106131905-3185657b9893
1313
)
1414

1515
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg
262262
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
263263
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
264264
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
265-
github.com/rubrikinc/rubrik-polaris-sdk-for-go v1.1.10-0.20251022121019-f78d91b1dbf6 h1:shreRs9YP5v1cQUBDkaoE/AKajQM4ahiGTuYt1rfY5E=
266-
github.com/rubrikinc/rubrik-polaris-sdk-for-go v1.1.10-0.20251022121019-f78d91b1dbf6/go.mod h1:JyDKo1NGAjsKb7IR31EqDXC3nu6RH/4PXvW3l39qTXE=
265+
github.com/rubrikinc/rubrik-polaris-sdk-for-go v1.1.9-0.20251106131905-3185657b9893 h1:wr7CEHlXdNvVc2Ui5s8By5w5uC2RgW4MCXR1FKoLxuY=
266+
github.com/rubrikinc/rubrik-polaris-sdk-for-go v1.1.9-0.20251106131905-3185657b9893/go.mod h1:JyDKo1NGAjsKb7IR31EqDXC3nu6RH/4PXvW3l39qTXE=
267267
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
268268
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
269269
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=

internal/provider/names.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ const (
111111
keyManagementSubnetMask = "management_subnet_mask"
112112
keyManifest = "manifest"
113113
keyName = "name"
114+
keyNetworkResourceGroup = "network_resource_group"
115+
keyNetworkSecurityGroup = "network_security_group"
116+
keyNetworkSecurityResourceGroup = "network_security_resource_group"
114117
keyNativeID = "native_id"
115118
keyNodeConfig = "node_config"
116119
keyNodeSecurityGroupID = "node_security_group_id"
@@ -154,6 +157,7 @@ const (
154157
keyPolarisAWSExocomputeClusterAttachment = "polaris_aws_exocompute_cluster_attachment"
155158
keyPolarisAWSPrivateContainerRegistry = "polaris_aws_private_container_registry"
156159
keyPolarisAzureArchivalLocation = "polaris_azure_archival_location"
160+
keyPolarisAzureCloudCluster = "polaris_azure_cloud_cluster"
157161
keyPolarisAzureCustomTags = "polaris_azure_custom_tags"
158162
keyPolarisAzureExocompute = "polaris_azure_exocompute"
159163
keyPolarisAzureExocomputeClusterAttachment = "polaris_azure_exocompute_cluster_attachment"
@@ -221,6 +225,7 @@ const (
221225
keySSOGroupID = "sso_group_id"
222226
keyStackARN = "stack_arn"
223227
keyStatus = "status"
228+
keyStorageAccountName = "storage_account_name"
224229
keyStorageAccountNamePrefix = "storage_account_name_prefix"
225230
keyStorageAccountRegion = "storage_account_region"
226231
keyStorageAccountTags = "storage_account_tags"
@@ -261,6 +266,8 @@ const (
261266
keyUsers = "users"
262267
keyVaultName = "vault_name"
263268
keyVersion = "version"
269+
keyVnet = "vnet"
270+
keyVnetResourceGroup = "vnet_resource_group"
264271
keyVPCID = "vpc_id"
265272
keyWaitForCompletion = "wait_for_completion"
266273
)

internal/provider/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ func Provider() *schema.Provider {
8383
keyPolarisAWSExocomputeClusterAttachment: resourceAwsExocomputeClusterAttachment(),
8484
keyPolarisAWSPrivateContainerRegistry: resourceAwsPrivateContainerRegistry(),
8585
keyPolarisAzureArchivalLocation: resourceAzureArchivalLocation(),
86+
keyPolarisAzureCloudCluster: resourceAzureCloudCluster(),
8687
keyPolarisAzureCustomTags: resourceAzureCustomTags(),
8788
keyPolarisAzureExocompute: resourceAzureExocompute(),
8889
keyPolarisAzureExocomputeClusterAttachment: resourceAzureExocomputeClusterAttachment(),

internal/provider/resource_aws_cloud_cluster.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ number of nodes, instance types, and network configuration.
5454
will be removed from state and you must remove the cluster through the RSC UI.
5555
`
5656

57+
// This resource uses a template for its documentation due to a bug in the TF
58+
// docs generator. Remember to update the template if the documentation for any
59+
// fields are changed.
5760
func resourceAwsCloudCluster() *schema.Resource {
5861
return &schema.Resource{
5962
CreateContext: awsCreateCloudCluster,
@@ -323,13 +326,13 @@ func awsCreateCloudCluster(ctx context.Context, d *schema.ResourceData, m any) d
323326
}
324327

325328
vmConfig := gqlcloudcluster.AwsVmConfig{
326-
CdmVersion: vmConfigMap[keyCDMVersion].(string),
329+
CDMVersion: vmConfigMap[keyCDMVersion].(string),
327330
InstanceProfileName: vmConfigMap[keyInstanceProfileName].(string),
328331
InstanceType: instanceType,
329332
SecurityGroups: securityGroups,
330333
Subnet: vmConfigMap[keySubnetID].(string),
331-
VmType: vmType,
332-
Vpc: vmConfigMap[keyVPCID].(string),
334+
VMType: vmType,
335+
VPC: vmConfigMap[keyVPCID].(string),
333336
}
334337

335338
awsEsConfig := gqlcloudcluster.AwsEsConfigInput{
@@ -343,9 +346,9 @@ func awsCreateCloudCluster(ctx context.Context, d *schema.ResourceData, m any) d
343346
ClusterName: clusterConfigMap[keyClusterName].(string),
344347
UserEmail: clusterConfigMap[keyAdminEmail].(string),
345348
AdminPassword: secret.String(clusterConfigMap[keyAdminPassword].(string)),
346-
DnsNameServers: dnsNameServers,
347-
DnsSearchDomains: dnsSearchDomains,
348-
NtpServers: ntpServers,
349+
DNSNameServers: dnsNameServers,
350+
DNSSearchDomains: dnsSearchDomains,
351+
NTPServers: ntpServers,
349352
NumNodes: clusterConfigMap[keyNumNodes].(int),
350353
AwsEsConfig: awsEsConfig,
351354
}
@@ -358,7 +361,7 @@ func awsCreateCloudCluster(ctx context.Context, d *schema.ResourceData, m any) d
358361
Region: d.Get(keyRegion).(string),
359362
UsePlacementGroups: d.Get(keyUsePlacementGroups).(bool),
360363
Validations: validations,
361-
VmConfig: vmConfig,
364+
VMConfig: vmConfig,
362365
}
363366

364367
cloudcluster, err := cloudcluster.Wrap(client).CreateCloudCluster(ctx, input, false)

0 commit comments

Comments
 (0)