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

New Data Source: azurerm_network_interface #854

Merged
merged 3 commits into from
Mar 2, 2018
Merged

New Data Source: azurerm_network_interface #854

merged 3 commits into from
Mar 2, 2018

Conversation

dcaro
Copy link
Contributor

@dcaro dcaro commented Feb 19, 2018

Adding a data source for network interface in Azure.

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 @dcaro

Thanks for this PR - I've taken a look through and this mostly LGTM; if we can fix up the highlighted issues (and the tests pass) this should be good to merge :)

Thanks!


"location": {
Type: schema.TypeString,
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

since this is a data source (and can't be specified), we can just make this Computed: true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense, done.


"network_security_group_id": {
Type: schema.TypeString,
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

(as above) can we remove the optional field here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


"mac_address": {
Type: schema.TypeString,
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

(as above) can we remove the optional field here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


"virtual_machine_id": {
Type: schema.TypeString,
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

(as above) can we remove the optional field here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

(as above) can we update this to be Computed: true since it can't be set by a user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

"enable_accelerated_networking": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

can we change this to be:

"enable_accelerated_networking": {
  Type: schema.TypeBool,
  Computed: true,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

"enable_ip_forwarding": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

(same here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

"resource_group_name": {
Type: schema.TypeString,
Required: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

can we switch over to using the helper for this:

"resource_group_name": resourceGroupNameForDataSourceSchema(),

Copy link
Contributor Author

@dcaro dcaro Feb 20, 2018

Choose a reason for hiding this comment

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

done.

},
},

"tags": tagsSchema(),
Copy link
Contributor

Choose a reason for hiding this comment

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

can we switch over to using the helper here?

"tags": tagsForDataSourceSchema(),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

* `mac_address` - The MAC address used by the network interface.
* `private_ip_address` - The private ip address associated to the network interface.
* `virtual_machine_id` - The ID of the virtual machine this network interface is attached to.
* `network_security_group_id` - The ID of the network security group associated to the network interface
Copy link
Contributor

Choose a reason for hiding this comment

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

it'd be good to add descriptions for the other fields in here too (e.g. ip_configuration / location)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, done and ordered them alphabetically.

@tombuildsstuff tombuildsstuff modified the milestones: 1.1.3, 1.1.4 Feb 28, 2018
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.

one minor comment - otherwise LGTM 👍

* `private_ip_addresses` - The list of private ip addresses associates to the specified network interface.
* `tags` - List the tags assocatied to the specified network interface.
* `virtual_machine_id` - The ID of the virtual machine that the specified network interface is attached to.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is missing a link in the sidebar - I'll push a commit to fix this

Copy link
Contributor

Choose a reason for hiding this comment

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

(done)

@tombuildsstuff tombuildsstuff self-assigned this Mar 2, 2018
@tombuildsstuff tombuildsstuff merged commit be115da into hashicorp:master Mar 2, 2018
tombuildsstuff added a commit that referenced this pull request Mar 2, 2018
@tombuildsstuff
Copy link
Contributor

Forgot to add - tests pass:

screen shot 2018-03-02 at 11 50 54

@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 👉 [email protected]. 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.

2 participants