Skip to content
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 domain_name_label to read to fix import. (#784) #1287

Merged
merged 5 commits into from
May 25, 2018

Conversation

shanepoint
Copy link
Contributor

Fixes #784

@katbyte katbyte added this to the 1.6.0 milestone May 23, 2018
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @shanepoint,

Thank you for opening this PR. This LGTM aside from one thing: the dns_name_label used for testing should be random to prevent conflicts.

Look forward to merging this once thats fixed 🙂

@@ -46,6 +46,7 @@ func resourceArmPublicIp() *schema.Resource {

"zones": singleZonesSchema(),

//should this perhaps be allocation_method?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd kind of agree with this, but I don't think it's one for this PR.

It's worth noting that IPv4 and IPv6 will both be supported here at some point in the future (the SDK supports it today, but the underlying Azure infra didn't last time I tried it) - so it may make sense to rename/differentiate them at that point.

testCheckAzureRMPublicIpExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "ip_address"),
resource.TestCheckResourceAttr(resourceName, "public_ip_address_allocation", "static"),
resource.TestCheckResourceAttr(resourceName, "domain_name_label", "dnstestlabel"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please make this random to prevent conflicts?

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @shanepoint

Thanks for this PR - I've added couple of minor comments in addition to what @katbyte mentioned - but this is otherwise looking good :)

Thanks!

resourceName := "azurerm_public_ip.test"

ri := acctest.RandInt()
dnl := fmt.Sprintf("tfacc%d", ri)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor can we make this prefix acctest so that it's picked up by our sweepers? (these try and automatically delete any spurious test resources)

@@ -46,6 +46,7 @@ func resourceArmPublicIp() *schema.Resource {

"zones": singleZonesSchema(),

//should this perhaps be allocation_method?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd kind of agree with this, but I don't think it's one for this PR.

It's worth noting that IPv4 and IPv6 will both be supported here at some point in the future (the SDK supports it today, but the underlying Azure infra didn't last time I tried it) - so it may make sense to rename/differentiate them at that point.

d.Set("domain_name_label", dnl)
} else {
d.Set("domain_name_label", "")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor given this is returning a *string - d.Set will take care of this for us, thus we can consolidate this down to:

d.Set("domain_name_label", settings.DomainNameLabel)

@tombuildsstuff tombuildsstuff modified the milestones: 1.6.0, 1.7.0 May 24, 2018
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @shanepoint,

Thank you for the changes! This LGTM now 👍

@katbyte
Copy link
Collaborator

katbyte commented May 25, 2018

Tests pass:
screen shot 2018-05-24 at 20 28 08

@katbyte katbyte merged commit 1e9c8c2 into hashicorp:master May 25, 2018
katbyte added a commit that referenced this pull request May 25, 2018
@ghost
Copy link

ghost commented Mar 31, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

domain_name_label not imported for azurerm_public_ip
3 participants