-
Notifications
You must be signed in to change notification settings - Fork 64
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
Nat rule #22
Nat rule #22
Conversation
Will review once #21 is meged |
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.
Aside from some minor comments i have left inline this mostly LTGM 👍
return &schema.Resource{ | ||
Create: resourceArmLoadBalancerNatRuleCreate, | ||
Read: resourceArmLoadBalancerNatRuleRead, | ||
Update: resourceArmLoadBalancerNatRuleCreate, |
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 we rename this to resourceArmLoadBalancerNatRuleCreateUpdate
as it is doing both?
existingNatRule, existingNatRuleIndex, exists := findLoadBalancerNatRuleByName(loadBalancer, d.Get("name").(string)) | ||
if exists { | ||
if d.Get("name").(string) == *existingNatRule.Name { | ||
// this probe is being updated/reapplied remove old copy from the slice |
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 believe this should be nat rule
not probe
|
||
if v, ok := d.GetOk("enable_floating_ip"); ok { | ||
enableFloatingIP := v.(bool) | ||
properties.EnableFloatingIP = utils.Bool(enableFloatingIP) |
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.
These can be combined into: properties.EnableFloatingIP = utils.Bool(v.(bool))
`
ID: rule.ID, | ||
} | ||
|
||
properties.FrontendIPConfiguration = &feip |
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.
This could become:
properties.FrontendIPConfiguration = &network.SubResource{
ID: rule.ID,
}
page_title: "Azure Resource Manager: azurestack_lb_nat_rule" | ||
sidebar_current: "docs-azurestack-resource-loadbalancer-nat-rule" | ||
description: |- | ||
Create a LoadBalancer NAT Rule. |
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.
This should be Manages a
|
||
# azurestack_lb_nat_rule | ||
|
||
Create a LoadBalancer NAT Rule. |
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.
This should be Manages a
Required: true, | ||
StateFunc: ignoreCaseStateFunc, | ||
DiffSuppressFunc: ignoreCaseDiffSuppressFunc, | ||
}, |
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 get some validation here?
…r-azurestack into nat_rule
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.
Thank you for the updates, just a couple comments left. The primary blocking is using the SDK values instead of strings for validating the protocol
property.
StateFunc: ignoreCaseStateFunc, | ||
DiffSuppressFunc: ignoreCaseDiffSuppressFunc, | ||
ValidateFunc: validation.StringInSlice([]string{ | ||
"Tcp", |
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 use the values provider by the SDK string(network.TransportProtocolTCP),
"frontend_port": { | ||
Type: schema.TypeInt, | ||
Required: true, | ||
}, |
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 validate the value is a valid port here?
"backend_port": { | ||
Type: schema.TypeInt, | ||
Required: true, | ||
}, |
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 validate the value is a valid port here?
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 @thetonymaster, this LGTM now 👍
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! |
Made a mistake changing the names of the tests on #21, so this will depend on that PR