658 - enhancement - netapp-ontap_s3_bucket#669
Conversation
| "cors_rules": schema.SetNestedAttribute{ | ||
| MarkdownDescription: "The list of object store bucket CORS rules. Requires ONTAP 9.16.1 or later.", | ||
| Optional: true, | ||
| Computed: true, |
There was a problem hiding this comment.
I don't see this is required on 9.16.1 from https://docs.netapp.com/us-en/ontap-restapi/swagger-ui/index.html#/Object-Store/s3_bucket_create. Can you share the document link here?
| setplanmodifier.UseStateForUnknown(), | ||
| }, | ||
| Validators: []validator.Set{ | ||
| setvalidator.SizeAtLeast(1), |
There was a problem hiding this comment.
It's optional but why it has to be at least one?
There was a problem hiding this comment.
Because empty list is not a valid value for expose_headers parameter.
If we set below:
"cors": {
"rules": [
{
"max_age_seconds": 1,
"allowed_origins": [ "*" ],
"allowed_methods": [ "GET", "POST", "PUT", "DELETE" ],
"expose_headers": []
}
]
}
REST doesn't return any value for expose_headers:
So, I have added a condition to have at least one element if mentioned in config, for the better management of state and idempotency.
| Requires ONTAP 9.10.1 or later. (see [below for nested schema](#nestedatt--audit_event_selector)) | ||
| - `comment` (String) Additional information about the bucket. | ||
| - `constituents_per_aggregate` (Number) Number of constituents per aggregate. This option is not supported when type is set to NAS. | ||
| - `cors_rules` (Attributes Set) The list of object store bucket CORS rules. Requires ONTAP 9.16.1 or later. (see [below for nested schema](#nestedatt--cors_rules)) |
There was a problem hiding this comment.
The doc, https://docs.netapp.com/us-en/ontap-cli/vserver-create.html
mentions the versions as 9.x.1.
Currently Ansible ontap modules handles version constraints as 9.x.1 instead of 9.x!
Should we incorporate the same in terraform repo too?
Let me update the doc to mention this as 9.16 for now.
chuyich
left a comment
There was a problem hiding this comment.
- The versions are not consistent in the code and doc.
- expose header: optional vs at least one
- can you share the test case? removal/update-to-empty case
I've added more test cases in |

Issue #658
cors_rules, requires ONTAP 9.16 or later.ACC test result: