Skip to content

Commit c4666e8

Browse files
authored
Add Azure archival location data source (#173)
1 parent b94e0d4 commit c4666e8

32 files changed

+459
-79
lines changed

docs/data-sources/aws_cnp_permissions.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ description: |-
99

1010

1111

12+
1213
## Example Usage
1314

1415
```terraform
@@ -20,7 +21,7 @@ data "polaris_aws_cnp_permissions" "permissions" {
2021
}
2122
```
2223

23-
<!-- schema generated by tfplugindocs -->
24+
2425
## Schema
2526

2627
### Required
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
page_title: "polaris_azure_archival_location Data Source - terraform-provider-polaris"
3+
subcategory: ""
4+
description: |-
5+
The `polaris_azure_archival_location` data source is used to access information about an Azure archival location. An archival location is looked up using either the ID or the name.
6+
7+
---
8+
9+
# polaris_azure_archival_location (Data Source)
10+
11+
The `polaris_azure_archival_location` data source is used to access information about an Azure archival location. An archival location is looked up using either the ID or the name.
12+
13+
14+
15+
## Example Usage
16+
17+
```terraform
18+
# Using the archival location ID.
19+
data "polaris_azure_archival_location" "archival_location" {
20+
archival_location_id = "db34f042-79ea-48b1-bab8-c40dfbf2ab82"
21+
}
22+
23+
# Using the archival location name.
24+
data "polaris_azure_archival_location" "archival_location" {
25+
name = "my-archival-location"
26+
}
27+
```
28+
29+
30+
## Schema
31+
32+
### Optional
33+
34+
- `id` (String) Cloud native archival location ID.
35+
- `name` (String) Cloud native archival location name.
36+
37+
### Read-Only
38+
39+
- `connection_status` (String) Connection status of the cloud native archival location.
40+
- `container_name` (String) Azure storage container name.
41+
- `customer_managed_key` (Set of Object) Customer managed storage encryption. Specify the regions and their respective encryption details. For other regions, data will be encrypted using platform managed keys. (see [below for nested schema](#nestedatt--customer_managed_key))
42+
- `location_template` (String) RSC location template. If a storage account region was specified, it will be `SPECIFIC_REGION`, otherwise `SOURCE_REGION`.
43+
- `redundancy` (String) Azure storage redundancy. Possible values are `GRS`, `GZRS`, `LRS`, `RA_GRS`, `RA_GZRS` and `ZRS`. Default value is `LRS`.
44+
- `storage_account_name_prefix` (String) Azure storage account name prefix. The storage account name prefix cannot be longer than 14 characters and can only consist of numbers and lower case letters.
45+
- `storage_account_region` (String) Azure region to store the snapshots in. If not specified, the snapshots will be stored in the same region as the workload.
46+
- `storage_account_tags` (Map of String) Azure storage account tags. Each tag will be added to the storage account created by RSC.
47+
- `storage_tier` (String) Azure storage tier. Possible values are `COOL` and `HOT`. Default value is `COOL`.
48+
49+
<a id="nestedatt--customer_managed_key"></a>
50+
### Nested Schema for `customer_managed_key`
51+
52+
Read-Only:
53+
54+
- `name` (String) Key name.
55+
- `region` (String) The region in which the key will be used. Regions without customer managed keys will use platform managed keys.
56+
- `vault_name` (String) Key vault name.

docs/data-sources/role.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
page_title: "polaris_role Data Source - terraform-provider-polaris"
33
subcategory: ""
44
description: |-
5-
5+
66
---
77

88
# polaris_role (Data Source)
99

1010

1111

12+
1213
## Example Usage
1314

1415
```terraform
@@ -17,7 +18,7 @@ data "polaris_role" "compliance_auditor" {
1718
}
1819
```
1920

20-
<!-- schema generated by tfplugindocs -->
21+
2122
## Schema
2223

2324
### Required

docs/data-sources/role_template.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
page_title: "polaris_role_template Data Source - terraform-provider-polaris"
33
subcategory: ""
44
description: |-
5-
5+
66
---
77

88
# polaris_role_template (Data Source)
99

1010

1111

12+
1213
## Example Usage
1314

1415
```terraform
@@ -17,7 +18,7 @@ data "polaris_role_template" "compliance_auditor" {
1718
}
1819
```
1920

20-
<!-- schema generated by tfplugindocs -->
21+
2122
## Schema
2223

2324
### Required

docs/guides/changelog.md

+16-8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ page_title: "Changelog"
44

55
# Changelog
66

7+
## v0.9.0-beta.7
8+
* Add `polaris_azure_archival_location` data source. [[docs](../data-sources/azure_archival_location)]
9+
* Fix a bug in the `polaris_azure_archival_location` resource where the cloud account UUID would be passed to the RSC
10+
API instead of the Azure subscription UUID when creating an Azure archival location.
11+
* Fix a bug in the `polaris_aws_cnp_account` resource where destroying it would constantly result in an *objects not
12+
authorized* error.
13+
* Increase the wait time for asynchronous RSC operations to 8.5 minutes.
14+
715
## v0.9.0-beta.6
816
* Fix an issue with the permissions of subscriptions onboarded using the `polaris_azure_subscription` resource where
917
the RSC UI would show the status as "Update permissions" even though the app registration would have all the required
@@ -13,26 +21,26 @@ page_title: "Changelog"
1321
* Move changelog and upgrade guides to guides folder.
1422

1523
## v0.9.0-beta.4
16-
* Add support for creating Azure cloud native archival locations. [[docs](../../resources/azure_archival_location)]
24+
* Add support for creating Azure cloud native archival locations. [[docs](../resources/azure_archival_location)]
1725

1826
## v0.9.0-beta.3
1927
* Fix a bug in the `polaris_aws_exocompute` resource where customer supplied security groups were not validated
2028
correctly.
2129

2230
## v0.9.0-beta.2
2331
* Add support for shared Exocompute to the `polaris_azure_exocompute` resource.
24-
[[docs](../../resources/azure_exocompute#host_cloud_account_id)]
25-
* Add the `polaris_account` data source. [[docs](../../data-sources/account)]
32+
[[docs](../resources/azure_exocompute#host_cloud_account_id)]
33+
* Add the `polaris_account` data source. [[docs](../data-sources/account)]
2634

2735
## v0.9.0-beta.1
2836
* Add support for the Cloud Native Archival feature to the `polaris_azure_subscription` resource.
29-
[[docs](../../resources/azure_subscription#nested-schema-for-cloud_native_archival)]
37+
[[docs](../resources/azure_subscription#nested-schema-for-cloud_native_archival)]
3038
* Add support for the Cloud Native Archival Encryption feature to the `polaris_azure_subscription` resource.
31-
[[docs](../../resources/azure_subscription#nested-schema-for-cloud_native_archival_encryption)]
39+
[[docs](../resources/azure_subscription#nested-schema-for-cloud_native_archival_encryption)]
3240
* Add support for the Azure SQL Database Protection feature to the `polaris_azure_subscription` resource.
33-
[[docs](../../resources/azure_subscription#nested-schema-for-sql_db_protection)]
41+
[[docs](../resources/azure_subscription#nested-schema-for-sql_db_protection)]
3442
* Add support for the Azure SQL Managed Instance Protection feature to the `polaris_azure_subscription` resource.
35-
[[docs](../../resources/azure_subscription#nested-schema-for-sql_mi_protection)]
43+
[[docs](../resources/azure_subscription#nested-schema-for-sql_mi_protection)]
3644
* Add support for specifying an Azure resource group when onboarding the Cloud Native Archival, Cloud Native Archival
3745
Encryption, Cloud Native Protection or Exocompute features using the `polaris_azure_subscription` resource.
38-
[[docs](../../resources/azure_subscription#optional)]
46+
[[docs](../resources/azure_subscription#optional)]

docs/guides/upgrade_guide_beta.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The latest beta release introduces changes to the following data sources and res
1212
* `polaris_azure_permissions` - Add support for scoped permissions. Permissions are scoped to either the subscription
1313
level or to resource group level. The `hash` field has been deprecated and replaced with the `id` field. Both fields
1414
will have same value until the `hash` field is removed in a future release.
15+
* `polaris_azure_archival_location` - Add support for Azure archival locations, see the data source and resource
16+
documentation for more information.
1517
* `polaris_azure_exocompute` - Add support for shared Exocompute, see the resource documentation for more information.
1618
The `subscription_id` field has been deprecated and replaced with the `cloud_account_id` field. The `subscription_id`
1719
field referred to the ID of the `polaris_azure_subscription` resource and not the Azure subscription ID, which was

docs/resources/azure_archival_location.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,37 @@ Custom storage encryption is enabled by specifying one or more `customer_managed
2323

2424
-> **Note:** The Azure storage account is not created until the first protected object is archived to the location.
2525

26-
26+
## Example Usage
27+
28+
```terraform
29+
# Source region.
30+
resource "polaris_azure_archival_location" "archival_location" {
31+
cloud_account_id = polaris_azure_subscription.subscription.id
32+
name = "my-archival-location"
33+
storage_account_name_prefix = "archival"
34+
}
35+
36+
# Source region with a customer managed key.
37+
resource "polaris_azure_archival_location" "archival_location" {
38+
cloud_account_id = polaris_azure_subscription.subscription.id
39+
name = "my-archival-location"
40+
storage_account_name_prefix = "archival"
41+
42+
customer_managed_key {
43+
name = "my-archival-key"
44+
region = "eastus"
45+
vault_name = "my-archival-key-vault"
46+
}
47+
}
48+
49+
# Specific region.
50+
resource "polaris_azure_archival_location" "archival_location" {
51+
cloud_account_id = polaris_azure_subscription.subscription.id
52+
name = "my-archival-location"
53+
storage_account_name_prefix = "archival"
54+
storage_account_region = "eastus2"
55+
}
56+
```
2757

2858
<!-- schema generated by tfplugindocs -->
2959
## Schema

docs/resources/cdm_bootstrap.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ description: |-
77

88
# polaris_cdm_bootstrap (Resource)
99

10+
11+
12+
1013
## Example Usage
1114

1215
```terraform
@@ -28,6 +31,7 @@ resource "polaris_cdm_bootstrap" "default" {
2831
}
2932
```
3033

34+
3135
## Schema
3236

3337
### Required

docs/resources/cdm_bootstrap_cces_aws.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
page_title: "polaris_cdm_bootstrap_cces_aws Resource - terraform-provider-polaris"
33
subcategory: ""
44
description: |-
5-
5+
66
---
77

88
# polaris_cdm_bootstrap_cces_aws (Resource)
99

10+
11+
12+
1013
## Example Usage
1114

1215
```terraform
@@ -30,6 +33,7 @@ resource "polaris_cdm_bootstrap_cces_aws" "default" {
3033
}
3134
```
3235

36+
3337
## Schema
3438

3539
### Required

docs/resources/cdm_bootstrap_cces_azure.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
page_title: "polaris_cdm_bootstrap_cces_azure Resource - terraform-provider-polaris"
33
subcategory: ""
44
description: |-
5-
5+
66
---
77

88
# polaris_cdm_bootstrap_cces_azure (Resource)
99

10+
11+
12+
1013
## Example Usage
1114

1215
```terraform
@@ -30,6 +33,7 @@ resource "polaris_cdm_bootstrap_cces_azure" "default" {
3033
}
3134
```
3235

36+
3337
## Schema
3438

3539
### Required
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Using the archival location ID.
2+
data "polaris_azure_archival_location" "archival_location" {
3+
archival_location_id = "db34f042-79ea-48b1-bab8-c40dfbf2ab82"
4+
}
5+
6+
# Using the archival location name.
7+
data "polaris_azure_archival_location" "archival_location" {
8+
name = "my-archival-location"
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Source region.
2+
resource "polaris_azure_archival_location" "archival_location" {
3+
cloud_account_id = polaris_azure_subscription.subscription.id
4+
name = "my-archival-location"
5+
storage_account_name_prefix = "archival"
6+
}
7+
8+
# Source region with a customer managed key.
9+
resource "polaris_azure_archival_location" "archival_location" {
10+
cloud_account_id = polaris_azure_subscription.subscription.id
11+
name = "my-archival-location"
12+
storage_account_name_prefix = "archival"
13+
14+
customer_managed_key {
15+
name = "my-archival-key"
16+
region = "eastus"
17+
vault_name = "my-archival-key-vault"
18+
}
19+
}
20+
21+
# Specific region.
22+
resource "polaris_azure_archival_location" "archival_location" {
23+
cloud_account_id = polaris_azure_subscription.subscription.id
24+
name = "my-archival-location"
25+
storage_account_name_prefix = "archival"
26+
storage_account_region = "eastus2"
27+
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
99
github.com/hashicorp/terraform-plugin-docs v0.16.0
1010
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.0
11-
github.com/rubrikinc/rubrik-polaris-sdk-for-go v0.10.0-beta.7
11+
github.com/rubrikinc/rubrik-polaris-sdk-for-go v0.10.0-beta.8
1212
)
1313

1414
require (

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
412412
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
413413
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
414414
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
415-
github.com/rubrikinc/rubrik-polaris-sdk-for-go v0.10.0-beta.7 h1:sIodDAcLUHBKCjM24GKtgYIJ0nbbKx6dwrwwBQ6b060=
416-
github.com/rubrikinc/rubrik-polaris-sdk-for-go v0.10.0-beta.7/go.mod h1:670TFQkxTdbsBwEwR/fDT75hfHwPDTTOiLnyZerbqQk=
415+
github.com/rubrikinc/rubrik-polaris-sdk-for-go v0.10.0-beta.8 h1:5gjG60RRoxAGPXAL7ECCwy9/mfFbFlSWgnf7+rrgUYI=
416+
github.com/rubrikinc/rubrik-polaris-sdk-for-go v0.10.0-beta.8/go.mod h1:670TFQkxTdbsBwEwR/fDT75hfHwPDTTOiLnyZerbqQk=
417417
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
418418
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
419419
github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4=

internal/provider/data_source_aws_cnp_permissions.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ import (
3333
"github.com/rubrikinc/rubrik-polaris-sdk-for-go/pkg/polaris/graphql/core"
3434
)
3535

36-
// dataSourceAwsPermissions defines the schema for the AWS permissions data
37-
// source.
36+
// This data source uses a template for its documentation due to a bug in the TF
37+
// docs generator. Remember to update the template if the documentation for any
38+
// fields are changed.
3839
func dataSourceAwsPermissions() *schema.Resource {
3940
return &schema.Resource{
4041
ReadContext: awsPermissionsRead,
@@ -99,9 +100,6 @@ func dataSourceAwsPermissions() *schema.Resource {
99100
}
100101
}
101102

102-
// awsPermissionsRead run the Read operation for the AWS permissions data
103-
// source. Returns all AWS permissions needed of for the specified cloud and
104-
// feature set.
105103
func awsPermissionsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
106104
log.Print("[TRACE] awsPermissionsRead")
107105

0 commit comments

Comments
 (0)