opensearch-project / terraform-provider-opensearch

https://registry.terraform.io/providers/opensearch-project/opensearch
Apache License 2.0
73 stars 56 forks source link

Add support for Snapshot Management #125

Closed duboisph closed 8 months ago

duboisph commented 9 months ago

Description

Added support for Snapshot Management policies, largely based off the ISM code, but with a slightly different API.

An important difference is that a policy's Name is not the same as it's ID (<policy_name> + -sm-policy suffix), however the name is used for API requests. Within the provider code, I opted to use the policy ID for the TF state's id, but everything else uses the policy_name (resource definition, import, api requests).

Also this API uses POST for create and PUT to update, using the same body data. Responses for GET, POST and UPDATE are all the same.

Issues Resolved

Closes #70.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

duboisph commented 8 months ago

Hi @prudhvigodithi, do you have an idea when someone could review this please?

prudhvigodithi commented 8 months ago

Hey @duboisph thanks for the contribution, lets ship this soon, while I review, can you please fix the unit tests, you should run terrafmt.

duboisph commented 8 months ago

@prudhvigodithi Thank you! Meanwhile the terrafmt should be fixed.

prudhvigodithi commented 8 months ago

On quick thought, @duboisph do you think we should tell customer to pre-create the repo before create/update the policy ? this way its aware that this feature would tackle the SM policies, not configuring the snapshot repositories. Thank you

duboisph commented 8 months ago

Hi @prudhvigodithi. Indeed, good point. I've pushed an udpdate to the example. Would this be clear enough?

prudhvigodithi commented 8 months ago

Thanks @duboisph, LGTM, approved the PR, please take care of my above 2 comments.

duboisph commented 8 months ago

Thank you @prudhvigodithi! I've resolved your comments :)

prudhvigodithi commented 8 months ago

LGTM, I will merge the PR. Thanks again for your contribution @duboisph.

msvticket commented 8 months ago

@prudhvigodithi When will this be released?

prudhvigodithi commented 7 months ago

Hey @msvticket, thanks for following up I will do a quick short release today to get this feature out. Thanks

prudhvigodithi commented 7 months ago

This feature should be now in the v2.2.0 https://registry.terraform.io/providers/opensearch-project/opensearch/2.2.0, please check, thanks @duboisph for you contribution.