Skip to content

Commit

Permalink
Switching to use the azure wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Jul 5, 2017
1 parent f3a408f commit 82792ff
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions azurerm/resource_arm_servicebus_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/Azure/azure-sdk-for-go/arm/servicebus"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/jen20/riviera/azure"
)

func resourceArmServiceBusTopic() *schema.Resource {
Expand Down Expand Up @@ -134,26 +135,26 @@ func resourceArmServiceBusTopicCreate(d *schema.ResourceData, meta interface{})
Location: &location,
TopicProperties: &servicebus.TopicProperties{
Status: servicebus.EntityStatus(status),
EnableBatchedOperations: &enableBatchedOps,
EnableExpress: &enableExpress,
FilteringMessagesBeforePublishing: &enableFiltering,
EnablePartitioning: &enablePartitioning,
MaxSizeInMegabytes: &maxSize,
RequiresDuplicateDetection: &requiresDuplicateDetection,
SupportOrdering: &supportOrdering,
EnableBatchedOperations: azure.Bool(enableBatchedOps),
EnableExpress: azure.Bool(enableExpress),
FilteringMessagesBeforePublishing: azure.Bool(enableFiltering),
EnablePartitioning: azure.Bool(enablePartitioning),
MaxSizeInMegabytes: azure.Int64(maxSize),
RequiresDuplicateDetection: azure.Bool(requiresDuplicateDetection),
SupportOrdering: azure.Bool(supportOrdering),
},
}

if autoDeleteOnIdle := d.Get("auto_delete_on_idle").(string); autoDeleteOnIdle != "" {
parameters.TopicProperties.AutoDeleteOnIdle = &autoDeleteOnIdle
parameters.TopicProperties.AutoDeleteOnIdle = azure.String(autoDeleteOnIdle)
}

if defaultTTL := d.Get("default_message_ttl").(string); defaultTTL != "" {
parameters.TopicProperties.DefaultMessageTimeToLive = &defaultTTL
parameters.TopicProperties.DefaultMessageTimeToLive = azure.String(defaultTTL)
}

if duplicateWindow := d.Get("duplicate_detection_history_time_window").(string); duplicateWindow != "" {
parameters.TopicProperties.DuplicateDetectionHistoryTimeWindow = &duplicateWindow
parameters.TopicProperties.DuplicateDetectionHistoryTimeWindow = azure.String(duplicateWindow)
}

_, err := client.CreateOrUpdate(resGroup, namespaceName, name, parameters)
Expand Down

0 comments on commit 82792ff

Please sign in to comment.