diff --git a/newrelic/data_source_newrelic_entity_integration_test.go b/newrelic/data_source_newrelic_entity_integration_test.go index 8fc28ed343..b5226f4f75 100644 --- a/newrelic/data_source_newrelic_entity_integration_test.go +++ b/newrelic/data_source_newrelic_entity_integration_test.go @@ -14,6 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) +var alternateSubAccountID = 3957524 + func TestAccNewRelicEntityData_Basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -90,9 +92,9 @@ func TestAccNewRelicEntityData_EntityInSubAccount(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccNewRelicEntityDataConfig_EntityInSubAccount("Dummy App Two", 3957524), + Config: testAccNewRelicEntityDataConfig_EntityInSubAccount("Dummy App Two", alternateSubAccountID), Check: resource.ComposeTestCheckFunc( - testAccCheckNewRelicEntityDataExists(t, "data.newrelic_entity.entity", "Dummy App Two", 3957524), + testAccCheckNewRelicEntityDataExists(t, "data.newrelic_entity.entity", "Dummy App Two", alternateSubAccountID), ), }, }, @@ -107,7 +109,7 @@ func TestAccNewRelicEntityData_EntityAbsentInSubAccount(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccNewRelicEntityDataConfig_EntityInSubAccount("Dummy App Two", 3814156), + Config: testAccNewRelicEntityDataConfig_EntityInSubAccount("Dummy App Two", testSubAccountID), ExpectError: regexp.MustCompile(`no entities found`), }, }, @@ -122,9 +124,9 @@ func TestAccNewRelicEntityData_RetrieveSubAccountEntity(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccNewRelicEntityDataConfig_RetrieveSubAccountEntity("Dummy App Two", 3957524), + Config: testAccNewRelicEntityDataConfig_RetrieveSubAccountEntity("Dummy App Two", alternateSubAccountID), Check: resource.ComposeTestCheckFunc( - testAccCheckNewRelicEntityDataExists(t, "data.newrelic_entity.entity", "Dummy App Two", 3957524), + testAccCheckNewRelicEntityDataExists(t, "data.newrelic_entity.entity", "Dummy App Two", alternateSubAccountID), ), }, }, @@ -139,7 +141,7 @@ func TestAccNewRelicEntityData_RetrieveAbsentSubAccountEntity(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccNewRelicEntityDataConfig_RetrieveSubAccountEntity("Dummy App Two", 3814156), + Config: testAccNewRelicEntityDataConfig_RetrieveSubAccountEntity("Dummy App Two", testSubAccountID), ExpectError: regexp.MustCompile(`no entities found`), }, }, diff --git a/newrelic/resource_newrelic_one_dashboard_raw_test.go b/newrelic/resource_newrelic_one_dashboard_raw_test.go index 8a80451b51..fdbab0ccba 100644 --- a/newrelic/resource_newrelic_one_dashboard_raw_test.go +++ b/newrelic/resource_newrelic_one_dashboard_raw_test.go @@ -158,7 +158,7 @@ func testAccCheckNewRelicOneDashboardRawConfig_PageFull(pageName string, account ] } ) - linked_entity_guids = ["MzI5ODAxNnxWSVp8REFTSEJPQVJEfDI2MTcxNDc"] + linked_entity_guids = ["MzgwNjUyNnxWSVp8REFTSEJPQVJEfGRhOjI5Mjk0MjA"] } } ` diff --git a/newrelic/resource_newrelic_one_dashboard_test.go b/newrelic/resource_newrelic_one_dashboard_test.go index ffab5b654f..f7ca16e579 100644 --- a/newrelic/resource_newrelic_one_dashboard_test.go +++ b/newrelic/resource_newrelic_one_dashboard_test.go @@ -79,7 +79,7 @@ func TestAccNewRelicOneDashboard_CrossAccountQueries(t *testing.T) { Steps: []resource.TestStep{ // Test: Create { - Config: testAccCheckNewRelicOneDashboardConfig_TwoPageBasic(rName, "3814156"), // Hard-coded accountID for NRQL queries + Config: testAccCheckNewRelicOneDashboardConfig_TwoPageBasic(rName, strconv.Itoa(testSubAccountID)), // Hard-coded accountID for NRQL queries Check: resource.ComposeTestCheckFunc( testAccCheckNewRelicOneDashboardExists("newrelic_one_dashboard.bar", 0), ), @@ -792,7 +792,7 @@ func testAccCheckNewRelicOneDashboardConfig_VariableNRQL() string { } name = "variable" nrql_query { - account_ids = [3806526] + account_ids = [` + strconv.Itoa(testAccountID) + `] query = "FROM Transaction SELECT average(duration) FACET appName" } replacement_strategy = "default" @@ -813,7 +813,7 @@ func testAccCheckNewRelicOneDashboardConfig_VariableNRQLUpdated() string { } name = "variableUpdated" nrql_query { - account_ids = [3806526, 3814156] + account_ids = [` + strconv.Itoa(testAccountID) + `,` + strconv.Itoa(testSubAccountID) + `] query = "FROM Transaction SELECT average(duration) FACET appName" } replacement_strategy = "default" diff --git a/website/docs/r/cloud_aws_govcloud_integrations.html.markdown b/website/docs/r/cloud_aws_govcloud_integrations.html.markdown index 3d0881cf24..d10b6230c1 100644 --- a/website/docs/r/cloud_aws_govcloud_integrations.html.markdown +++ b/website/docs/r/cloud_aws_govcloud_integrations.html.markdown @@ -22,139 +22,139 @@ To pull data from AWSGovCloud, complete the [steps outlined here](https://docs.n ## Example Usage ```hcl -resource "newrelic_cloud_awsGovcloud_link_account" "account" { - access_key_id ="%[1]s" - aws_account_id="%[2]s" +resource "newrelic_cloud_aws_govcloud_link_account" "account" { + access_key_id = "%[1]s" + aws_account_id = "%[2]s" metric_collection_mode = "PULL" - name = "%[4]s" - secret_access_key = "%[3]s" + name = "%[4]s" + secret_access_key = "%[3]s" } resource "newrelic_cloud_aws_govcloud_integrations" "foo" { - account_id=3806526 - linked_account_id=newrelic_cloud_awsGovcloud_link_account.account.id - alb{ - metrics_polling_interval=1000 - aws_regions=["us-east-1"] - fetch_extended_inventory=true - fetch_tags=true - load_balancer_prefixes=[""] - tag_key="" - tag_value="" + account_id = 1234321 + linked_account_id = newrelic_cloud_awsGovcloud_link_account.account.id + alb { + metrics_polling_interval = 1000 + aws_regions = ["us-east-1"] + fetch_extended_inventory = true + fetch_tags = true + load_balancer_prefixes = [""] + tag_key = "" + tag_value = "" } - api_gateway{ - metrics_polling_interval=1000 - aws_regions=[""] - stage_prefixes=[""] - tag_key="" - tag_value="" + api_gateway { + metrics_polling_interval = 1000 + aws_regions = [""] + stage_prefixes = [""] + tag_key = "" + tag_value = "" } - auto_scaling{ - metrics_polling_interval=1000 - aws_regions=[""] + auto_scaling { + metrics_polling_interval = 1000 + aws_regions = [""] } - aws_direct_connect{ - metrics_polling_interval=1000 - aws_regions=[""] + aws_direct_connect { + metrics_polling_interval = 1000 + aws_regions = [""] } - aws_states{ - metrics_polling_interval=1000 - aws_regions=[""] + aws_states { + metrics_polling_interval = 1000 + aws_regions = [""] } - cloudtrail{ - metrics_polling_interval=1000 - aws_regions=[""] + cloudtrail { + metrics_polling_interval = 1000 + aws_regions = [""] } - dynamo_db{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_extended_inventory=true - fetch_tags=true - tag_key="" - tag_value="" + dynamo_db { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_extended_inventory = true + fetch_tags = true + tag_key = "" + tag_value = "" } - ebs{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_extended_inventory=true - tag_key="" - tag_value="" + ebs { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_extended_inventory = true + tag_key = "" + tag_value = "" } - ec2{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_ip_addresses=true - tag_key="" - tag_value="" + ec2 { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_ip_addresses = true + tag_key = "" + tag_value = "" } - elastic_search{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_nodes=true - tag_key="" - tag_value="" + elastic_search { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_nodes = true + tag_key = "" + tag_value = "" } - elb{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_extended_inventory=true - fetch_tags=true + elb { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_extended_inventory = true + fetch_tags = true } - emr{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_tags=true - tag_key="" - tag_value="" + emr { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_tags = true + tag_key = "" + tag_value = "" } - iam{ - metrics_polling_interval=1000 - tag_key="" - tag_value="" + iam { + metrics_polling_interval = 1000 + tag_key = "" + tag_value = "" } - lambda{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_tags=true - tag_key="" - tag_value="" + lambda { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_tags = true + tag_key = "" + tag_value = "" } - rds{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_tags=true - tag_key="" - tag_value="" + rds { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_tags = true + tag_key = "" + tag_value = "" } - red_shift{ - metrics_polling_interval=1000 - aws_regions=[""] - tag_key="" - tag_value="" + red_shift { + metrics_polling_interval = 1000 + aws_regions = [""] + tag_key = "" + tag_value = "" } - route53{ - metrics_polling_interval=1000 - fetch_extended_inventory=true + route53 { + metrics_polling_interval = 1000 + fetch_extended_inventory = true } - s3{ - metrics_polling_interval=1000 - fetch_extended_inventory=true - fetch_tags=true - tag_key="" - tag_value="" + s3 { + metrics_polling_interval = 1000 + fetch_extended_inventory = true + fetch_tags = true + tag_key = "" + tag_value = "" } - sns{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_extended_inventory=true + sns { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_extended_inventory = true } - sqs{ - metrics_polling_interval=1000 - aws_regions=[""] - fetch_extended_inventory=true - fetch_tags=true - queue_prefixes=[""] - tag_key="" - tag_value="" + sqs { + metrics_polling_interval = 1000 + aws_regions = [""] + fetch_extended_inventory = true + fetch_tags = true + queue_prefixes = [""] + tag_key = "" + tag_value = "" } } ```