|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "netapp-ontap_s3_user Resource - terraform-provider-netapp-ontap" |
| 4 | +subcategory: "Object-store" |
| 5 | +description: |- |
| 6 | + S3 User resource |
| 7 | +--- |
| 8 | + |
| 9 | +# Resource S3 User |
| 10 | + |
| 11 | +Create, delete, or modify S3 user |
| 12 | + |
| 13 | +## Related ONTAP commands |
| 14 | + |
| 15 | +```commandline |
| 16 | +* vserver object-store-server user create |
| 17 | +* vserver object-store-server user regenerate-keys |
| 18 | +* vserver object-store-server user delete-keys |
| 19 | +* vserver object-store-server user delete |
| 20 | +``` |
| 21 | + |
| 22 | +## Supported Platforms |
| 23 | + |
| 24 | +* On-prem ONTAP system 9.7 or higher |
| 25 | +* Amazon FSx for NetApp ONTAP |
| 26 | + |
| 27 | +## Example Usage |
| 28 | + |
| 29 | +```terraform |
| 30 | +# creating a S3 user configuration with user keys specified |
| 31 | +resource "netapp-ontap_s3_user" "example1" { |
| 32 | + cx_profile_name = "hw-cluster" |
| 33 | + name = "test_s3_user" |
| 34 | + svm_name = "svm1" |
| 35 | + comment = "test user" |
| 36 | + access_key = "<AWS-ACCESS-KEY-ID>" |
| 37 | + secret_key = "<AWS-SECRET-ACCESS-KEY>" |
| 38 | +} |
| 39 | +
|
| 40 | +# regenerating keys and setting new expiry configuration for a specific S3 user |
| 41 | +resource "netapp-ontap_s3_user" "example2" { |
| 42 | + cx_profile_name = "hw-cluster" |
| 43 | + name = "test_s3_user" |
| 44 | + svm_name = "svm1" |
| 45 | + comment = "test s3 user" |
| 46 | + regenerate_keys = true |
| 47 | + key_time_to_live = "PT2M" |
| 48 | +} |
| 49 | +
|
| 50 | +# deleting keys for a specific S3 user |
| 51 | +resource "netapp-ontap_s3_user" "example3" { |
| 52 | + cx_profile_name = "hw-cluster" |
| 53 | + name = "test_s3_user" |
| 54 | + svm_name = "svm1" |
| 55 | + comment = "test s3 user" |
| 56 | + delete_keys = true |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +<!-- schema generated by tfplugindocs --> |
| 61 | +## Schema |
| 62 | + |
| 63 | +### Required |
| 64 | + |
| 65 | +- `cx_profile_name` (String) Connection profile name |
| 66 | +- `name` (String) Specifies the name of the user. |
| 67 | +- `svm_name` (String) The name of the SVM. |
| 68 | + |
| 69 | +### Optional |
| 70 | + |
| 71 | +> **NOTE**: [Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments) are supported in Terraform 1.11 and later. |
| 72 | +
|
| 73 | +- `access_key` (String, Sensitive) Specifies the access key for the user. |
| 74 | +- `comment` (String) Additional information about the user. |
| 75 | +- `delete_keys` (Boolean, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Specifies if secret_key and access_key need to be deleted. |
| 76 | +- `key_time_to_live` (String) Indicates the time period from when this parameter is specified: |
| 77 | + when creating or modifying a user or when the user keys were last regenerated, after which the user keys expire and are no longer valid. |
| 78 | + Valid format is: 'PnDTnHnMnS|PnW'. For example, P2DT6H3M10S specifies a time period of 2 days, 6 hours, 3 minutes, and 10 seconds. |
| 79 | + If the value specified is '0' seconds, then the keys won't expire. |
| 80 | + It can be used during user creation (POST) and during keys regeneration (PATCH with regenerate_keys). |
| 81 | +- `regenerate_keys` (Boolean, [Write-only](https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments)) Specifies if secret_key and access_key need to be regenerated. |
| 82 | + **Note:** This resource is not idempotent when this option is set. |
| 83 | +- `secret_key` (String, Sensitive) Specifies the secret key for the user. |
| 84 | + |
| 85 | +### Read-Only |
| 86 | + |
| 87 | +- `id` (Number) The UUID of the S3 user. |
| 88 | +- `key_expiry_time` (String) The date and time after which keys expire and are no longer valid. |
| 89 | + |
| 90 | +## Import |
| 91 | + |
| 92 | +This resource supports import, which allows you to import existing S3 user into the state of this resource. |
| 93 | +Import require a unique ID composed of the S3 user name, svm name and connection profile, separated by a comma. |
| 94 | + |
| 95 | +id = `name`,`svm_name`,`cx_profile_name` |
| 96 | + |
| 97 | +### Terraform Import |
| 98 | + |
| 99 | +For example |
| 100 | + |
| 101 | +```shell |
| 102 | + terraform import netapp-ontap_s3_user.example test_s3_user,svm1,cluster5 |
| 103 | +``` |
| 104 | + |
| 105 | +!> The terraform import CLI command can only import resources into the state. Importing via the CLI does not generate configuration. If you want to generate the accompanying configuration for imported resources, use the import block instead. |
| 106 | + |
| 107 | +### Terraform Import Block |
| 108 | + |
| 109 | +This requires Terraform 1.5 or higher, and will auto create the configuration for you |
| 110 | + |
| 111 | +First create the block |
| 112 | + |
| 113 | +```terraform |
| 114 | +import { |
| 115 | + to = netapp-ontap_s3_user.s3_user_import |
| 116 | + id = "test_s3_user,svm1,cluster5" |
| 117 | +} |
| 118 | +``` |
| 119 | + |
| 120 | +Next run, this will auto create the configuration for you |
| 121 | + |
| 122 | +```shell |
| 123 | +terraform plan -generate-config-out=generated.tf |
| 124 | +``` |
| 125 | + |
| 126 | +This will generate a file called generated.tf, which will contain the configuration for the imported resource |
| 127 | + |
| 128 | +```terraform |
| 129 | +# __generated__ by Terraform |
| 130 | +# Please review these resources and move them into your main configuration files. |
| 131 | +# __generated__ by Terraform from "test_s3_user_,svm1,cluster5" |
| 132 | +resource "netapp-ontap_s3_user" "s3_user_import" { |
| 133 | + cx_profile_name = "cluster5" |
| 134 | + name = "test_s3_user" |
| 135 | + svm_name = "svm1" |
| 136 | +} |
| 137 | +``` |
0 commit comments