Skip to content

Commit

Permalink
Renamed TEST_AWS_ACCOUNT_ID to AWS_ACCOUNT_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
nfx committed Jul 20, 2022
1 parent 523160b commit 6bc1f44
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion mws/acceptance/mws_private_access_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}`,
},
})
Expand Down
4 changes: 2 additions & 2 deletions mws/acceptance/mws_vpc_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}`,
},
})
Expand Down
2 changes: 1 addition & 1 deletion mws/acceptance/mws_workspaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mws/resource_mws_private_access_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion mws/resource_mws_vpc_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`).
Expand Down
2 changes: 1 addition & 1 deletion scripts/awsmt-integration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion scripts/awsmt-integration/require_env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DATABRICKS_ACCOUNT_ID
DATABRICKS_USERNAME
DATABRICKS_PASSWORD
TEST_REGION
AWS_REGION
TEST_CIDR
OWNER
12 changes: 6 additions & 6 deletions scripts/mws-integration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/mws-integration/require_env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DATABRICKS_ACCOUNT_ID
DATABRICKS_USERNAME
DATABRICKS_PASSWORD
TEST_REGION
AWS_REGION
TEST_CIDR
OWNER
2 changes: 1 addition & 1 deletion scripts/nightly/main.tf
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down

0 comments on commit 6bc1f44

Please sign in to comment.