From b512f51629b2395d3ae421fe1f89dbf04c3fe4e5 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Tue, 8 Aug 2023 18:50:20 -0400 Subject: [PATCH 1/5] Sync bitbucket and GitHub --- CHANGELOG.md | 4 ++ cloudmanager/cvo_gcp.go | 6 +++ .../resource_netapp_cloudmanager_cvo_gcp.go | 49 ++++++++++++++++++- website/docs/r/cvo_gcp.html.markdown | 8 ++- 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d31790c..a6d31fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 23.8.0 +NEW FEATURES: +* resource/cvo_gcp: asupport adding `firewall_tag_name_rule` and `firewall_ip_ranges`. + ## 23.7.0 NEW FEATURES: * resource/connector_gcp: support adding gcp keys `gcp_block_project_ssh_keys`, `gcp_serial_port_enable`, `gcp_enable_os_login` and `gcp_enable_os_login_sk` to the config. diff --git a/cloudmanager/cvo_gcp.go b/cloudmanager/cvo_gcp.go index 40e7d20..4cd0ab0 100644 --- a/cloudmanager/cvo_gcp.go +++ b/cloudmanager/cvo_gcp.go @@ -40,6 +40,8 @@ type createCVOGCPDetails struct { GCPLabels []gcpLabels `structs:"gcpLabels,omitempty"` GcpEncryptionParameters gcpEncryptionParameters `structs:"gcpEncryptionParameters,omitempty"` FirewallRule string `structs:"firewallRule,omitempty"` + FirewallTagNameRule string `structs:"firewallTagNameRule,omitempty"` + FirewallIPRanges bool `structs:"firewallIpRanges"` BackupVolumesToCbs bool `structs:"backupVolumesToCbs"` EnableCompliance bool `structs:"enableCompliance"` IsHA bool @@ -83,6 +85,10 @@ type haParamsGCP struct { VPC1FirewallRuleName string `structs:"vpc1FirewallRuleName,omitempty"` VPC2FirewallRuleName string `structs:"vpc2FirewallRuleName,omitempty"` VPC3FirewallRuleName string `structs:"vpc3FirewallRuleName,omitempty"` + VPC0FirewallRuleTagName string `structs:"vpc0FirewallRuleTagName,omitempty"` + VPC1FirewallRuleTagName string `structs:"vpc1FirewallRuleTagName,omitempty"` + VPC2FirewallRuleTagName string `structs:"vpc2FirewallRuleTagName,omitempty"` + VPC3FirewallRuleTagName string `structs:"vpc3FirewallRuleTagName,omitempty"` } func (c *Client) createCVOGCP(cvoDetails createCVOGCPDetails, clientID string) (cvoResult, error) { diff --git a/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go b/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go index b9af55f..4247524 100644 --- a/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go +++ b/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go @@ -199,6 +199,16 @@ func resourceCVOGCP() *schema.Resource { Optional: true, ForceNew: true, }, + "firewall_tag_name_rule": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "firewall_ip_ranges": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + }, "serial_number": { Type: schema.TypeString, Optional: true, @@ -305,6 +315,26 @@ func resourceCVOGCP() *schema.Resource { Optional: true, ForceNew: true, }, + "vpc0_firewall_rule_tag_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "vpc1_firewall_rule_tag_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "vpc2_firewall_rule_tag_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "vpc3_firewall_rule_ntag_ame": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, "client_id": { Type: schema.TypeString, Required: true, @@ -435,7 +465,12 @@ func resourceCVOGCPCreate(d *schema.ResourceData, meta interface{}) error { if c, ok := d.GetOk("firewall_rule"); ok { cvoDetails.FirewallRule = c.(string) } - + if c, ok := d.GetOk("firewall_tag_name_rule"); ok { + cvoDetails.FirewallTagNameRule = c.(string) + } + if c, ok := d.GetOk("firewall_ip_ranges"); ok { + cvoDetails.FirewallIPRanges = c.(bool) + } if c, ok := d.GetOk("writing_speed_state"); ok { cvoDetails.WritingSpeedState = strings.ToUpper(c.(string)) } @@ -552,6 +587,18 @@ func resourceCVOGCPCreate(d *schema.ResourceData, meta interface{}) error { if c, ok := d.GetOk("vpc3_firewall_rule_name"); ok { cvoDetails.HAParams.VPC3FirewallRuleName = c.(string) } + if c, ok := d.GetOk("vpc0_firewall_rule_tag_name"); ok { + cvoDetails.HAParams.VPC0FirewallRuleTagName = c.(string) + } + if c, ok := d.GetOk("vpc1_firewall_rule_tag_name"); ok { + cvoDetails.HAParams.VPC1FirewallRuleTagName = c.(string) + } + if c, ok := d.GetOk("vpc2_firewall_rule_tag_name"); ok { + cvoDetails.HAParams.VPC2FirewallRuleTagName = c.(string) + } + if c, ok := d.GetOk("vpc3_firewall_rule_tag_name"); ok { + cvoDetails.HAParams.VPC3FirewallRuleTagName = c.(string) + } if c, ok := d.GetOk("svm"); ok { svms := c.(*schema.Set) svmList = expandGCPSVMs(svms) diff --git a/website/docs/r/cvo_gcp.html.markdown b/website/docs/r/cvo_gcp.html.markdown index b154704..2e19890 100644 --- a/website/docs/r/cvo_gcp.html.markdown +++ b/website/docs/r/cvo_gcp.html.markdown @@ -131,7 +131,9 @@ The following arguments are supported: * `nss_account` - (Optional) The NetApp Support Site account ID to use with this Cloud Volumes ONTAP system. If the license type is BYOL and an NSS account isn't provided, Cloud Manager tries to use the first existing NSS account. * `writing_speed_state` - (Optional) The write speed setting for Cloud Volumes ONTAP: ['NORMAL','HIGH']. The default is 'NORMAL'. For single node system, HIGH write speed is supported with all machine types. For HA, Flash Cache, high write speed, and a higher maximum transmission unit (MTU) of 8,896 bytes are available through the High write speed option with the n2-standard-16, n2-standard-32, n2-standard-48, and n2-standard-64 instance types. * `flash_cache` - (Optional) Enable Flash Cache. In GCP HA (version 9.13.0), HIGH write speed and FlashCache are coupled together both needs to be activated, one cannot be activated without the other. -* `firewall_rule` - (Optional) The name of the firewall rule for Cloud Volumes ONTAP. If not provided, Cloud Manager generates the rule. +* `firewall_rule` - (Optional) The name of the firewall rule for a single node cluster. If not provided, Cloud Manager generates the rule. +* `firewall_tag_name_rule` - (Optional) Target tag of the firewall when creating a CVO with an existing firewall. It is used for a single node cluster. +* `firewall_ip_ranges` - (Optional) Define the allowed inbound traffic for the generated policy. It is used when selecting create a new firewall. Recommanded set false: Allow traffice within the selected VPC only. Allow inbound traffic only from the cluster node VPCs. * `backup_volumes_to_cbs` - (Optional) Automatically enable back up of all volumes to Google Cloud buckets [true, false]. * `enable_compliance` - (Optional) Enable the Cloud Compliance service on the working environment [true, false]. * `is_ha` - (Optional) Indicate whether the working environment is an HA pair or not [true, false]. The default is false. @@ -152,6 +154,10 @@ The following arguments are supported: * `vpc1_firewall_rule_name` - (Optional) Firewall rule name for vpc2. * `vpc2_firewall_rule_name` - (Optional) Firewall rule name for vpc3. * `vpc3_firewall_rule_name` - (Optional) Firewall rule name for vpc4. +* `vpc0_firewall_rule_tag_name` - (Optional) Firewall rule tag name for vpc1. +* `vpc1_firewall_rule_tag_name` - (Optional) Firewall rule tag name for vpc2. +* `vpc2_firewall_rule_tag_name` - (Optional) Firewall rule tag name for vpc3. +* `vpc3_firewall_rule_tag_name` - (Optional) Firewall rule tag name for vpc4. * `upgrade_ontap_version` - (Optional) Indicates whether to upgrade ontap image with `ontap_version`. To upgrade ontap image, `ontap_version` cannot be 'latest' and `use_latest_version` needs to be false. * `retries` - (Optional) The number of attempts to wait for the completion of creating the CVO with 60 seconds apart for each attempt. For HA, this value is incremented by 30. The default is '60'. * `worm_retention_period_length` - (Optional) WORM retention period length. Once specified retention period, the WORM is enabled. When WORM storage is activated, data tiering to object storage can’t be enabled. From 575dd31e5355296e97b717a5afd261d80332cfcd Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Tue, 8 Aug 2023 19:01:52 -0400 Subject: [PATCH 2/5] Sync bitbucket and GitHub --- website/docs/r/cbs.html.markdown | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/docs/r/cbs.html.markdown b/website/docs/r/cbs.html.markdown index 23763ce..09089d6 100644 --- a/website/docs/r/cbs.html.markdown +++ b/website/docs/r/cbs.html.markdown @@ -152,4 +152,10 @@ The `rule` blocks support the followings: The `volumes` block suports the followings: * `volume_name` - (Required) Name of the volume to enable backup. * `mode` - (Optional) type of mode to create snapshot copies. -* `backup_policy` - (Optional) \ No newline at end of file +* `backup_policy` - (Optional) + +## Attributes Reference + +The following attributes are exported in addition to the arguments listed above: + +* `id` - The unique identifier for the cloud backup service. \ No newline at end of file From cdda4f661bc5860672313182df4427c189e754cf Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Wed, 9 Aug 2023 13:50:50 -0400 Subject: [PATCH 3/5] Sync bitbucket and GitHub --- CHANGELOG.md | 4 ++++ cloudmanager/resource_netapp_cloudmanager_cvo_aws.go | 1 - cloudmanager/resource_netapp_cloudmanager_cvo_azure.go | 1 - cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6d31fe..ae2e242 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ ## 23.8.0 + +ENHANCEMENTS: +* ressource/cvo_aws, cvo_azure, cvo_gcp: remove force new from `retries`. + NEW FEATURES: * resource/cvo_gcp: asupport adding `firewall_tag_name_rule` and `firewall_ip_ranges`. diff --git a/cloudmanager/resource_netapp_cloudmanager_cvo_aws.go b/cloudmanager/resource_netapp_cloudmanager_cvo_aws.go index 184dcbd..884e31e 100644 --- a/cloudmanager/resource_netapp_cloudmanager_cvo_aws.go +++ b/cloudmanager/resource_netapp_cloudmanager_cvo_aws.go @@ -349,7 +349,6 @@ func resourceCVOAWS() *schema.Resource { "retries": { Type: schema.TypeInt, Optional: true, - ForceNew: true, Default: 60, }, }, diff --git a/cloudmanager/resource_netapp_cloudmanager_cvo_azure.go b/cloudmanager/resource_netapp_cloudmanager_cvo_azure.go index 8bd4735..b851f97 100644 --- a/cloudmanager/resource_netapp_cloudmanager_cvo_azure.go +++ b/cloudmanager/resource_netapp_cloudmanager_cvo_azure.go @@ -304,7 +304,6 @@ func resourceCVOAzure() *schema.Resource { "retries": { Type: schema.TypeInt, Optional: true, - ForceNew: true, Default: 60, }, }, diff --git a/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go b/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go index 4247524..f2dfe5f 100644 --- a/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go +++ b/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go @@ -360,7 +360,6 @@ func resourceCVOGCP() *schema.Resource { "retries": { Type: schema.TypeInt, Optional: true, - ForceNew: true, Default: 60, }, }, From 7f518b514b543f77b8fbfe4948a8fd75e48e77a7 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Wed, 9 Aug 2023 14:00:22 -0400 Subject: [PATCH 4/5] Sync bitbucket and GitHub --- CHANGELOG.md | 6 +++--- cloudmanager/cvo_aws.go | 3 ++- cloudmanager/cvo_azure.go | 2 +- cloudmanager/cvo_gcp.go | 1 + cloudmanager/resource_netapp_cloudmanager_cvo_aws.go | 10 ++++++++++ cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go | 8 ++++++++ website/docs/r/cvo_aws.html.markdown | 2 ++ website/docs/r/cvo_azure.html.markdown | 1 + website/docs/r/cvo_gcp.html.markdown | 1 + 9 files changed, 29 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae2e242..e244b00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ ## 23.8.0 - -ENHANCEMENTS: +NEW ENHANCEMENTS: * ressource/cvo_aws, cvo_azure, cvo_gcp: remove force new from `retries`. +* resource/cvo_aws and cvo_gcp: add `saas_subscription_id`. NEW FEATURES: -* resource/cvo_gcp: asupport adding `firewall_tag_name_rule` and `firewall_ip_ranges`. +* resource/cvo_gcp: support adding `firewall_tag_name_rule` and `firewall_ip_ranges`. ## 23.7.0 NEW FEATURES: diff --git a/cloudmanager/cvo_aws.go b/cloudmanager/cvo_aws.go index 559c47e..64eddb7 100644 --- a/cloudmanager/cvo_aws.go +++ b/cloudmanager/cvo_aws.go @@ -30,6 +30,7 @@ type createCVOAWSDetails struct { CapacityTier string `structs:"capacityTier,omitempty"` TierLevel string `structs:"tierLevel,omitempty"` NssAccount string `structs:"nssAccount,omitempty"` + SaasSubscriptionID string `structs:"saasSubscriptionId,omitempty"` WritingSpeedState string `structs:"writingSpeedState,omitempty"` ClusterKeyPairName string `structs:"clusterKeyPairName,omitempty"` IOPS int `structs:"iops,omitempty"` @@ -263,7 +264,7 @@ func (c *Client) createCVOAWS(cvoDetails createCVOAWSDetails, clientID string) ( hostType := "CloudManagerHost" params := structs.Map(cvoDetails) - + log.Printf("Create AWS CVO: %#v\n", params) statusCode, response, onCloudRequestID, err := c.CallAPIMethod("POST", baseURL, params, c.Token, hostType, clientID) if err != nil { log.Print("createCVO request failed ", statusCode) diff --git a/cloudmanager/cvo_azure.go b/cloudmanager/cvo_azure.go index 0fa06c3..866e1b2 100644 --- a/cloudmanager/cvo_azure.go +++ b/cloudmanager/cvo_azure.go @@ -233,7 +233,7 @@ func (c *Client) createCVOAzure(cvoDetails createCVOAzureDetails, clientID strin hostType := "CloudManagerHost" params := structs.Map(cvoDetails) - + log.Printf("Create AZURE CVO: %#v\n", params) statusCode, response, onCloudRequestID, err := c.CallAPIMethod("POST", baseURL, params, c.Token, hostType, clientID) if err != nil { log.Print("createCVO request failed ", statusCode) diff --git a/cloudmanager/cvo_gcp.go b/cloudmanager/cvo_gcp.go index 4cd0ab0..2ed9a09 100644 --- a/cloudmanager/cvo_gcp.go +++ b/cloudmanager/cvo_gcp.go @@ -33,6 +33,7 @@ type createCVOGCPDetails struct { Project string `structs:"project"` CapacityTier string `structs:"capacityTier,omitempty"` TierLevel string `structs:"tierLevel,omitempty"` + SaasSubscriptionID string `structs:"saasSubscriptionId,omitempty"` NssAccount string `structs:"nssAccount,omitempty"` WormRequest wormRequest `structs:"wormRequest,omitempty"` WritingSpeedState string `structs:"writingSpeedState,omitempty"` diff --git a/cloudmanager/resource_netapp_cloudmanager_cvo_aws.go b/cloudmanager/resource_netapp_cloudmanager_cvo_aws.go index 884e31e..fae9d93 100644 --- a/cloudmanager/resource_netapp_cloudmanager_cvo_aws.go +++ b/cloudmanager/resource_netapp_cloudmanager_cvo_aws.go @@ -134,6 +134,11 @@ func resourceCVOAWS() *schema.Resource { Optional: true, ForceNew: true, }, + "saas_subscription_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, "worm_retention_period_length": { Type: schema.TypeInt, Optional: true, @@ -400,6 +405,11 @@ func resourceCVOAWSCreate(d *schema.ResourceData, meta interface{}) error { cvoDetails.AwsTags = expandUserTags(tags) } } + + if c, ok := d.GetOk("saas_subscription_id"); ok { + cvoDetails.SaasSubscriptionID = c.(string) + } + cvoDetails.EbsVolumeSize.Size = d.Get("ebs_volume_size").(int) cvoDetails.EbsVolumeSize.Unit = d.Get("ebs_volume_size_unit").(string) cvoDetails.VsaMetadata.OntapVersion = d.Get("ontap_version").(string) diff --git a/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go b/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go index f2dfe5f..92b323b 100644 --- a/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go +++ b/cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go @@ -147,6 +147,11 @@ func resourceCVOGCP() *schema.Resource { Optional: true, ValidateFunc: validation.StringInSlice([]string{"standard", "nearline", "coldline"}, false), }, + "saas_subscription_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, "worm_retention_period_length": { Type: schema.TypeInt, Optional: true, @@ -393,6 +398,9 @@ func resourceCVOGCPCreate(d *schema.ResourceData, meta interface{}) error { if c, ok := d.GetOk("tier_level"); ok { cvoDetails.TierLevel = c.(string) } + if c, ok := d.GetOk("saas_subscription_id"); ok { + cvoDetails.SaasSubscriptionID = c.(string) + } cvoDetails.GCPVolumeSize.Size = d.Get("gcp_volume_size").(int) cvoDetails.GCPVolumeSize.Unit = d.Get("gcp_volume_size_unit").(string) cvoDetails.VsaMetadata.OntapVersion = d.Get("ontap_version").(string) diff --git a/website/docs/r/cvo_aws.html.markdown b/website/docs/r/cvo_aws.html.markdown index 4fc1883..3addf92 100644 --- a/website/docs/r/cvo_aws.html.markdown +++ b/website/docs/r/cvo_aws.html.markdown @@ -125,6 +125,7 @@ The following arguments are supported: * `platform_serial_number` - (Optional) The serial number for the cluster. This is required when 'license_type' is set 'cot-premium-byol'. * `capacity_tier` - (Optional) Whether to enable data tiering for the first data aggregate: ['S3','NONE']. The default is 'S3'. * `tier_level` - (Optional) The tiering level when 'capacity_tier' is set to 'S3' ['normal','ia','ia-single','intelligent']. The default is 'normal'. +* `saas_subscription_id` - (Optional) SaaS Subscription ID. It is needed if the subscription is not paygo type. * `nss_account` - (Optional) The NetApp Support Site account ID to use with this Cloud Volumes ONTAP system. If the license type is BYOL and an NSS account isn't provided, Cloud Manager tries to use the first existing NSS account. * `writing_speed_state` - (Optional) The write speed setting for Cloud Volumes ONTAP: ['NORMAL','HIGH']. The default is 'NORMAL'. This argument is not relevant for HA pairs. * `instance_tenancy` - (Optional) The EC2 instance tenancy: ['default','dedicated']. The default is 'default'. @@ -151,6 +152,7 @@ The following arguments are supported: * `route_table_ids` - (Optional) For HA FloatingIP, the list of route table IDs that will be updated with the floating IPs. * `upgrade_ontap_version` - (Optional) Indicates whether to upgrade ontap image with `ontap_version`. To upgrade ontap image, `ontap_version` cannot be 'latest' and `use_latest_version` needs to be false. * `mediator_security_group_id` - (Optional) For HA only, mediator security group id. +* `assume_role_arn` - (Optional) For HA only, Amazon Resource Name ARN of an AWS Identity and Access Managent IAM role that has created in the VPC owner account. For example, "arn:aws:iam::61239912384567:role/mediator_role_assume_fromdev" * `retries` - (Optional) The number of attempts to wait for the completion of creating the CVO with 60 seconds apart for each attempt. For HA, this value is incremented by 30. The default is '60'. * `worm_retention_period_length` - (Optional) WORM retention period length. Once specified retention period, the WORM is enabled. When WORM storage is activated, data tiering to object storage can’t be enabled. * `worm_retention_period_unit` - (Optional) WORM retention period unit: ['years','months','days','hours','minutes','seconds']. diff --git a/website/docs/r/cvo_azure.html.markdown b/website/docs/r/cvo_azure.html.markdown index 1ab3a2b..f0c15cf 100644 --- a/website/docs/r/cvo_azure.html.markdown +++ b/website/docs/r/cvo_azure.html.markdown @@ -144,6 +144,7 @@ The following arguments are supported: * `serial_number` - (Optional) The serial number for the cluster. Required when using one of these: ['azure-cot-premium-byol' or 'azure-ha-cot-premium-byol']. * `capacity_tier` - (Optional) Whether to enable data tiering for the first data aggregate: ['Blob', 'NONE']. The default is 'BLOB'. * `tier_level` - (Optional) If capacity_tier is Blob, this argument indicates the tiering level: ['normal', 'cool']. The default is: 'normal'. +* `saas_subscription_id` - (Optional) SaaS Subscription ID. It is needed if the subscription is not paygo type. * `nss_account` - (Optional) The NetApp Support Site account ID to use with this Cloud Volumes ONTAP system. If the license type is BYOL and an NSS account isn't provided, Cloud Manager tries to use the first existing NSS account. * `writing_speed_state` - (Optional) The write speed setting for Cloud Volumes ONTAP: ['NORMAL','HIGH']. The default is 'NORMAL'. This argument is not relevant for HA pairs. * `security_group_id` - (Optional) The name of the security group (full identifier: /subscriptions/xxxxxx/resourceGroups/rg_westus/providers/Microsoft.Network/networkSecurityGroups/CVO-SG). If not provided, Cloud Manager creates the security group. diff --git a/website/docs/r/cvo_gcp.html.markdown b/website/docs/r/cvo_gcp.html.markdown index 2e19890..d2a3c92 100644 --- a/website/docs/r/cvo_gcp.html.markdown +++ b/website/docs/r/cvo_gcp.html.markdown @@ -128,6 +128,7 @@ The following arguments are supported: * `serial_number` - (Optional) The serial number for the system. Required when using 'gcp-cot-premium-byol'. * `capacity_tier` - (Optional) Indicates the type of data tiering to use: ['cloudStorage']. The default is 'cloudStorage'. * `tier_level` - (Optional) In case capacity_tier is cloudStorage, this argument indicates the tiering level: ['standard', 'nearline', 'coldline']. The default is: 'standard'. +* `saas_subscription_id` - (Optional) SaaS Subscription ID. It is needed if the subscription is not paygo type. * `nss_account` - (Optional) The NetApp Support Site account ID to use with this Cloud Volumes ONTAP system. If the license type is BYOL and an NSS account isn't provided, Cloud Manager tries to use the first existing NSS account. * `writing_speed_state` - (Optional) The write speed setting for Cloud Volumes ONTAP: ['NORMAL','HIGH']. The default is 'NORMAL'. For single node system, HIGH write speed is supported with all machine types. For HA, Flash Cache, high write speed, and a higher maximum transmission unit (MTU) of 8,896 bytes are available through the High write speed option with the n2-standard-16, n2-standard-32, n2-standard-48, and n2-standard-64 instance types. * `flash_cache` - (Optional) Enable Flash Cache. In GCP HA (version 9.13.0), HIGH write speed and FlashCache are coupled together both needs to be activated, one cannot be activated without the other. From fed53f43077383d2f9fd2cabca1259ec846826b5 Mon Sep 17 00:00:00 2001 From: Chris Archibald Date: Wed, 9 Aug 2023 14:09:32 -0400 Subject: [PATCH 5/5] Sync bitbucket and GitHub --- CHANGELOG.md | 5 +- website/docs/r/volume.html.markdown | 154 ++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 website/docs/r/volume.html.markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index e244b00..5270e03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## 23.8.0 -NEW ENHANCEMENTS: +BUG FIXES: +* resource/volume: fix documentation name for volume and add an example for creating on_prem volume. * ressource/cvo_aws, cvo_azure, cvo_gcp: remove force new from `retries`. + +NEW ENHANCEMENTS: * resource/cvo_aws and cvo_gcp: add `saas_subscription_id`. NEW FEATURES: diff --git a/website/docs/r/volume.html.markdown b/website/docs/r/volume.html.markdown new file mode 100644 index 0000000..ffdcea8 --- /dev/null +++ b/website/docs/r/volume.html.markdown @@ -0,0 +1,154 @@ +--- +layout: "netapp_cloudmanager" +page_title: "NetApp_CloudManager: netapp_cloudmanager_volume" +sidebar_current: "docs-netapp-cloudmanager-resource-volume" +description: |- + Provides a netapp-cloudmanager_volume resource. This can be used to create, update, and delete volumes for Cloud Volumes ONTAP. +--- + +# netapp-cloudmanager_volume + +Provides a netapp-cloudmanager_volume resource. This can be used to create, update, and delete volumes for Cloud Volumes ONTAP. +Requires existence of a Cloud Manager Connector and a Cloud Volumes ONTAP system. +NFS, CIFS, and iSCSI volumes are supported. + +## Example Usages + +**Create netapp-cloudmanager_volume of type NFS:** + +``` +resource "netapp-cloudmanager_volume" "cvo-volume-nfs" { + depends_on = [netapp-cloudmanager_volume.cifs-volume-1] + provider = netapp-cloudmanager + volume_protocol = "nfs" + name = "vol1" + size = 10 + unit = "GB" + provider_volume_type = "pd-standard" + export_policy_type = "custom" + export_policy_ip = ["0.0.0.0/0"] + export_policy_nfs_version = ["nfs4"] + snapshot_policy_name = "sp1" + snapshot_policy { + schedule { + schedule_type = "5min" + retention = 10 + } + schedule { + schedule_type = "hourly" + retention = 5 + } + } + working_environment_id = netapp-cloudmanager_cvo_gcp.cvo-gcp.id + client_id = netapp-cloudmanager_connector_gcp.cm-gcp.client_id +} +``` + +**Create netapp-cloudmanager_volume of type CIFS:** + +``` +resource "netapp-cloudmanager_volume" "cvo-volume-cifs" { + depends_on = [netapp-cloudmanager_cifs_server.cvo-cifs-workgroup] + provider = netapp-cloudmanager + name = "cifs_vol2" + volume_protocol = "cifs" + provider_volume_type = "pd-ssd" + size = 10 + unit = "GB" + share_name = "share_cifs" + permission = "full_control" + users = ["Everyone"] + working_environment_id = netapp-cloudmanager_cvo_gcp.cvo-gcp.id + client_id = netapp-cloudmanager_connector_gcp.cm-gcp.client_id +} +``` + +**Create netapp-cloudmanager_volume of type ISCSI:** + +``` +resource "netapp-cloudmanager_volume" "cvo-volume-iscsi" { + provider = netapp-cloudmanager + name = "iscsi_test_vol" + volume_protocol = "iscsi" + size = 10 + unit = "GB" + igroups = ["test_igroup"] + initiator { + alias = "test_alias" + iqn = "test_iqn" + } + os_name = "linux" + working_environment_name = "cvo-name" + client_id = netapp-cloudmanager_connector_gcp.cm-gcp.client_id +} +``` + +**Create netapp-cloudmanager_volume on OnPrem:** + +``` +resource "netapp-cloudmanager_volume" "cvo-volume-onprem" { + provider = netapp-cloudmanager + name = "onprem_test_vol" + volume_protocol = "nfs" + provider_volume_type = "onprem" + size = 10 + unit = "GB" + export_policy_type = "custom" + export_policy_ip = ["0.0.0.0/0"] + svm_name = "test_onprem" + working_environment_name = "cvo-name" + client_id = netapp-cloudmanager_connector_gcp.cm-gcp.client_id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The name of the volume. +* `svm_name` - (Optional) The name of the SVM. The default SVM name is used, if a name isn't provided. +* `size` - (Required) The volume size, supported with decimal numbers. +* `size_unit` - (Required) ['Byte' or 'KB' or 'MB' or 'GB' or 'TB']. +* `provider_volume_type` - (Required) The underlying cloud provider volume type. For AWS: ['gp3', 'gp2', 'io1', 'st1', 'sc1'] (ebs_volume_type on AWS CVO). For Azure: ['Premium_LRS','Standard_LRS','StandardSSD_LRS', 'Premium_ZRS'] (storage_type on Azure CVO). For GCP: ['pd-balanced', 'pd-ssd','pd-standard'] (gcp_volume_type on GCP CVO). For onPrem: 'onprem'. +* `client_id` - (Required) The client ID of the Cloud Manager Connector. You can find the ID from a previous create Connector action as shown in the example, or from the Connector tab on [https://console.bluexp.netapp.com/](https://console.bluexp.netapp.com/). +* `enable_thin_provisioning` - (Optional) Enable thin provisioning. +* `enable_compression` - (Optional) Enable compression. +* `enable_deduplication` - (Optional) Enable deduplication. +* `aggregate_name ` - (Optional) The aggregate in which the volume will be created. If not provided, Cloud Manager chooses the best aggregate for you. For OnPrem, aggregate input is required. +* `volume_protocol` - (Optional) The protocol for the volume: ['nfs', 'cifs', 'iscsi']. This affects the provided parameters. The default is 'nfs' +* `working_environment_id` - (Optional) The public ID of the working environment where the volume will be created. The ID can be optional if working_environment_name is provided. You can find the ID from the previous create Cloud Volumes ONTAP action as shown in the example, or from the Information page of the Cloud Volumes ONTAP working environment on [https://console.bluexp.netapp.com/](https://console.bluexp.netapp.com/). +* `working_environment_name` - (Optional) The working environment name where the aggregate will be created. It will be ignored if working_environment_id is provided. +* `capacity_tier` - (Optional) The volume's capacity tier for tiering cold data to object storage: ['S3', 'Blob', 'cloudStorage']. The default values for each cloud provider are as follows: Amazon => 'S3', Azure => 'Blob', GCP => 'cloudStorage'. If none, the capacity tier won't be set on volume creation. +* `export_policy_name` - (Optional) The export policy name. (NFS protocol parameters) +* `export__policy_type` - (Optional) The export policy type. (NFS protocol parameters) +* `export_policy_ip` - (Optional) Custom export policy list of IPs. (NFS protocol parameters) +* `export_policy_nfs_version` - (Optional) Export policy protocol. (NFS protocol parameters) +* `snapshot_policy_name` - (Optional) Snapshot policy name. The default is 'default'. (NFS protocol parameters) +* `iops` - (Optional) Provisioned IOPS. Needed only when 'provider_volume_type' is 'io1' or 'gp3' +* `throughput` - (Optional) Required only when 'provider_volume_type' is 'gp3'. +* `share_name` (Optional) Share name. (CIFS protocol parameters) +* `permission` (Optional) CIFS share permission type. (CIFS protocol parameters) +* `users` (Optional) List of users with the permission. (CIFS protocol parameters) +* `igroups` (Optional) List of igroups. (iSCSI protocol parameters) +* `os_name` (Optional) Operating system. (iSCSI protocol parameters) +* `comment` - (Optional) Sets a comment associated with the volume +* `initiator` (Optional) Set of attributes of Initiator. (iSCSI protocol 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. + +The `initiator` block supports: +* `alias` (Required) Initiator alias. (iSCSI protocol parameters) +* `iqn` (Required) Initiator IQN. (iSCSI protocol parameters) + +The `snapshot_policy` block supports: +* `schedule` - (Required) The schedule configuration for creating snapshot policy. When `snapshot_policy_name` does not exist, the snapshot policy will be created with `schedule`(s) and named as `snapshot_policy_name`. It supports the volume creation based on the AWS, AZURE and GCP CVO. + +The `schedule` block supports: +* `schedule_type` - (Required) snapshot policy schedule type. Must be one of '5min', '8hour', 'hourly', 'daily', 'weekly', 'monthly'. +* `retention` - (Required) snapshot policy retention. + +## Attributes Reference + +The following attributes are exported in addition to the arguments listed above: + +* `id` - The name of the volume. +