-
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
Added option to set the application security group of a VMSS #2009
Added option to set the application security group of a VMSS #2009
Conversation
…key/terraform-provider-azurerm into vmss-application-security-groups
Is there anything else I need to do for this PR to be merged? |
When will this issue be merged? 😃 |
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.
hey @chapmonkey
Thanks for this PR :)
I've taken a look through and this mostly LGTM - if we can address the comments (and the tests pass) then we should be able to get this merged :)
Thanks!
Config: config, | ||
Check: resource.ComposeTestCheckFunc( | ||
testCheckAzureRMVirtualMachineScaleSetExists(resourceName), | ||
testCheckAzureRMVirtualMachineScaleSetApplicationSecurity(resourceName), |
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.
rather than reaching out and checking the state of the resource in Azure - we should be able to verify this in the local state by switching this to using a generic test check function like so:
resource.TestCheckResourceAttr(resourceName, "ip_configuration.0.application_security_group_ids.#", "1")
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.
Ok, I will update this test.
ip_configuration { | ||
name = "TestIPConfiguration" | ||
subnet_id = "${azurerm_subnet.test.id}" | ||
application_security_group_ids = ["${azurerm_application_security_group.test.id}"] |
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 could we fix the indentation to match the rest of resource by using spaces instead of tabs here?
"application_security_group_ids": { | ||
Type: schema.TypeSet, | ||
Optional: true, | ||
Elem: &schema.Schema{Type: schema.TypeString}, |
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.
Could we also validate the ID with azure.ValidateResourceId
?
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.
I will have a look
I have pushed my changes as request in the review |
@tombuildsstuff Do you know what version this might end up in? We are having to use a workaround for this at the moment. |
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.
Thanks for the updates @chapmonkey, aside from two minor comments this LGTM 👍
I hope you don't mind but i am going to push some changes so i can get this merged today 🙂 It should go out in 1.18 next week.
applicationSecurityGroups := make([]interface{}, 0) | ||
if properties.ApplicationSecurityGroups != nil { | ||
for _, asg := range *properties.ApplicationSecurityGroups { | ||
applicationSecurityGroups = append(applicationSecurityGroups, *asg.ID) |
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.
ID should be nil checked
@katbyte Ok, that would be great, thanks. |
test passes:
|
Just to let you know that this has been released as a part of v1.18 of the AzureRM Provider (the full changelog is available here). You can upgrade to this by specifying the version in the provider block (as shown below) and then running
Thanks! |
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! |
No description provided.