-
Notifications
You must be signed in to change notification settings - Fork 84
Adding data sources for T0 & T1 gateway interfaces #1614
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
base: master
Are you sure you want to change the base?
Conversation
Marking WIP as draft. |
af49c13
to
431a739
Compare
Let's consider having a single data source |
Signed-off-by: Arun Tony <[email protected]>
Added a generic policy search function to get the gateway to which the interface is linked to and to get resources with multiple elements. Fixed the Tier0 gateway id issue in the Tier0 interface data source by using the generic policy search function. Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
…cceptance tests and documentation forthe data source Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Signed-off-by: Arun Tony <[email protected]>
Optional: true, | ||
Computed: false, | ||
}, | ||
"segment_path": { |
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 think we should allow this to be an input - namely, pull the interface by gateway path and segment path.
The original PR also suggested to allow locale service as an input
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.
@annakhm I think you meant that in the issue report the user would like to be able to search the interface by locale service too.
- I think we should use locale_service_path (ie: the parent_path) instead of local service name
- What about gateway_path? I think users should specify either service_path or gateway_path, but specifying both would probably not make sense.
|
||
* `id` - ID of the interface. | ||
* `description` - The description of the resource. | ||
* `edge_cluster_path` - The path of the Edge cluster where this gateway is placed. This attribute is not set for NSX Global Manager, where gateway can span across multiple sites. This attribute is set only for Tier0 gateways. |
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.
Why are we only assigning this for T0 gateways?
} | ||
|
||
if path != nil { | ||
err := d.Set("path", *path) |
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.
nil check is already included in d.Set, so its safe to go with d.Set("path", path)
. Same below
// }, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccNsxtPolicyTier0InterfaceDataSourceTemplate(t0InterfaceName, t1InterfaceName, t0GatewayName, t1GatewayName, transportZoneName, interfaceDescription), |
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 would suggest to reuse the test for the resource interface that we already have. One option is to add the data source test to resource test, another option would be to reuse the terraform code that creates GW + segment + interface (testAccNsxtPolicyTier0InterfaceServiceTemplate
), and create a separate data source on top of that.
No description provided.