opensearch-project / terraform-provider-opensearch

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

Add import for index mappings #145

Closed rblcoder closed 7 months ago

rblcoder commented 7 months ago

Description

Implement import of index mappings

Issues Resolved

135 #71

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.

rblcoder commented 7 months ago

Hi @prudhvigodithi , please review this PR.

prudhvigodithi commented 7 months ago

Hey @rblcoder thanks for your contribution, one question I have is since this logic is added to the resourceOpensearchIndexRead function is behaviour to 1st read the existing mapping and continue them with next terraform apply operations ? When I import the mappings which will be stored in StateContext with this code change in resourceOpensearchIndexRead does it read the imported mappings and continue with terraform apply operation?

Thank you

rblcoder commented 7 months ago

@prudhvigodithi The read function is now able to read the mappings attribute from the underlying infrastructure. I have tested by removing the resource from state. Then imported it using the import command. The state file is getting updated successfully with the mappings information. Post this, I am able to run and continue with apply.

prudhvigodithi commented 7 months ago

Thanks @rblcoder, LGTM. @bbarani @peterzhuamazon @phillbaker

xsnrg commented 6 months ago

@rblcoder Thank you. @prudhvigodithi any chance of getting a new release created with this fix?