From c7a2f81488912e18d63d0a83cbb8dba62c405421 Mon Sep 17 00:00:00 2001 From: MrWolong Date: Tue, 18 Mar 2025 17:53:56 +0800 Subject: [PATCH] data-source/alicloud_arms_prometheus: Fixed the read error in field push_gate_way_intra_url, push_gate_way_inter_url --- .../data_source_alicloud_arms_prometheis.go | 43 +-- ...ta_source_alicloud_arms_prometheis_test.go | 268 ++++++++++++++---- alicloud/provider.go | 4 +- website/docs/d/arms_prometheus.html.markdown | 28 +- 4 files changed, 248 insertions(+), 95 deletions(-) diff --git a/alicloud/data_source_alicloud_arms_prometheis.go b/alicloud/data_source_alicloud_arms_prometheis.go index 37148e1e040f..9a0047280ef7 100644 --- a/alicloud/data_source_alicloud_arms_prometheis.go +++ b/alicloud/data_source_alicloud_arms_prometheis.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) -func dataSourceAlicloudArmsPrometheis() *schema.Resource { +func dataSourceAliCloudArmsPrometheis() *schema.Resource { return &schema.Resource{ - Read: dataSourceAlicloudArmsPrometheisRead, + Read: dataSourceAliCloudArmsPrometheisRead, Schema: map[string]*schema.Schema{ "ids": { Type: schema.TypeList, @@ -35,12 +35,12 @@ func dataSourceAlicloudArmsPrometheis() *schema.Resource { Optional: true, ForceNew: true, }, + "tags": tagsSchemaForceNew(), "enable_details": { Type: schema.TypeBool, Optional: true, Default: false, }, - "tags": tagsSchemaForceNew(), "output_file": { Type: schema.TypeString, Optional: true, @@ -91,6 +91,10 @@ func dataSourceAlicloudArmsPrometheis() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "resource_group_id": { + Type: schema.TypeString, + Computed: true, + }, "remote_read_intra_url": { Type: schema.TypeString, Computed: true, @@ -127,10 +131,6 @@ func dataSourceAlicloudArmsPrometheis() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "resource_group_id": { - Type: schema.TypeString, - Computed: true, - }, "tags": { Type: schema.TypeMap, Computed: true, @@ -142,7 +142,7 @@ func dataSourceAlicloudArmsPrometheis() *schema.Resource { } } -func dataSourceAlicloudArmsPrometheisRead(d *schema.ResourceData, meta interface{}) error { +func dataSourceAliCloudArmsPrometheisRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*connectivity.AliyunClient) action := "ListPrometheusInstanceByTagAndResourceGroupId" @@ -195,7 +195,7 @@ func dataSourceAlicloudArmsPrometheisRead(d *schema.ResourceData, meta interface addDebug(action, response, request) if err != nil { - return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_arms_prometheis", action, AlibabaCloudSdkGoERROR) + return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_arms_prometheus", action, AlibabaCloudSdkGoERROR) } resp, err := jsonpath.Get("$.Data.PrometheusInstances", response) @@ -244,22 +244,25 @@ func dataSourceAlicloudArmsPrometheisRead(d *schema.ResourceData, meta interface s = append(s, mapping) continue } + id := fmt.Sprint(fmt.Sprint(object["ClusterId"])) - client := meta.(*connectivity.AliyunClient) armsService := ArmsService{client} - object, err := armsService.DescribeArmsPrometheus(id) + + armsPrometheus, err := armsService.DescribeArmsPrometheus(id) if err != nil { return WrapError(err) } - mapping["remote_read_intra_url"] = object["RemoteReadIntraUrl"] - mapping["remote_read_inter_url"] = object["RemoteReadInterUrl"] - mapping["remote_write_intra_url"] = object["RemoteWriteIntraUrl"] - mapping["remote_write_inter_url"] = object["RemoteWriteInterUrl"] - mapping["push_gate_way_intra_url"] = object["PushGateWayIntraUrl"] - mapping["push_gate_way_inter_url"] = object["PushGateWayInterUrl"] - mapping["http_api_intra_url"] = object["HttpApiIntraUrl"] - mapping["http_api_inter_url"] = object["HttpApiInterUrl"] - mapping["auth_token"] = object["AuthToken"] + + mapping["remote_read_intra_url"] = armsPrometheus["RemoteReadIntraUrl"] + mapping["remote_read_inter_url"] = armsPrometheus["RemoteReadInterUrl"] + mapping["remote_write_intra_url"] = armsPrometheus["RemoteWriteIntraUrl"] + mapping["remote_write_inter_url"] = armsPrometheus["RemoteWriteInterUrl"] + mapping["push_gate_way_intra_url"] = armsPrometheus["PushGatewayIntraUrl"] + mapping["push_gate_way_inter_url"] = armsPrometheus["PushGatewayInterUrl"] + mapping["http_api_intra_url"] = armsPrometheus["HttpApiIntraUrl"] + mapping["http_api_inter_url"] = armsPrometheus["HttpApiInterUrl"] + mapping["auth_token"] = armsPrometheus["AuthToken"] + s = append(s, mapping) } diff --git a/alicloud/data_source_alicloud_arms_prometheis_test.go b/alicloud/data_source_alicloud_arms_prometheis_test.go index b91c2d1ecbce..fd33713d479e 100644 --- a/alicloud/data_source_alicloud_arms_prometheis_test.go +++ b/alicloud/data_source_alicloud_arms_prometheis_test.go @@ -8,64 +8,64 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" ) -func TestAccAlicloudArmsPrometheisDataSource(t *testing.T) { +func TestAccAliCloudArmsPrometheisDataSource_basic0(t *testing.T) { rand := acctest.RandIntRange(10, 99) + idsConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ - "ids": `["${alicloud_arms_prometheus.default.id}"]`, - "enable_details": `true`, + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "ids": `["${alicloud_arms_prometheus.default.id}"]`, }), - fakeConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ "ids": `["${alicloud_arms_prometheus.default.id}_fake"]`, }), } + nameRegexConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ - "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, - "enable_details": `true`, + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, }), - fakeConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}_fake"`, }), } + resourceGroupIdConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, "resource_group_id": `"${alicloud_arms_prometheus.default.resource_group_id}"`, - "enable_details": `true`, }), - fakeConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ "resource_group_id": `"${alicloud_arms_prometheus.default.resource_group_id}_fake"`, }), } + tagsConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ - "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, - "enable_details": `true`, + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, "tags": `{ Created = "TF" For = "Prometheus" }`, }), - fakeConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ "tags": `{ Created = "TF_Update" For = "Prometheus_Update" }`, }), } + allConf := dataSourceTestAccConfig{ - existConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ "ids": `["${alicloud_arms_prometheus.default.id}"]`, "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, - "enable_details": `true`, "resource_group_id": `"${alicloud_arms_prometheus.default.resource_group_id}"`, "tags": `{ Created = "TF" For = "Prometheus" }`, }), - fakeConfig: testAccCheckAlicloudArmsPrometheisDataSourceName(rand, map[string]string{ + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ "ids": `["${alicloud_arms_prometheus.default.id}_fake"]`, "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}_fake"`, "resource_group_id": `"${alicloud_arms_prometheus.default.resource_group_id}_fake"`, @@ -75,54 +75,212 @@ func TestAccAlicloudArmsPrometheisDataSource(t *testing.T) { }`, }), } - var existAlicloudArmsPrometheisDataSourceNameMapFunc = func(rand int) map[string]string { + + var existAliCloudArmsPrometheisDataSourceNameMapFunc = func(rand int) map[string]string { return map[string]string{ - "ids.#": "1", - "names.#": "1", - "prometheis.#": "1", - "prometheis.0.id": CHECKSET, - "prometheis.0.cluster_id": CHECKSET, - "prometheis.0.cluster_type": "ecs", - "prometheis.0.cluster_name": CHECKSET, - "prometheis.0.vpc_id": CHECKSET, - "prometheis.0.vswitch_id": CHECKSET, - "prometheis.0.security_group_id": CHECKSET, - "prometheis.0.sub_clusters_json": "", - "prometheis.0.grafana_instance_id": "free", - "prometheis.0.resource_group_id": CHECKSET, - "prometheis.0.tags.%": "2", - "prometheis.0.tags.Created": "TF", - "prometheis.0.tags.For": "Prometheus", - "prometheis.0.remote_read_intra_url": CHECKSET, - "prometheis.0.remote_read_inter_url": CHECKSET, - "prometheis.0.remote_write_intra_url": CHECKSET, - "prometheis.0.remote_write_inter_url": CHECKSET, - //"prometheis.0.push_gate_way_intra_url": CHECKSET, - //"prometheis.0.push_gate_way_inter_url": CHECKSET, - "prometheis.0.http_api_intra_url": CHECKSET, - "prometheis.0.http_api_inter_url": CHECKSET, - //"prometheis.0.auth_token": CHECKSET, + "ids.#": "1", + "names.#": "1", + "prometheis.#": "1", + "prometheis.0.id": CHECKSET, + "prometheis.0.cluster_id": CHECKSET, + "prometheis.0.cluster_type": "ecs", + "prometheis.0.cluster_name": CHECKSET, + "prometheis.0.vpc_id": CHECKSET, + "prometheis.0.vswitch_id": CHECKSET, + "prometheis.0.security_group_id": CHECKSET, + "prometheis.0.sub_clusters_json": "", + "prometheis.0.grafana_instance_id": "free", + "prometheis.0.resource_group_id": CHECKSET, + "prometheis.0.remote_read_intra_url": "", + "prometheis.0.remote_read_inter_url": "", + "prometheis.0.remote_write_intra_url": "", + "prometheis.0.remote_write_inter_url": "", + "prometheis.0.push_gate_way_intra_url": "", + "prometheis.0.push_gate_way_inter_url": "", + "prometheis.0.http_api_intra_url": "", + "prometheis.0.http_api_inter_url": "", + "prometheis.0.auth_token": "", + "prometheis.0.tags.%": "2", + "prometheis.0.tags.Created": "TF", + "prometheis.0.tags.For": "Prometheus", } } - var fakeAlicloudArmsPrometheisDataSourceNameMapFunc = func(rand int) map[string]string { + + var fakeAliCloudArmsPrometheisDataSourceNameMapFunc = func(rand int) map[string]string { return map[string]string{ "ids.#": "0", "names.#": "0", "prometheis.#": "0", } } - var alicloudArmsPrometheisCheckInfo = dataSourceAttr{ - resourceId: "data.alicloud_arms_prometheis.default", - existMapFunc: existAlicloudArmsPrometheisDataSourceNameMapFunc, - fakeMapFunc: fakeAlicloudArmsPrometheisDataSourceNameMapFunc, + + var aliCloudArmsPrometheisCheckInfo = dataSourceAttr{ + resourceId: "data.alicloud_arms_prometheus.default", + existMapFunc: existAliCloudArmsPrometheisDataSourceNameMapFunc, + fakeMapFunc: fakeAliCloudArmsPrometheisDataSourceNameMapFunc, + } + + preCheck := func() { + testAccPreCheck(t) + } + + aliCloudArmsPrometheisCheckInfo.dataSourceTestCheckWithPreCheck(t, rand, preCheck, idsConf, nameRegexConf, resourceGroupIdConf, tagsConf, allConf) +} + +func TestAccAliCloudArmsPrometheisDataSource_basic1(t *testing.T) { + rand := acctest.RandIntRange(10, 99) + + idsConf := dataSourceTestAccConfig{ + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "ids": `["${alicloud_arms_prometheus.default.id}"]`, + "enable_details": `true`, + }), + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "ids": `["${alicloud_arms_prometheus.default.id}"]`, + "enable_details": `false`, + }), + } + + nameRegexConf := dataSourceTestAccConfig{ + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, + "enable_details": `true`, + }), + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, + "enable_details": `false`, + }), + } + + resourceGroupIdConf := dataSourceTestAccConfig{ + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, + "resource_group_id": `"${alicloud_arms_prometheus.default.resource_group_id}"`, + "enable_details": `true`, + }), + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, + "resource_group_id": `"${alicloud_arms_prometheus.default.resource_group_id}"`, + "enable_details": `false`, + }), + } + + tagsConf := dataSourceTestAccConfig{ + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, + "tags": `{ + Created = "TF" + For = "Prometheus" + }`, + "enable_details": `true`, + }), + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, + "tags": `{ + Created = "TF" + For = "Prometheus" + }`, + "enable_details": `false`, + }), + } + + allConf := dataSourceTestAccConfig{ + existConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "ids": `["${alicloud_arms_prometheus.default.id}"]`, + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, + "resource_group_id": `"${alicloud_arms_prometheus.default.resource_group_id}"`, + "tags": `{ + Created = "TF" + For = "Prometheus" + }`, + "enable_details": `true`, + }), + fakeConfig: testAccCheckAliCloudArmsPrometheisDataSourceName(rand, map[string]string{ + "ids": `["${alicloud_arms_prometheus.default.id}"]`, + "name_regex": `"${alicloud_arms_prometheus.default.cluster_name}"`, + "resource_group_id": `"${alicloud_arms_prometheus.default.resource_group_id}"`, + "tags": `{ + Created = "TF" + For = "Prometheus" + }`, + "enable_details": `false`, + }), + } + + var existAliCloudArmsPrometheisDataSourceNameMapFunc = func(rand int) map[string]string { + return map[string]string{ + "ids.#": "1", + "names.#": "1", + "prometheis.#": "1", + "prometheis.0.id": CHECKSET, + "prometheis.0.cluster_id": CHECKSET, + "prometheis.0.cluster_type": "ecs", + "prometheis.0.cluster_name": CHECKSET, + "prometheis.0.vpc_id": CHECKSET, + "prometheis.0.vswitch_id": CHECKSET, + "prometheis.0.security_group_id": CHECKSET, + "prometheis.0.sub_clusters_json": "", + "prometheis.0.grafana_instance_id": "free", + "prometheis.0.resource_group_id": CHECKSET, + "prometheis.0.remote_read_intra_url": CHECKSET, + "prometheis.0.remote_read_inter_url": CHECKSET, + "prometheis.0.remote_write_intra_url": CHECKSET, + "prometheis.0.remote_write_inter_url": CHECKSET, + "prometheis.0.push_gate_way_intra_url": CHECKSET, + "prometheis.0.push_gate_way_inter_url": CHECKSET, + "prometheis.0.http_api_intra_url": CHECKSET, + "prometheis.0.http_api_inter_url": CHECKSET, + "prometheis.0.auth_token": "", + "prometheis.0.tags.%": "2", + "prometheis.0.tags.Created": "TF", + "prometheis.0.tags.For": "Prometheus", + } + } + + var fakeAliCloudArmsPrometheisDataSourceNameMapFunc = func(rand int) map[string]string { + return map[string]string{ + "ids.#": "1", + "names.#": "1", + "prometheis.#": "1", + "prometheis.0.id": CHECKSET, + "prometheis.0.cluster_id": CHECKSET, + "prometheis.0.cluster_type": "ecs", + "prometheis.0.cluster_name": CHECKSET, + "prometheis.0.vpc_id": CHECKSET, + "prometheis.0.vswitch_id": CHECKSET, + "prometheis.0.security_group_id": CHECKSET, + "prometheis.0.sub_clusters_json": "", + "prometheis.0.grafana_instance_id": "free", + "prometheis.0.resource_group_id": CHECKSET, + "prometheis.0.remote_read_intra_url": "", + "prometheis.0.remote_read_inter_url": "", + "prometheis.0.remote_write_intra_url": "", + "prometheis.0.remote_write_inter_url": "", + "prometheis.0.push_gate_way_intra_url": "", + "prometheis.0.push_gate_way_inter_url": "", + "prometheis.0.http_api_intra_url": "", + "prometheis.0.http_api_inter_url": "", + "prometheis.0.auth_token": "", + "prometheis.0.tags.%": "2", + "prometheis.0.tags.Created": "TF", + "prometheis.0.tags.For": "Prometheus", + } + } + + var aliCloudArmsPrometheisCheckInfo = dataSourceAttr{ + resourceId: "data.alicloud_arms_prometheus.default", + existMapFunc: existAliCloudArmsPrometheisDataSourceNameMapFunc, + fakeMapFunc: fakeAliCloudArmsPrometheisDataSourceNameMapFunc, } + preCheck := func() { testAccPreCheck(t) } - alicloudArmsPrometheisCheckInfo.dataSourceTestCheckWithPreCheck(t, rand, preCheck, idsConf, nameRegexConf, resourceGroupIdConf, tagsConf, allConf) + + aliCloudArmsPrometheisCheckInfo.dataSourceTestCheckWithPreCheck(t, rand, preCheck, idsConf, nameRegexConf, resourceGroupIdConf, tagsConf, allConf) } -func testAccCheckAlicloudArmsPrometheisDataSourceName(rand int, attrMap map[string]string) string { +func testAccCheckAliCloudArmsPrometheisDataSourceName(rand int, attrMap map[string]string) string { var pairs []string for k, v := range attrMap { pairs = append(pairs, k+" = "+v) @@ -141,9 +299,6 @@ func testAccCheckAlicloudArmsPrometheisDataSourceName(rand int, attrMap map[stri vpc_id = data.alicloud_vpcs.default.ids.0 } - data "alicloud_resource_manager_resource_groups" "default" { - } - resource "alicloud_security_group" "default" { vpc_id = data.alicloud_vpcs.default.ids.0 } @@ -155,14 +310,13 @@ func testAccCheckAlicloudArmsPrometheisDataSourceName(rand int, attrMap map[stri vswitch_id = data.alicloud_vswitches.default.ids.0 security_group_id = alicloud_security_group.default.id cluster_name = "${var.name}-${data.alicloud_vpcs.default.ids.0}" - resource_group_id = data.alicloud_resource_manager_resource_groups.default.groups.1.id tags = { Created = "TF" For = "Prometheus" } } - data "alicloud_arms_prometheis" "default" { + data "alicloud_arms_prometheus" "default" { %s } `, rand, strings.Join(pairs, " \n ")) diff --git a/alicloud/provider.go b/alicloud/provider.go index 686359f6f84c..9ceef5efbafe 100644 --- a/alicloud/provider.go +++ b/alicloud/provider.go @@ -877,8 +877,8 @@ func Provider() terraform.ResourceProvider { "alicloud_actiontrail_global_events_storage_region": dataSourceAlicloudActiontrailGlobalEventsStorageRegion(), "alicloud_dbfs_auto_snap_shot_policies": dataSourceAlicloudDbfsAutoSnapShotPolicies(), "alicloud_cen_transit_route_table_aggregations": dataSourceAlicloudCenTransitRouteTableAggregations(), - "alicloud_arms_prometheis": dataSourceAlicloudArmsPrometheis(), - "alicloud_arms_prometheus": dataSourceAlicloudArmsPrometheis(), + "alicloud_arms_prometheis": dataSourceAliCloudArmsPrometheis(), + "alicloud_arms_prometheus": dataSourceAliCloudArmsPrometheis(), "alicloud_ocean_base_instances": dataSourceAlicloudOceanBaseInstances(), "alicloud_chatbot_agents": dataSourceAlicloudChatbotAgents(), "alicloud_arms_integration_exporters": dataSourceAlicloudArmsIntegrationExporters(), diff --git a/website/docs/d/arms_prometheus.html.markdown b/website/docs/d/arms_prometheus.html.markdown index f4dec498bce1..52cedb9be9ca 100644 --- a/website/docs/d/arms_prometheus.html.markdown +++ b/website/docs/d/arms_prometheus.html.markdown @@ -7,7 +7,7 @@ description: |- Provides a list of Arms Prometheus to the user. --- -# alicloud\_arms\_prometheus +# alicloud_arms_prometheus This data source provides the Arms Prometheus of the current Alibaba Cloud user. @@ -30,9 +30,6 @@ data "alicloud_vswitches" "default" { vpc_id = data.alicloud_vpcs.default.ids.0 } -data "alicloud_resource_manager_resource_groups" "default" { -} - resource "alicloud_security_group" "default" { vpc_id = data.alicloud_vpcs.default.ids.0 } @@ -44,7 +41,6 @@ resource "alicloud_arms_prometheus" "default" { vswitch_id = data.alicloud_vswitches.default.ids.0 security_group_id = alicloud_security_group.default.id cluster_name = "${var.name}-${data.alicloud_vpcs.default.ids.0}" - resource_group_id = data.alicloud_resource_manager_resource_groups.default.groups.1.id tags = { Created = "TF" For = "Prometheus" @@ -64,11 +60,11 @@ output "arms_prometheus_id" { The following arguments are supported: -* `ids` - (Optional, ForceNew, Computed) A list of Prometheus IDs. +* `ids` - (Optional, ForceNew, List) A list of Prometheus IDs. * `name_regex` - (Optional, ForceNew) A regex string to filter results by Prometheus name. * `resource_group_id` - (Optional, ForceNew) The ID of the resource group. * `tags` - (Optional, ForceNew) A mapping of tags to assign to the resource. -* `enable_details` - (Optional) Whether to query details about the instance. +* `enable_details` - (Optional, Bool, Available since v1.214.0) Whether to query the detailed list of resource attributes. Default value: `false`. * `output_file` - (Optional) File name where to save data source results (after running `terraform plan`). ## Attributes Reference @@ -87,14 +83,14 @@ The following attributes are exported in addition to the arguments listed above: * `sub_clusters_json` - The child instance json string of the globalView instance. * `grafana_instance_id` - The ID of the Grafana workspace. * `resource_group_id` - The ID of the resource group. - * `remote_read_intra_url` - RemoteRead intranet Url. - * `remote_read_inter_url` - Public Url of remoteRead. - * `remote_write_intra_url` - RemoteWrite Intranet Url. - * `remote_write_inter_url` - RemoteWrite public Url. - * `push_gate_way_intra_url` - PushGateway intranet Url. - * `push_gate_way_inter_url` - PushGateway public network Url. - * `http_api_intra_url` - Http api intranet address. - * `http_api_inter_url` - Http api public network address. - * `auth_token` - The token used to access the data source. + * `remote_read_intra_url` - (Available since v1.214.0) The internal URL for remote read. **Note:** `remote_read_intra_url` takes effect only if `enable_details` is set to `true`. + * `remote_read_inter_url` - (Available since v1.214.0) The public URL for remote read. **Note:** `remote_read_inter_url` takes effect only if `enable_details` is set to `true`. + * `remote_write_intra_url` - (Available since v1.214.0) The internal URL for remote write. **Note:** `remote_write_intra_url` takes effect only if `enable_details` is set to `true`. + * `remote_write_inter_url` - (Available since v1.214.0) The public URL for remote write. **Note:** `remote_write_inter_url` takes effect only if `enable_details` is set to `true`. + * `push_gate_way_intra_url` - (Available since v1.214.0) The internal URL for Pushgateway. **Note:** `push_gate_way_intra_url` takes effect only if `enable_details` is set to `true`. + * `push_gate_way_inter_url` - (Available since v1.214.0) The public URL for Pushgateway. **Note:** `push_gate_way_inter_url` takes effect only if `enable_details` is set to `true`. + * `http_api_intra_url` - (Available since v1.214.0) The internal URL for the HTTP API. **Note:** `http_api_intra_url` takes effect only if `enable_details` is set to `true`. + * `http_api_inter_url` - (Available since v1.214.0) The public URL for the HTTP API. **Note:** `http_api_inter_url` takes effect only if `enable_details` is set to `true`. + * `auth_token` - (Available since v1.214.0) The authorization token. **Note:** `auth_token` takes effect only if `enable_details` is set to `true`. * `tags` - The tag of the Prometheus. \ No newline at end of file