Skip to content

Commit 06d54a3

Browse files
tsimacekTomas Simacek
and
Tomas Simacek
authored
v0.9.0 release (#10)
Added support for PremiumV2 SSD with V20MP2R2 SKU and CosmosDB firewall rules. Co-authored-by: Tomas Simacek <tsimacek@pruestorage.com>
1 parent bf2eb10 commit 06d54a3

File tree

13 files changed

+70
-36
lines changed

13 files changed

+70
-36
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.9.0 (July 3, 2023)
2+
3+
* Added support for PremiumV2 SSD with V20MP2R2 SKU, refer to the [documentation](docs/resources/array_azure.md)
4+
* Added support for CosmosDB firewall rules using `user_assigned_identity`, refer to the [documentation](docs/resources/array_azure.md)
5+
16
## 0.8.0 (May 15, 2023)
27

38
* Added support for Cloud Block Store on Azure deployment for Pure Fusion using the `fusion_sec_identity` parameter, refer to the [documentation](docs/resources/array_azure.md)

cbs/acceptance/test_params.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type AccTestCbsAzureParams struct {
3535
JitGroup string `json:"jit_group"`
3636
JitGroupID string `json:"jit_group_id"`
3737
FusionSECIdentity string `json:"fusion_sec_identity"`
38+
UserAssignedIdentity string `json:"user_assigned_identity"`
3839
}
3940

4041
type AccTestCbsFusionSECAzureParams struct {

cbs/resource_array_azure.go

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ func resourceArrayAzure() *schema.Resource {
177177
ValidateFunc: validation.StringInSlice([]string{
178178
"V10MUR1",
179179
"V20MUR1",
180+
"V20MP2R2",
180181
}, false),
181182
},
182183

@@ -212,6 +213,12 @@ func resourceArrayAzure() *schema.Resource {
212213
}),
213214
},
214215

216+
"user_assigned_identity": {
217+
Type: schema.TypeString,
218+
Description: "A required input that denotes the identity of the customer User Assigned identity.",
219+
Required: true,
220+
},
221+
215222
"fusion_sec_identity": {
216223
Type: schema.TypeString,
217224
Description: "Optional input that denotes the identity of a Fusion Storage Endpoint Collection, obtained during Azure Portal GUI or CLI deployment",
@@ -414,13 +421,20 @@ func resourceArrayAzureCreate(ctx context.Context, d *schema.ResourceData, m int
414421
setAppParameter("alertRecipients", "")
415422
}
416423

417-
if v, ok := d.GetOk("fusion_sec_identity"); ok {
418-
fusionIdentity := expandFusionIdentity(v.(string))
424+
var identities = []string{}
425+
if v, ok := d.GetOk("user_assigned_identity"); ok {
426+
identities = append(identities, v.(string))
427+
} else {
428+
return diag.Errorf("failed to retrieve user_assigned_identity")
429+
}
419430

420-
parameters.Identity = fusionIdentity
421-
setAppParameter("fusionSECIdentity", fusionIdentity)
431+
if v, ok := d.GetOk("fusion_sec_identity"); ok {
432+
identities = append(identities, v.(string))
433+
setAppParameter("fusionSECIdentity", expandIdentityObject(identities[1:]))
422434
}
423435

436+
parameters.Identity = expandIdentityObject(identities)
437+
424438
if v, ok := d.GetOk("tags"); ok {
425439
tags := v.(map[string]interface{})
426440
tagsMap := make(map[string]interface{})
@@ -670,12 +684,14 @@ func groupGetByDisplayName(ctx context.Context, client cloud.AzureClientAPI, dis
670684
return &group, nil
671685
}
672686

673-
func expandFusionIdentity(fusionSECIdentity string) *managedapplications.Identity {
687+
func expandIdentityObject(identities []string) *managedapplications.Identity {
688+
var userIdentities = make(map[string]*managedapplications.UserAssignedResourceIdentity)
689+
for _, identity := range identities {
690+
userIdentities[identity] = new(managedapplications.UserAssignedResourceIdentity)
691+
}
674692
return &managedapplications.Identity{
675-
Type: managedapplications.ResourceIdentityTypeUserAssigned,
676-
UserAssignedIdentities: map[string]*managedapplications.UserAssignedResourceIdentity{
677-
fusionSECIdentity: {},
678-
},
693+
Type: managedapplications.ResourceIdentityTypeUserAssigned,
694+
UserAssignedIdentities: userIdentities,
679695
}
680696
}
681697

cbs/resource_array_azure_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,15 @@ func testAccAzureConfig(name string, orgDomain string, fusionArray bool) string
246246
247247
%[16]s
248248
249+
user_assigned_identity = "%[17]s"
249250
tags = {
250251
foo = "bar"
251252
test = "value"
252253
}
253254
}`, name, orgDomain, cbsAzureParam.ResourceGroupName, cbsAzureParam.LicenseKey, cbsAzureParam.PureuserPrivateKeyPath, cbsAzureParam.SystemSubnet,
254255
cbsAzureParam.ReplicationSubnet, cbsAzureParam.ISCSISubnet, cbsAzureParam.ManagementSubnet, cbsAzureParam.VirtualNetworkId,
255-
cbsAzureParam.Location, cbsAzureParam.KeyvaultId, cbsAzureParam.ArrayModel, fusionHCL, cbsAzureParam.JitGroupID, planHCL)
256+
cbsAzureParam.Location, cbsAzureParam.KeyvaultId, cbsAzureParam.ArrayModel, fusionHCL, cbsAzureParam.JitGroupID, planHCL,
257+
cbsAzureParam.UserAssignedIdentity)
256258
}
257259

258260
func testAccAzureConfigAppId(name string, orgDomain string, fusionArray bool) string {
@@ -283,14 +285,16 @@ func testAccAzureConfigAppId(name string, orgDomain string, fusionArray bool) st
283285
%[14]s
284286
285287
app_definition_id = "%[15]s"
288+
user_assigned_identity = "%[16]s"
286289
287290
tags = {
288291
foo = "bar"
289292
test = "value"
290293
}
291294
}`, name, orgDomain, cbsAzureParam.ResourceGroupName, cbsAzureParam.LicenseKey, cbsAzureParam.PureuserPrivateKeyPath, cbsAzureParam.SystemSubnet,
292295
cbsAzureParam.ReplicationSubnet, cbsAzureParam.ISCSISubnet, cbsAzureParam.ManagementSubnet, cbsAzureParam.VirtualNetworkId,
293-
cbsAzureParam.Location, cbsAzureParam.KeyvaultId, cbsAzureParam.ArrayModel, fusionHCL, cbsAzureParam.AppDefinitionId)
296+
cbsAzureParam.Location, cbsAzureParam.KeyvaultId, cbsAzureParam.ArrayModel, fusionHCL, cbsAzureParam.AppDefinitionId,
297+
cbsAzureParam.UserAssignedIdentity)
294298
}
295299

296300
// Lazy load the Azure param values from the json file specified at TEST_ACC_AZURE_PARAMS_PATH.

docs/resources/array_aws.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ resource "cbs_array_aws" "cbs_example" {
2727
2828
array_name = "terraform-example-instance"
2929
30-
deployment_template_url = "https://s3.amazonaws.com/awsmp-fulfillment-cf-templates-prod/4ea2905b-7939-4ee0-a521-d5c2fcb41214.e6360126-9b9d-4428-a532-e4d22aef7a40.template"
30+
deployment_template_url = "https://s3.amazonaws.com/awsmp-fulfillment-cf-templates-prod/4ea2905b-7939-4ee0-a521-d5c2fcb41214.e1e81a59-5e4c-4400-9675-85361e830022.template"
3131
deployment_role_arn = "arn:aws:iam::xxxxxxxxxxxx:role/example_role"
3232
3333
log_sender_domain = "example-company.org"

docs/resources/array_azure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Allows the deployment and management of a Cloud Block Store instance on Azure. The instance is deployed as an Azure Managed Application.
1212

13-
The instance is deployed at Purity version 6.3.5.
14-
1513
Refer to the [deployment guide](https://support.purestorage.com/FlashArray/PurityFA/Cloud_Block_Store/Cloud_Block_Store_Deployment_and_Configuration_Guide_for_Azure) for information on how to configure the Azure environment for the CBS instance.
1614

1715
~>Along with the infrastructure components defined in the deployment guide, an [Azure Key Vault](https://azure.microsoft.com/en-us/services/key-vault/)
@@ -84,6 +82,7 @@ resource "cbs_array_azure" "azure_instance" {
8482
system_subnet = "SN-xxxxxxxxxxxxxx"
8583
iscsi_subnet = "SN-xxxxxxxxxxxxxx"
8684
replication_subnet = "SN-xxxxxxxxxxxxxx"
85+
user_assigned_identity = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/resourcegroups/mock_resource_group_name/providers/Microsoft.ManagedIdentity/userAssignedIdentities/xxxxxxx",
8786
8887
jit_approval_group_object_ids = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
8988
}
@@ -93,7 +92,7 @@ resource "cbs_array_azure" "azure_instance" {
9392
## Argument Reference
9493

9594
- `alert_recipients` (Optional) - List of email addresses to receive alerts.
96-
- `array_model` (Required) - CBS array size to launch. The possible values are `V10MUR1` or `V20MUR1`.
95+
- `array_model` (Required) - CBS array size to launch. The possible values are `V10MUR1`, `V20MUR1` or `V20MP2R2`.
9796
- `array_name` (Required) - Name of the array, and the name of the managed application.
9897
- `fusion_sec_identity` (Optional) - Input that denotes the identity of a Fusion Storage Endpoint Collection, obtained during Azure Portal GUI or CLI deployment.
9998
Required when the array is deployed for use in a Fusion cluster.
@@ -112,6 +111,7 @@ The [azuread_group](https://registry.terraform.io/providers/hashicorp/azuread/la
112111
- `resource_group_name` (Required) - Name of the resource group in which to deploy the managed application.
113112
- `system_subnet` (Required) - Subnet for the system interface of the Array.
114113
- `tags` (Optional) - A list of tags to apply to all resources in the managed application.
114+
- `user_assigned_identity` (Required) - A required input that denotes the identity of the customer User Assigned identity.
115115
- `virtual_network_id` (Required) - The ID of the virtual network that contains the network interfaces of the array.
116116
- `zone` (Required) - The Availability Zone within the deployment location.
117117

examples/aws_array/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
cbs = {
44
source = "PureStorage-OpenConnect/cbs"
5-
version = "~> 0.8.0"
5+
version = "~> 0.9.0"
66
}
77
}
88
}

examples/aws_array/terraform.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Variables
22
region = "us-west-2"
33
array_name = "array-name"
4-
template_url = "https://s3.amazonaws.com/awsmp-fulfillment-cf-templates-prod/4ea2905b-7939-4ee0-a521-d5c2fcb41214.e6360126-9b9d-4428-a532-e4d22aef7a40.template"
4+
template_url = "https://s3.amazonaws.com/awsmp-fulfillment-cf-templates-prod/4ea2905b-7939-4ee0-a521-d5c2fcb41214.e1e81a59-5e4c-4400-9675-85361e830022.template"
55
deployment_role_arn = "arn:aws:iam::xxxxxxxxxxxx:role/example_role"
66
log_sender_domain = "example-company.org"
77
alert_recipients = ["admin1@example-company.org", "admin2@example-company.org"]

examples/azure_array/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
cbs = {
44
source = "PureStorage-OpenConnect/cbs"
5-
version = "~> 0.8.0"
5+
version = "~> 0.9.0"
66
}
77
}
88
}
@@ -33,6 +33,8 @@ resource "cbs_array_azure" "azure_instance" {
3333
replication_subnet = var.replication_subnet
3434

3535
jit_approval_group_object_ids = var.jit_group_ids
36+
user_assigned_identity = var.user_assigned_identity
37+
3638
plan {
3739
name = data.cbs_azure_plans.azure_plans.plans[0].name
3840
product = data.cbs_azure_plans.azure_plans.plans[0].product

examples/azure_array/terraform.tfvars

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#Variables
2-
array_name = "terraform-example-instance"
3-
location = "location_xxxx"
4-
resource_group_name = "resource_xxxx"
5-
license_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
6-
log_sender_domain = "example-company.org"
7-
alert_recipients = ["admin1@example-company.org", "admin2@example-company.org"]
8-
array_model = "V10MUR1"
9-
zone = 1
10-
virtual_network_id = "/subscriptions/xxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxx/providers/Microsoft.Network/virtualNetworks/xxxxxxxxxxxxxx"
11-
key_vault_id = "/subscriptions/xxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxx/providers/Microsoft.KeyVault/vaults/xxxxxxxxxxxxxx"
12-
management_subnet = "SN-xxxxxxxxxxxxxx"
13-
system_subnet = "SN-xxxxxxxxxxxxxx"
14-
iscsi_subnet = "SN-xxxxxxxxxxxxxx"
15-
replication_subnet = "SN-xxxxxxxxxxxxxx"
16-
jit_group_ids = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
17-
key_file_path = "example.pem"
2+
array_name = "terraform-example-instance"
3+
location = "location_xxxx"
4+
resource_group_name = "resource_xxxx"
5+
license_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
6+
log_sender_domain = "example-company.org"
7+
alert_recipients = ["admin1@example-company.org", "admin2@example-company.org"]
8+
array_model = "V10MUR1"
9+
zone = 1
10+
virtual_network_id = "/subscriptions/xxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxx/providers/Microsoft.Network/virtualNetworks/xxxxxxxxxxxxxx"
11+
key_vault_id = "/subscriptions/xxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxx/providers/Microsoft.KeyVault/vaults/xxxxxxxxxxxxxx"
12+
management_subnet = "SN-xxxxxxxxxxxxxx"
13+
system_subnet = "SN-xxxxxxxxxxxxxx"
14+
iscsi_subnet = "SN-xxxxxxxxxxxxxx"
15+
replication_subnet = "SN-xxxxxxxxxxxxxx"
16+
jit_group_ids = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
17+
key_file_path = "example.pem"
18+
user_assigned_identity = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/resourcegroups/mock_resource_group_name/providers/Microsoft.ManagedIdentity/userAssignedIdentities/xxxxxxx"

examples/azure_array/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,8 @@ variable "key_vault_id" {
6060

6161
variable "key_file_path" {
6262
type = string
63+
}
64+
65+
variable "user_assigned_identity" {
66+
type = string
6367
}

examples/azure_fusion_sec/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
cbs = {
44
source = "PureStorage-OpenConnect/cbs"
5-
version = "~> 0.8.0"
5+
version = "~> 0.9.0"
66
}
77
}
88
}

testing/mock-params-azure.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"virtual_network_id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mock_resource_group_name/providers/Microsoft.Network/virtualNetworks/mock_vnet_name",
1313
"keyvault_id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mock_resource_group_name/providers/Microsoft.KeyVault/vaults/A00000000000000000000000",
1414
"jit_group":"jit_group",
15-
"jit_group_id":"00000000-0000-0000-0001-000000000000"
15+
"jit_group_id":"00000000-0000-0000-0001-000000000000",
16+
"user_assigned_identity": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/resourcegroups/mock_resource_group_name/providers/Microsoft.ManagedIdentity/userAssignedIdentities/xxxxxxx"
1617
}

0 commit comments

Comments
 (0)