From 66f4271c7fe06f6ca48432ec3afeb238a55baf5a Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Fri, 9 Jun 2023 14:07:30 -0400 Subject: [PATCH] Sync bitbucket and GitHub --- CHANGELOG.md | 5 ++++- ...source_netapp_cloudmanager_aws_fsx_volume.go | 17 +++++++++++++++++ cloudmanager/volume.go | 2 ++ website/docs/r/aws_fsx_volume.html.markdown | 4 ++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4be2911..4f0f84d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ +## 23.6.0 +NEW FEATURES: +* resource/aws_fsx_volume: add new option`tags`. + ## 23.5.2 NEW ENHANCEMENTS: * resource/cvo_azure: add `saas_subscription_id`. * provider: add `connector_host` for restricted mode. - ## 23.5.1 NEW ENHANCEMENTS: * resoruce/cvo_aws: add `assume_role_arn` for AWS CVO HA. diff --git a/cloudmanager/resource_netapp_cloudmanager_aws_fsx_volume.go b/cloudmanager/resource_netapp_cloudmanager_aws_fsx_volume.go index 3ed9881..1ae3319 100644 --- a/cloudmanager/resource_netapp_cloudmanager_aws_fsx_volume.go +++ b/cloudmanager/resource_netapp_cloudmanager_aws_fsx_volume.go @@ -95,6 +95,13 @@ func resourceFsxVolume() *schema.Resource { Type: schema.TypeBool, Optional: true, }, + "tags": { + Type: schema.TypeMap, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "tenant_id": { Type: schema.TypeString, Required: true, @@ -126,6 +133,16 @@ func resourceFSXVolumeCreate(d *schema.ResourceData, meta interface{}) error { volume.EnableCompression = false volume.EnableThinProvisioning = true volume.EnableStorageEfficiency = d.Get("enable_storage_efficiency").(bool) + if o, ok := d.GetOk("tags"); ok { + tags := make([]volumeTag, 0) + for k, v := range o.(map[string]interface{}) { + tag := volumeTag{} + tag.TagKey = k + tag.TagValue = v.(string) + tags = append(tags, tag) + } + volume.VolumeFSXTags = tags + } err = client.setCommonAttributes(weInfo.WorkingEnvironmentType, d, &volume, clientID) if err != nil { return err diff --git a/cloudmanager/volume.go b/cloudmanager/volume.go index 05767aa..bb5b55e 100644 --- a/cloudmanager/volume.go +++ b/cloudmanager/volume.go @@ -40,6 +40,7 @@ type volumeRequest struct { TenantID string `structs:"tenantId,omitempty"` EnableStorageEfficiency bool `structs:"enableStorageEfficiency,omitempty"` VolumeTags []volumeTag `structs:"volumeTags,omitempty"` + VolumeFSXTags []volumeTag `structs:"awsTags,omitempty"` Comment string `structs:"comment,omitempty"` } @@ -148,6 +149,7 @@ type volumeTag struct { TagKey string `structs:"tagKey"` TagValue string `structs:"tagValue"` } + type createSnapshotPolicyRequest struct { SnapshotPolicyName string `structs:"snapshotPolicyName"` Schedules []scheduleReq `structs:"schedules"` diff --git a/website/docs/r/aws_fsx_volume.html.markdown b/website/docs/r/aws_fsx_volume.html.markdown index f361111..b4ee533 100644 --- a/website/docs/r/aws_fsx_volume.html.markdown +++ b/website/docs/r/aws_fsx_volume.html.markdown @@ -26,6 +26,9 @@ resource "netapp-cloudmanager_aws_fsx_volume" "fsx-volume-nfs" { export_policy_ip = ["0.0.0.0/0"] export_policy_nfs_version = ["nfs4"] file_system_id = "your-file-system-id" + tags = { + "abc" = "xyz" + } client_id = netapp-cloudmanager_connector_gcp.cm-gcp.client_id } ``` @@ -66,6 +69,7 @@ The following arguments are supported: * `permission` (Optional) CIFS share permission type. (CIFS protocol parameters) * `users` (Optional) List of users with the permission. (CIFS protocol parameters) * `volume_protocol` - (Required) The protocol for the volume: ['nfs', 'cifs']. This affects the provided parameters. +* `tags` - (Optional) Set tags for the volume during creation. The API doesn't contain any information about tags so the provider doesn't guarantee tags will be added successfully and detect any drift after create. * `tenant_id` - (Required) The workspace id.