-
Notifications
You must be signed in to change notification settings - Fork 79
Conversation
nice!!! |
This commit adds the json_arguments parameter to the rabbitmq_queue resource. This can accept a JSON string which is useful for argument values which are not strings.
ff9366d
to
f78b0cd
Compare
rabbitmq/resource_queue.go
Outdated
@@ -75,6 +84,19 @@ func CreateQueue(d *schema.ResourceData, meta interface{}) error { | |||
return fmt.Errorf("Unable to parse settings") | |||
} | |||
|
|||
// If json_arguments is used, unmarshal it into a generic interface | |||
// and use it as the "arguments" key for the queue. | |||
if v, ok := settingsMap["json_arguments"].(string); ok && v != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mentioned on Slack, would this make more sense as an interpolation function passed into arguments
? i.e.
arguments = "${json_to_map("{ "hello": "world" })"
@tombuildsstuff Per our discussion in Slack, updated with Also, for posterity, summary of today's discussion: Having an interpolation function is the best method, but due to the way the Terraform schema handles maps, all values would still be converted to a string. There are plans to fix this in the future. For now, the method that |
nice one glad it all got sorted out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Thanks, @tombuildsstuff! |
This commit adds the json_arguments parameter to the
rabbitmq_queue resource. This can accept a JSON string
which is useful for argument values which are not strings.
For #1