Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to update AWS resource tags for SM and PS syncs #106

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

apazzolini
Copy link
Contributor

Dependent on https://github.com/DopplerHQ/server/pull/7004

@nmanoogian I did not test this locally - I'd appreciate it if you gave it a quick check 🙏

Copy link
Member

@nmanoogian nmanoogian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice -- This is just missing the payload updates:

diff --git a/doppler/resource_sync_types.go b/doppler/resource_sync_types.go
index 1a10934..2d7eed8 100644
--- a/doppler/resource_sync_types.go
+++ b/doppler/resource_sync_types.go
@@ -91,6 +91,9 @@ func resourceSyncAWSSecretsManager() *schema.Resource {
 			if updateMetadata, ok := d.GetOk("update_metadata"); ok {
 				payload["update_metadata"] = updateMetadata
 			}
+			if updateResourceTags, ok := d.GetOk("update_resource_tags"); ok {
+				payload["update_resource_tags"] = updateResourceTags
+			}
 			if pathBehavior, ok := d.GetOk("path_behavior"); ok {
 				payload["use_doppler_suffix"] = pathBehavior == "add_doppler_suffix"
 			} else {
@@ -166,6 +169,9 @@ func resourceSyncAWSParameterStore() *schema.Resource {
 			if kmsKeyId, ok := d.GetOk("kms_key_id"); ok {
 				payload["kms_key_id"] = kmsKeyId
 			}
+			if updateResourceTags, ok := d.GetOk("update_resource_tags"); ok {
+				payload["update_resource_tags"] = updateResourceTags
+			}
 			return payload
 		},
 	}

I tested locally with these changes and things are working as expected 👍

  • No changes are detected when migrating from existing TF provider version to this
  • never is the same as omitted
  • All three explicit configurations work as expected

@apazzolini
Copy link
Contributor Author

@nmanoogian Could you merge this and release the Terraform provider when you get a chance please?

@nmanoogian nmanoogian merged commit 220278b into master Nov 6, 2024
4 checks passed
@nmanoogian nmanoogian deleted the andre/aws-resource-tags branch November 6, 2024 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants