summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharath Nair <snair3@agl.com.au>2022-07-21 19:15:44 +1000
committerSharath Nair <snair3@agl.com.au>2022-07-21 19:15:44 +1000
commit3f1cd1be60400dcbb5983516051325319ab1ead9 (patch)
treedb0329a6b7222c8be465c4422de393721c250a08
parent519cc9fdd755626f2642edd93bcff843f005e76c (diff)
Revert "Rename data source attribute"
This reverts commit 519cc9fdd755626f2642edd93bcff843f005e76c.
-rw-r--r--azuredevops/internal/acceptancetests/data_serviceendpoint_azurerm_test.go4
-rw-r--r--azuredevops/internal/acceptancetests/testutils/hcl.go6
-rw-r--r--azuredevops/internal/service/serviceendpoint/data_serviceendpoint_azurerm.go14
-rw-r--r--website/docs/d/serviceendpoint_azurerm.html.markdown11
4 files changed, 14 insertions, 21 deletions
diff --git a/azuredevops/internal/acceptancetests/data_serviceendpoint_azurerm_test.go b/azuredevops/internal/acceptancetests/data_serviceendpoint_azurerm_test.go
index c2e40862..2ede34db 100644
--- a/azuredevops/internal/acceptancetests/data_serviceendpoint_azurerm_test.go
+++ b/azuredevops/internal/acceptancetests/data_serviceendpoint_azurerm_test.go
@@ -31,7 +31,7 @@ func TestAccServiceEndpointAzureRM_with_serviceEndpointID_DataSource(t *testing.
{
Config: createServiceEndpointAzureRMWithServiceEndpointIDData,
Check: resource.ComposeTestCheckFunc(
- resource.TestCheckResourceAttr(tfNode, "name", serviceEndpointAzureRMName),
+ resource.TestCheckResourceAttr(tfNode, "service_endpoint_name", serviceEndpointAzureRMName),
resource.TestCheckResourceAttrSet(tfNode, "id"),
),
},
@@ -57,7 +57,7 @@ func TestAccServiceEndpointAzureRM_with_serviceEndpointName_DataSource(t *testin
{
Config: createServiceEndpointAzureRMWithServiceEndpointNameData,
Check: resource.ComposeTestCheckFunc(
- resource.TestCheckResourceAttr(tfNode, "name", serviceEndpointAzureRMName),
+ resource.TestCheckResourceAttr(tfNode, "service_endpoint_name", serviceEndpointAzureRMName),
resource.TestCheckResourceAttrSet(tfNode, "id"),
),
},
diff --git a/azuredevops/internal/acceptancetests/testutils/hcl.go b/azuredevops/internal/acceptancetests/testutils/hcl.go
index b7a5f2eb..bfa916d1 100644
--- a/azuredevops/internal/acceptancetests/testutils/hcl.go
+++ b/azuredevops/internal/acceptancetests/testutils/hcl.go
@@ -414,9 +414,9 @@ data "azuredevops_serviceendpoint_azurerm" "serviceendpointrm" {
func HclServiceEndpointAzureRMDataSourceWithServiceEndpointName(serviceEndpointName string) string {
serviceEndpointDataSource := fmt.Sprintf(`
data "azuredevops_serviceendpoint_azurerm" "serviceendpointrm" {
- project_id = azuredevops_project.project.id
- name = "%s"
- depends_on = [azuredevops_serviceendpoint_azurerm.serviceendpointrm]
+ project_id = azuredevops_project.project.id
+ service_endpoint_name = "%s"
+ depends_on = [azuredevops_serviceendpoint_azurerm.serviceendpointrm]
}
`, serviceEndpointName)
diff --git a/azuredevops/internal/service/serviceendpoint/data_serviceendpoint_azurerm.go b/azuredevops/internal/service/serviceendpoint/data_serviceendpoint_azurerm.go
index fc950f9a..fdbd63e9 100644
--- a/azuredevops/internal/service/serviceendpoint/data_serviceendpoint_azurerm.go
+++ b/azuredevops/internal/service/serviceendpoint/data_serviceendpoint_azurerm.go
@@ -21,11 +21,11 @@ func DataServiceEndpointAzureRM() *schema.Resource {
Required: true,
},
- "name": {
+ "service_endpoint_name": {
Type: schema.TypeString,
Optional: true,
Computed: true,
- ExactlyOneOf: []string{"name", "id"},
+ ExactlyOneOf: []string{"service_endpoint_name", "id"},
ValidateFunc: validation.StringIsNotEmpty,
},
@@ -34,15 +34,10 @@ func DataServiceEndpointAzureRM() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
- ExactlyOneOf: []string{"name", "id"},
+ ExactlyOneOf: []string{"service_endpoint_name", "id"},
ValidateFunc: validation.IsUUID,
},
- "service_endpoint_name": {
- Type: schema.TypeString,
- Computed: true,
- },
-
"authorization": {
Type: schema.TypeMap,
Computed: true,
@@ -125,12 +120,11 @@ func dataSourceServiceEndpointAzureRMRead(d *schema.ResourceData, m interface{})
}
(*serviceEndpoint.Data)["creationMode"] = ""
- d.Set("name", serviceEndpoint.Name)
flattenServiceEndpointAzureRM(d, serviceEndpoint, projectID)
return nil
}
- if serviceEndpointName, ok := d.GetOk("name"); ok {
+ if serviceEndpointName, ok := d.GetOk("service_endpoint_name"); ok {
// get service endpointdetails by name
serviceEndpoint, err := getServiceEndpointByNameAndProject(clients, serviceEndpointName.(string), projectID)
if err != nil {
diff --git a/website/docs/d/serviceendpoint_azurerm.html.markdown b/website/docs/d/serviceendpoint_azurerm.html.markdown
index f31ecc20..14301c15 100644
--- a/website/docs/d/serviceendpoint_azurerm.html.markdown
+++ b/website/docs/d/serviceendpoint_azurerm.html.markdown
@@ -24,7 +24,7 @@ data "azuredevops_serviceendpoint_azurerm" "id" {
}
output "service_endpoint_name" {
- value = data.azuredevops_serviceendpoint_azurerm.name
+ value = data.azuredevops_serviceendpoint_azurerm.service_endpoint_name
}
```
@@ -36,8 +36,8 @@ data "azuredevops_project" "sample" {
}
data "azuredevops_serviceendpoint_azurerm" "id" {
- project_id = data.azuredevops_project.sample.id
- name = "Example-Service-Endpoint"
+ project_id = data.azuredevops_project.sample.id
+ service_endpoint_name = "Example-Service-Endpoint"
}
output "service_endpoint_id" {
@@ -53,9 +53,9 @@ The following arguments are supported:
* `id` - (Optional) the ID of the Service Endpoint.
-* `name` - (Optional) the Name of the Service Endpoint.
+* `service_endpoint_name` - (Optional) the Name of the Service Endpoint.
-~> **NOTE:** One of either `id` or `name` must be specified.
+~> **NOTE:** One of either `id` or `service_endpoint_name` must be specified.
## Attributes Reference
@@ -69,4 +69,3 @@ In addition to the Arguments list above - the following Attributes are exported:
* `resource_group` - Specifies the Resource Group of the Service Endpoint target, if available.
* `azurerm_spn_tenantid` - Specifies the Tenant ID of the Azure targets.
* `description` - Specifies the description of the Service Endpoint.
-* `service_endpoint_name` - Specifies the friendly name of the Service Endpoint, same as the `name` attribute.