-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
new resource: azurerm_servicebus_namespace_authorization_rule #1498
Conversation
katbyte
commented
Jul 5, 2018
- New resource azurerm_servicebus_namespace_authorization_rule
- fixed service bus example
- added namespace name validation everywhere
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.
otherwise LGTM 👍
d.Set("primary_key", keysResp.PrimaryKey) | ||
d.Set("primary_connection_string", keysResp.PrimaryConnectionString) | ||
d.Set("secondary_key", keysResp.SecondaryKey) | ||
d.Set("secondary_connection_string", keysResp.SecondaryConnectionString) |
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.
can we access rights -> secondary_connection_string via the [XX]Properties
object & nil-check them?
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.
There are no properties object returned by list keys.
} | ||
|
||
func flattenServiceBusAuthorizationRuleRights(rights *[]servicebus.AccessRights) *schema.Set { | ||
slice := make([]interface{}, 0, 0) |
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.
minor we don't actually need this last index
"github.com/hashicorp/terraform/terraform" | ||
|
||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" | ||
"strconv" |
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.
minor can we fix the imports here?
|
||
for _, tc := range cases { | ||
t.Run(tc.Name, func(t *testing.T) { | ||
testAccAzureRMServiceBusNamespaceAuthorizationRule(t, tc.Rights) |
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.
whilst this makes it more readable - this means it's not possible to run these tests individually; can we split them out as regular tests?
string(servicebus.Manage), | ||
}, true), | ||
}, | ||
Set: set.HashStringIgnoreCase, |
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.
can we switch this over to using Bools rather than a Set, since this makes the diff clearer (and then these can be inferred)?
return fmt.Errorf("Not found: %s", name) | ||
} | ||
|
||
name := rs.Primary.Attributes["name"] |
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.
minor recently we've been renaming this field to avoid conflicting with the name
parameter - it may be worth doing that here for consistency?
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.
Rename the variable or the property?
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.
the variable, but it's not a big deal/blocker
|
||
# azurerm_servicebus_namespace_authorization_rule | ||
|
||
Manages a ServiceBus Namespace authorization Rule within a ServiceBus Topic. |
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.
would this make more sense as Manages a ServiceBus Authorization Rule scoped at the Namespace level
?
page_title: "Azure Resource Manager: azurerm_servicebus_namespace_authorization_rule" | ||
sidebar_current: "docs-azurerm-resource-servicebus-namespace-authorization-rule" | ||
description: |- | ||
Manages a ServiceBus Namespace authorization Rule within a ServiceBus Topic. |
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.
(same here)
41c9297
to
45110ab
Compare
Requested updates made, mind giving it another quick review @tombuildsstuff ? |
45110ab
to
d88b999
Compare
d88b999
to
f387eac
Compare
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.
A couple of minor nits but this otherwise LGTM 👍
"send": { | ||
Type: schema.TypeBool, | ||
Optional: true, | ||
Computed: true, //because we set this to true if managed is chosen |
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.
send
and listen
want default values of false
since otherwise it's not possible to disable send/listen by simply removing the code / explicitly setting these values to false, which is misleading (as is an option in other providers, but we're having to work around due to the SDK)
|
||
resource "azurerm_servicebus_namespace" "example" { | ||
name = "${var.servicebus_name}" | ||
location = "${var.location}" |
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.
neither of these variables exists in this context - can we hard-code example values here? e.g. myservicebusnamespace
/ ${azurerm_resource_group.example.location}
respectively
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |