From 8aed67149628ea44482ba1713db11f484ede77ed Mon Sep 17 00:00:00 2001 From: SquareShark Date: Sat, 2 Dec 2023 20:01:49 +0000 Subject: [PATCH 1/2] Updating role mapping name field to update or delete role mappings when this field is updated --- CHANGELOG.md | 4 ++-- internal/elasticsearch/security/role_mapping.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48021b120..77d316fd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,13 @@ - Switch to Terraform [protocol version 6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) that is compatible with Terraform CLI version 1.0 and later. - Add 'elasticstack_fleet_package' data source ([#469](https://github.com/elastic/terraform-provider-elasticstack/pull/469)) - Add `tags` option to Kibana's SLOs ([#495](https://github.com/elastic/terraform-provider-elasticstack/pull/495)) -- Add support for Authorization header - Bearer Token and ES-Client-Authentication fields added.([#500]()https://github.com/elastic/terraform-provider-elasticstack/pull/500) - +- Add support for Authorization header - Bearer Token and ES-Client-Authentication fields added.([#500](https://github.com/elastic/terraform-provider-elasticstack/pull/500)) ### Fixed - Rename fleet package objects to `elasticstack_fleet_integration` and `elasticstack_fleet_integration_policy` ([#476](https://github.com/elastic/terraform-provider-elasticstack/pull/476)) - Fix a provider crash when managing SLOs outside of the default Kibana space. ([#485](https://github.com/elastic/terraform-provider-elasticstack/pull/485)) - Make input optional for `elasticstack_fleet_integration_policy` ([#493](https://github.com/elastic/terraform-provider-elasticstack/pull/493)) - Sort Fleet integration policy inputs to ensure consistency ([#494](https://github.com/elastic/terraform-provider-elasticstack/pull/494)) +- Updated Elasticsearch role_mapping.go to enforce the replacement/updates of role mapping resources when the name field is altered. ([#501]()https://github.com/elastic/terraform-provider-elasticstack/pull/501) ## [0.10.0] - 2023-11-02 diff --git a/internal/elasticsearch/security/role_mapping.go b/internal/elasticsearch/security/role_mapping.go index 811b61c85..fa1f7c780 100644 --- a/internal/elasticsearch/security/role_mapping.go +++ b/internal/elasticsearch/security/role_mapping.go @@ -25,6 +25,7 @@ func ResourceRoleMapping() *schema.Resource { Type: schema.TypeString, Required: true, Description: "The distinct name that identifies the role mapping, used solely as an identifier.", + ForceNew: true, }, "enabled": { Type: schema.TypeBool, From 3a2f64e6f2912e4cda9e04361952c35b32c8f41f Mon Sep 17 00:00:00 2001 From: SquareShark Date: Sat, 2 Dec 2023 20:06:42 +0000 Subject: [PATCH 2/2] Fixing Change log sorry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77d316fd4..8e809e4be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ - Fix a provider crash when managing SLOs outside of the default Kibana space. ([#485](https://github.com/elastic/terraform-provider-elasticstack/pull/485)) - Make input optional for `elasticstack_fleet_integration_policy` ([#493](https://github.com/elastic/terraform-provider-elasticstack/pull/493)) - Sort Fleet integration policy inputs to ensure consistency ([#494](https://github.com/elastic/terraform-provider-elasticstack/pull/494)) -- Updated Elasticsearch role_mapping.go to enforce the replacement/updates of role mapping resources when the name field is altered. ([#501]()https://github.com/elastic/terraform-provider-elasticstack/pull/501) +- Updated Elasticsearch role_mapping.go to enforce the replacement/updates of role mapping resources when the name field is altered. ([#503](https://github.com/elastic/terraform-provider-elasticstack/pull/503)) ## [0.10.0] - 2023-11-02