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

Add default_external_network_ip computed field to resource and data source vcd_edge_gateway #389

Merged
merged 14 commits into from
Nov 12, 2019

Conversation

Didainius
Copy link
Collaborator

@Didainius Didainius commented Nov 8, 2019

This PR adds default_network_ip default_external_network_ip field to resource and data source vcd_edge_gateway which allows to read and use IP address of default gateway interface. It can be very useful in scenarios where this IP is immediately useful in other places (like opening firewalls, running scripts, etc)

Closes #308, also puts some groundwork for #323

@Didainius Didainius marked this pull request as ready for review November 11, 2019 11:55
Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

LGTM


The following attributes are exported on this resource:

* `default_network_ip` (*v2.6+*) - IP address of edge gateway used for default network
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm thinking that it would be useful to show case this new field in one of our examples. It could be here or in some other resource page where EG IP is used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added two examples in load balancer virtual server and firewall rule

@@ -51,6 +51,11 @@ func datasourceVcdEdgeGateway() *schema.Resource {
Computed: true,
Description: "External network to be used as default gateway. Its name must be included in 'external_networks'. An empty value will skip the default gateway",
},
"default_network_ip": &schema.Schema{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just before merging, let's decide whether it would be helpful to rename default_network_ip to default_external_network_ip

CC: @dataclouder @vbauzysvmware

@lvirbalas lvirbalas changed the title Add default_network_ip computed field to resource and data source vcd_edge_gateway Add default_external_network_ip computed field to resource and data source vcd_edge_gateway Nov 12, 2019
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

We decided to go with the longer name for clarity, however we keep the right to revisit it during this release cycle if a wider picture emerges during the upcoming more complex PR - https://github.com/terraform-providers/terraform-provider-vcd/issues/323
The latter will need new related block/field and we will think how to name all of them consistently.

Most probably we have to change default_gateway_network structure because it must accept subnets and manual IP specification.

@Didainius Didainius self-assigned this Nov 12, 2019
@Didainius Didainius merged commit 2745d4a into vmware:master Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Return assigned IP of default edge gateway network when creating/updating
4 participants