From 6bc1f449f3823bc8b4620f56442f3a14843a9fb9 Mon Sep 17 00:00:00 2001 From: Serge Smertin Date: Wed, 20 Jul 2022 17:21:14 +0200 Subject: [PATCH] Renamed `TEST_AWS_ACCOUNT_ID` to `AWS_ACCOUNT_ID` --- mws/acceptance/mws_private_access_settings_test.go | 2 +- mws/acceptance/mws_vpc_endpoint_test.go | 4 ++-- mws/acceptance/mws_workspaces_test.go | 2 +- mws/resource_mws_private_access_settings_test.go | 2 +- mws/resource_mws_vpc_endpoint_test.go | 2 +- scripts/README.md | 2 +- scripts/awsmt-integration/main.tf | 2 +- scripts/awsmt-integration/require_env | 2 +- scripts/mws-integration/main.tf | 12 ++++++------ scripts/mws-integration/require_env | 2 +- scripts/nightly/main.tf | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mws/acceptance/mws_private_access_settings_test.go b/mws/acceptance/mws_private_access_settings_test.go index d0c0a6e1b4..c73b082aff 100644 --- a/mws/acceptance/mws_private_access_settings_test.go +++ b/mws/acceptance/mws_private_access_settings_test.go @@ -18,7 +18,7 @@ func TestMwsAccPrivateAccessSettings(t *testing.T) { resource "databricks_mws_private_access_settings" "this" { account_id = "{env.DATABRICKS_ACCOUNT_ID}" private_access_settings_name = "tf-{var.RANDOM}" - region = "{env.TEST_REGION}" + region = "{env.AWS_REGION}" }`, }, }) diff --git a/mws/acceptance/mws_vpc_endpoint_test.go b/mws/acceptance/mws_vpc_endpoint_test.go index 440e04591e..065e2691b6 100644 --- a/mws/acceptance/mws_vpc_endpoint_test.go +++ b/mws/acceptance/mws_vpc_endpoint_test.go @@ -18,9 +18,9 @@ func TestMwsAccVpcEndpoint(t *testing.T) { resource "databricks_mws_vpc_endpoint" "this" { account_id = "{env.DATABRICKS_ACCOUNT_ID}" vpc_endpoint_name = "tf-{var.RANDOM}" - region = "{env.TEST_REGION}" + region = "{env.AWS_REGION}" aws_vpc_endpoint_id = "{env.TEST_RELAY_VPC_ENDPOINT}" - aws_account_id = "{env.TEST_AWS_ACCOUNT_ID}" + aws_account_id = "{env.AWS_ACCOUNT_ID}" }`, }, }) diff --git a/mws/acceptance/mws_workspaces_test.go b/mws/acceptance/mws_workspaces_test.go index e39614206c..944c59dffb 100644 --- a/mws/acceptance/mws_workspaces_test.go +++ b/mws/acceptance/mws_workspaces_test.go @@ -49,7 +49,7 @@ func TestMwsAccWorkspaces(t *testing.T) { account_id = "{env.DATABRICKS_ACCOUNT_ID}" workspace_name = "terra-{var.RANDOM}" deployment_name = "terra-{var.RANDOM}" - aws_region = "{env.TEST_REGION}" + aws_region = "{env.AWS_REGION}" credentials_id = databricks_mws_credentials.this.credentials_id storage_configuration_id = databricks_mws_storage_configurations.this.storage_configuration_id diff --git a/mws/resource_mws_private_access_settings_test.go b/mws/resource_mws_private_access_settings_test.go index 00bedfceae..5b51a113ad 100644 --- a/mws/resource_mws_private_access_settings_test.go +++ b/mws/resource_mws_private_access_settings_test.go @@ -17,7 +17,7 @@ func TestMwsAccPAS(t *testing.T) { t.Skip("skipping integration test in short mode.") } acctID := qa.GetEnvOrSkipTest(t, "DATABRICKS_ACCOUNT_ID") - awsRegion := qa.GetEnvOrSkipTest(t, "TEST_REGION") + awsRegion := qa.GetEnvOrSkipTest(t, "AWS_REGION") client := common.CommonEnvironmentClient() ctx := context.Background() pasAPI := NewPrivateAccessSettingsAPI(ctx, client) diff --git a/mws/resource_mws_vpc_endpoint_test.go b/mws/resource_mws_vpc_endpoint_test.go index b9797419cd..9914fc0b9c 100644 --- a/mws/resource_mws_vpc_endpoint_test.go +++ b/mws/resource_mws_vpc_endpoint_test.go @@ -20,7 +20,7 @@ func TestMwsAccVPCEndpointIntegration(t *testing.T) { } acctID := qa.GetEnvOrSkipTest(t, "DATABRICKS_ACCOUNT_ID") awsvreID := qa.GetEnvOrSkipTest(t, "TEST_REST_API_VPC_ENDPOINT") - awsRegion := qa.GetEnvOrSkipTest(t, "TEST_REGION") + awsRegion := qa.GetEnvOrSkipTest(t, "AWS_REGION") client := common.CommonEnvironmentClient() ctx := context.Background() vpcEndpointAPI := NewVPCEndpointAPI(ctx, client) diff --git a/scripts/README.md b/scripts/README.md index ded4f95360..fa5821b7b0 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -11,7 +11,7 @@ By default, we don't encourage creation/destruction of infrastructure multiple t * `azcli` - Azure authenticated with `az login` command. No `require_env` file needed. Runnable test name prefixes are `TestAcc` and `TestAzureAcc`. By far, the simplest way to develop provider's functionality. * `azsp` - Azure authenticated with Service Principal's ID/Secret pairs. Runnable test name prefixes are `TestAcc` and `TestAzureAcc`. Service pricipal must have `Storage Blob Data Contributor` role on ADLS account used. `ARM_SUBSCRIPTION_ID`, `ARM_CLIENT_SECRET`, `ARM_CLIENT_ID`, `ARM_TENANT_ID`, `OWNER` environment vars required. Note that these integration tests will use service principal based auth. Even though it is using a service principal, it will still be generating a personal access token to perform creation of resources. -* `mws` - AWS with Databricks Multiworkspace API. Runnable test name prefix is `TestMws`. Please [check if you're able to use it](https://docs.databricks.com/administration-guide/multiworkspace/new-workspace-aws.html). Required variables are `DATABRICKS_ACCOUNT_ID`, `DATABRICKS_USERNAME`, `DATABRICKS_PASSWORD` (something you use for https://accounts.cloud.databricks.com/), `TEST_REGION`, `TEST_CIDR`, `OWNER`. Only multiworkspace resources are tested. +* `mws` - AWS with Databricks Multiworkspace API. Runnable test name prefix is `TestMws`. Please [check if you're able to use it](https://docs.databricks.com/administration-guide/multiworkspace/new-workspace-aws.html). Required variables are `DATABRICKS_ACCOUNT_ID`, `DATABRICKS_USERNAME`, `DATABRICKS_PASSWORD` (something you use for https://accounts.cloud.databricks.com/), `AWS_REGION`, `TEST_CIDR`, `OWNER`. Only multiworkspace resources are tested. * `awsst` - `DATABRICKS_CONFIG_PROFILE` (section within Databricks CLI `~/.databrickscfg` file) & `CLOUD_ENV=AWS`. In case you want to test provider on existing development single-tenant shard. Runnable test name prefixes are `TestAcc` and `TestAwsAcc`. * `awsmt` - AWS with Databricks Multitenant Workspace. Currently work in progress and the test environment cannot be fully started. * most of the tests should aim to be cloud-agnostic. Though, in case of specific branching needed, you can check `CLOUD_ENV` value (possible values are `Azure`, `AWS` & `MWS`). diff --git a/scripts/awsmt-integration/main.tf b/scripts/awsmt-integration/main.tf index b5e618282a..9272c1b619 100644 --- a/scripts/awsmt-integration/main.tf +++ b/scripts/awsmt-integration/main.tf @@ -12,7 +12,7 @@ locals { // dltp - databricks labs terraform provider prefix = "dltp${random_string.naming.result}" cidr_block = data.external.env.result.TEST_CIDR - region = data.external.env.result.TEST_REGION + region = data.external.env.result.AWS_REGION account_id = data.external.env.result.DATABRICKS_ACCOUNT_ID tags = { Environment = "Testing" diff --git a/scripts/awsmt-integration/require_env b/scripts/awsmt-integration/require_env index 08956930a8..1bc7519eb3 100644 --- a/scripts/awsmt-integration/require_env +++ b/scripts/awsmt-integration/require_env @@ -1,6 +1,6 @@ DATABRICKS_ACCOUNT_ID DATABRICKS_USERNAME DATABRICKS_PASSWORD -TEST_REGION +AWS_REGION TEST_CIDR OWNER \ No newline at end of file diff --git a/scripts/mws-integration/main.tf b/scripts/mws-integration/main.tf index d6f1f8fad3..faf9db8cfc 100644 --- a/scripts/mws-integration/main.tf +++ b/scripts/mws-integration/main.tf @@ -14,7 +14,7 @@ resource "random_string" "naming" { locals { // dltp - databricks labs terraform provider prefix = "dltp${random_string.naming.result}" - region = data.external.env.result.TEST_REGION + region = data.external.env.result.AWS_REGION cidr = data.external.env.result.TEST_CIDR tags = { Environment = "Testing" @@ -238,10 +238,14 @@ resource "aws_kms_alias" "customer_managed_key_alias" { data "aws_caller_identity" "current" {} -output "test_aws_account_id" { +output "aws_account_id" { value = data.aws_caller_identity.current.account_id } +output "aws_region" { + value = local.region +} + output "test_rest_api_vpc_endpoint" { value = aws_vpc_endpoint.rest_api.id } @@ -291,10 +295,6 @@ output "test_prefix" { value = local.prefix } -output "test_region" { - value = local.region -} - output "databricks_account_id" { value = data.external.env.result.DATABRICKS_ACCOUNT_ID sensitive = true diff --git a/scripts/mws-integration/require_env b/scripts/mws-integration/require_env index 08956930a8..1bc7519eb3 100644 --- a/scripts/mws-integration/require_env +++ b/scripts/mws-integration/require_env @@ -1,6 +1,6 @@ DATABRICKS_ACCOUNT_ID DATABRICKS_USERNAME DATABRICKS_PASSWORD -TEST_REGION +AWS_REGION TEST_CIDR OWNER \ No newline at end of file diff --git a/scripts/nightly/main.tf b/scripts/nightly/main.tf index 0bf526d5fc..b4e835cdab 100644 --- a/scripts/nightly/main.tf +++ b/scripts/nightly/main.tf @@ -1,7 +1,7 @@ locals { prefix = "dltp${random_string.naming.result}" cidr_block = data.external.env.result.TEST_CIDR - region = data.external.env.result.TEST_REGION + region = data.external.env.result.AWS_REGION account_id = data.external.env.result.DATABRICKS_ACCOUNT_ID tags = azurerm_resource_group.this.tags }