Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSx ONTAP volume - ontap_volume_type shouldn't be computed #31544

Merged
Merged
3 changes: 3 additions & 0 deletions .changelog/29456.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_fsx_ontap_volume: `ontap_volume_type` shouldn't be computed
```
10 changes: 8 additions & 2 deletions internal/service/fsx/ontap_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ func ResourceOntapVolume() *schema.Resource {
ValidateFunc: validation.StringLenBetween(1, 203),
},
"ontap_volume_type": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,
Default: fsx.InputOntapVolumeTypeRw,
Optional: true,
ValidateFunc: validation.StringInSlice(fsx.InputOntapVolumeType_Values(), false),
},
"security_style": {
Type: schema.TypeString,
Expand Down Expand Up @@ -140,6 +142,10 @@ func resourceOntapVolumeCreate(ctx context.Context, d *schema.ResourceData, meta
Tags: GetTagsIn(ctx),
}

if v, ok := d.GetOk("ontap_volume_type"); ok {
input.OntapConfiguration.OntapVolumeType = aws.String(v.(string))
}

if v, ok := d.GetOk("security_style"); ok {
input.OntapConfiguration.SecurityStyle = aws.String(v.(string))
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/fsx_ontap_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ The following arguments are supported:

* `name` - (Required) The name of the Volume. You can use a maximum of 203 alphanumeric characters, plus the underscore (_) special character.
* `junction_path` - (Required) Specifies the location in the storage virtual machine's namespace where the volume is mounted. The junction_path must have a leading forward slash, such as `/vol3`
* `ontap_volume_type` - (Optional) Specifies the type of volume, valid values are `RW`, `DP`. Default value is `RW`. These can be set by the ONTAP CLI or API. This setting is used as part of migration and replication [Migrating to Amazon FSx for NetApp ONTAP](https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/migrating-fsx-ontap.html)
* `security_style` - (Optional) Specifies the volume security style, Valid values are `UNIX`, `NTFS`, and `MIXED`. Default value is `UNIX`.
* `size_in_megabytes` - (Required) Specifies the size of the volume, in megabytes (MB), that you are creating.
* `storage_efficiency_enabled` - (Required) Set to true to enable deduplication, compression, and compaction storage efficiency features on the volume.
Expand All @@ -71,7 +72,6 @@ In addition to all arguments above, the following attributes are exported:
* `id` - Identifier of the volume, e.g., `fsvol-12345678`
* `file_system_id` - Describes the file system for the volume, e.g. `fs-12345679`
* `flexcache_endpoint_type` - Specifies the FlexCache endpoint type of the volume, Valid values are `NONE`, `ORIGIN`, `CACHE`. Default value is `NONE`. These can be set by the ONTAP CLI or API and are use with FlexCache feature.
* `ontap_volume_type` - Specifies the type of volume, Valid values are `RW`, `DP`, and `LS`. Default value is `RW`. These can be set by the ONTAP CLI or API. This setting is used as part of migration and replication [Migrating to Amazon FSx for NetApp ONTAP](https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/migrating-fsx-ontap.html)
* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block).
* `uuid` - The Volume's UUID (universally unique identifier).
* `volume_type` - The type of volume, currently the only valid value is `ONTAP`.
Expand Down