Skip to content

Commit

Permalink
Add support for kms_key_id in AWS Secrets Manager and Parameter Store…
Browse files Browse the repository at this point in the history
… syncs
  • Loading branch information
nmanoogian committed Jul 3, 2024
1 parent 113ed3c commit 29e3059
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions doppler/resource_sync_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ func resourceSyncAWSSecretsManager() *schema.Resource {
Required: true,
ForceNew: true,
},
"kms_key_id": {
Description: "The AWS KMS key used to encrypt the secret",
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"tags": {
Description: "AWS tags to attach to the secrets",
Type: schema.TypeMap,
Expand All @@ -31,11 +37,16 @@ func resourceSyncAWSSecretsManager() *schema.Resource {
},
},
DataBuilder: func(d *schema.ResourceData) IntegrationData {
return map[string]interface{}{
payload := map[string]interface{}{
"region": d.Get("region"),
"path": d.Get("path"),
"tags": d.Get("tags"),
}
kmsKeyId := d.Get("kms_key_id")
if kmsKeyId != "" {
payload["kms_key_id"] = kmsKeyId
}
return payload
},
}
return builder.Build()
Expand Down Expand Up @@ -63,6 +74,12 @@ func resourceSyncAWSParameterStore() *schema.Resource {
ForceNew: true,
Default: true,
},
"kms_key_id": {
Description: "The AWS KMS key used to encrypt the secret",
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"tags": {
Description: "AWS tags to attach to the parameters",
Type: schema.TypeMap,
Expand All @@ -74,12 +91,17 @@ func resourceSyncAWSParameterStore() *schema.Resource {
},
},
DataBuilder: func(d *schema.ResourceData) IntegrationData {
return map[string]interface{}{
payload := map[string]interface{}{
"region": d.Get("region"),
"path": d.Get("path"),
"secure_string": d.Get("secure_string"),
"tags": d.Get("tags"),
}
kmsKeyId := d.Get("kms_key_id")
if kmsKeyId != "" {
payload["kms_key_id"] = kmsKeyId
}
return payload
},
}
return builder.Build()
Expand Down

0 comments on commit 29e3059

Please sign in to comment.