@@ -42,6 +42,9 @@ resource "polaris_azure_subscription" "default" {
42
42
tenant_domain = "{{ .Resource.TenantDomain }}"
43
43
44
44
cloud_native_protection {
45
+ resource_group_name = "{{ .Resource.CloudNativeProtection.ResourceGroupName }}"
46
+ resource_group_region = "{{ .Resource.CloudNativeProtection.ResourceGroupRegion }}"
47
+
45
48
regions = [
46
49
"eastus2",
47
50
]
@@ -67,6 +70,9 @@ resource "polaris_azure_subscription" "default" {
67
70
tenant_domain = "{{ .Resource.TenantDomain }}"
68
71
69
72
cloud_native_protection {
73
+ resource_group_name = "{{ .Resource.CloudNativeProtection.ResourceGroupName }}"
74
+ resource_group_region = "{{ .Resource.CloudNativeProtection.ResourceGroupRegion }}"
75
+
70
76
regions = [
71
77
"eastus2",
72
78
"westus2",
@@ -105,9 +111,13 @@ func TestAccPolarisAzureSubscription_basic(t *testing.T) {
105
111
resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "delete_snapshots_on_destroy" , "false" ),
106
112
107
113
// Cloud Native Protection feature
108
- resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.status" , "connected " ),
114
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.status" , "CONNECTED " ),
109
115
resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.regions.#" , "1" ),
110
116
resource .TestCheckTypeSetElemAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.regions.*" , "eastus2" ),
117
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.resource_group_name" ,
118
+ subscription .CloudNativeProtection .ResourceGroupName ),
119
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.resource_group_region" ,
120
+ subscription .CloudNativeProtection .ResourceGroupRegion ),
111
121
),
112
122
}, {
113
123
Config : subscriptionTwoRegions ,
@@ -119,10 +129,14 @@ func TestAccPolarisAzureSubscription_basic(t *testing.T) {
119
129
resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "delete_snapshots_on_destroy" , "false" ),
120
130
121
131
// Cloud Native Protection feature
122
- resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.status" , "connected " ),
132
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.status" , "CONNECTED " ),
123
133
resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.regions.#" , "2" ),
124
134
resource .TestCheckTypeSetElemAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.regions.*" , "eastus2" ),
125
135
resource .TestCheckTypeSetElemAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.regions.*" , "westus2" ),
136
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.resource_group_name" ,
137
+ subscription .CloudNativeProtection .ResourceGroupName ),
138
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.resource_group_region" ,
139
+ subscription .CloudNativeProtection .ResourceGroupRegion ),
126
140
),
127
141
}, {
128
142
Config : subscriptionOneRegion ,
@@ -134,9 +148,13 @@ func TestAccPolarisAzureSubscription_basic(t *testing.T) {
134
148
resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "delete_snapshots_on_destroy" , "false" ),
135
149
136
150
// Cloud Native Protection feature
137
- resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.status" , "connected " ),
151
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.status" , "CONNECTED " ),
138
152
resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.regions.#" , "1" ),
139
153
resource .TestCheckTypeSetElemAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.regions.*" , "eastus2" ),
154
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.resource_group_name" ,
155
+ subscription .CloudNativeProtection .ResourceGroupName ),
156
+ resource .TestCheckResourceAttr ("polaris_azure_subscription.default" , "cloud_native_protection.0.resource_group_region" ,
157
+ subscription .CloudNativeProtection .ResourceGroupRegion ),
140
158
),
141
159
}},
142
160
})
0 commit comments