Skip to content

Commit 4633f2e

Browse files
authored
Merge pull request #452 from vmware/fix-vmc-region-enumeration
Fix VMC region enumeration data source
2 parents fa277a3 + 4a14ba7 commit 4633f2e

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

examples/cloud_account_vmc/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ data "vra_data_collector" "this" {
1313
data "vra_region_enumeration_vmc" "this" {
1414
api_token = var.api_token
1515
sddc_name = var.sddc_name
16+
nsx_hostname = var.nsx_hostname
1617

1718
vcenter_hostname = var.vcenter_hostname
1819
vcenter_password = var.vcenter_password

vra/content_source_repository_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func expandContentSourceRepositoryConfig(repoConfigs []interface{}) []*ContentSo
3636
return configs
3737
}
3838

39-
//Convert from json back to an array
39+
// Convert from json back to an array
4040
func flattenContentsourceRepositoryConfig(list interface{}) []map[string]interface{} {
4141
l := map[string]interface{}{}
4242
v := reflect.ValueOf(list)

vra/data_source_region_enumeration_vmc.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ func dataSourceRegionEnumerationVMC() *schema.Resource {
3232
Optional: true,
3333
Description: "Identifier of a data collector vm deployed in the on premise infrastructure.",
3434
},
35+
"nsx_hostname": {
36+
Type: schema.TypeString,
37+
Required: true,
38+
Description: "The IP address of the NSX Manager server in the specified SDDC / FQDN.",
39+
},
3540
"sddc_name": {
3641
Type: schema.TypeString,
3742
Required: true,
@@ -77,6 +82,7 @@ func dataSourceRegionEnumerationVMCRead(ctx context.Context, d *schema.ResourceD
7782
APIKey: d.Get("api_token").(string),
7883
DcID: d.Get("dc_id").(string),
7984
HostName: d.Get("vcenter_hostname").(string),
85+
NsxHostName: d.Get("nsx_hostname").(string),
8086
Password: d.Get("vcenter_password").(string),
8187
SddcID: d.Get("sddc_name").(string),
8288
Username: d.Get("vcenter_username").(string),

vra/resource_deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ func getInputsByType(inputs map[string]interface{}, inputTypesMap map[string]str
941941
}
942942

943943
// Returns a map of string, string with input variables and their types defined in the given schema map.
944-
//Used for getting map of inputs and their types for Catalog item and Deployment actions
944+
// Used for getting map of inputs and their types for Catalog item and Deployment actions
945945
func getInputTypesMapFromSchema(schema map[string]interface{}) (map[string]string, error) {
946946
log.Printf("Getting the map of inputs and their types")
947947
inputTypesMap := make(map[string]string, len(schema))

website/docs/d/vra_region_enumeration_vmc.html.markdown

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ data "vra_region_enumeration_vmc" "this" {
1919
2020
api_token = var.api_token
2121
sddc_name = var.sddc_name
22-
22+
nsx_hostname = var.nsx_hostname
23+
2324
vcenter_hostname = var.vcenter_hostname
2425
vcenter_password = var.vcenter_password
2526
vcenter_username = var.vcenter_username
@@ -35,6 +36,8 @@ The region enumeration data source for VMC cloud account supports the following
3536

3637
* `dc_id` - (Optional) ID of a data collector vm deployed in the on premise infrastructure. Refer to the data-collector API to create or list data collectors.
3738

39+
* `nsx_hostname` - (Required) The IP address of the NSX Manager server in the specified SDDC / FQDN.
40+
3841
* `sddc_name` - (Required) Identifier of the on-premise SDDC to be used by this cloud account.
3942

4043
* `vcenter_hostname` - (Required) The IP address or FQDN of the vCenter Server in the specified SDDC. The cloud proxy belongs on this vCenter.

0 commit comments

Comments
 (0)