terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

add support for gcp network info block

Open stikkireddy opened this issue 3 years ago • 7 comments
trafficstars

  • [ ] create doc updates/guide updates
  • [ ] run acceptance tests for aws
  • [ ] test creating mws for aws with 1.0.2 and then upgrade and see impact on previous state
  • [x] unit tests

Attempts to resolve #1393

byovpc example:

resource "google_compute_network" "dbx_private_vpc" {
  project                 = var.google_project
  name                    = "sri-tf-network"
  auto_create_subnetworks = false
#  mtu                     = 1460
}

resource "google_compute_subnetwork" "network-with-private-secondary-ip-ranges" {
  name          = "test-dbx"
  ip_cidr_range = "10.0.0.0/16"
  region        = "us-central1"
  network       = google_compute_network.dbx_private_vpc.id
  secondary_ip_range {
    range_name    = "pods"
    ip_cidr_range = "10.1.0.0/16"
  }
  secondary_ip_range {
    range_name    = "svc"
    ip_cidr_range = "10.2.0.0/20"
  }
}

resource "databricks_mws_networks" "this" {
  provider       = databricks.accounts
  account_id     = var.databricks_account_id
  network_name = "sri-test-fs-demo"
  gcp_network_info {
    network_project_id = var.google_project
    vpc_id = google_compute_network.dbx_private_vpc.name
    subnet_id = google_compute_subnetwork.network-with-private-secondary-ip-ranges.name
    subnet_region = google_compute_subnetwork.network-with-private-secondary-ip-ranges.region
    pod_ip_range_name = "pods"
    service_ip_range_name = "svc"
  }
}

stikkireddy avatar Jul 19 '22 16:07 stikkireddy

Codecov Report

Merging #1479 (fbb2d12) into master (ccf3099) will decrease coverage by 0.03%. The diff coverage is 73.91%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1479      +/-   ##
==========================================
- Coverage   90.02%   89.98%   -0.04%     
==========================================
  Files         135      135              
  Lines       10836    10859      +23     
==========================================
+ Hits         9755     9772      +17     
- Misses        692      696       +4     
- Partials      389      391       +2     
Impacted Files Coverage Δ
mws/resource_mws_workspaces.go 90.15% <ø> (ø)
common/reflect_resource.go 90.09% <66.66%> (-1.04%) :arrow_down:
mws/resource_mws_networks.go 83.60% <100.00%> (+1.46%) :arrow_up:

codecov-commenter avatar Jul 19 '22 17:07 codecov-commenter

Thank you for the example, will also add the BYOVPC to integration testing infra.

nfx avatar Jul 19 '22 23:07 nfx

@stikkireddy could you also remove TEST_PREFIX env variable in the other gcp test? =)

nfx avatar Jul 20 '22 19:07 nfx

@stikkireddy / @nfx is this still active?

redcape avatar Aug 26 '22 15:08 redcape

@stikkireddy any updates from GCP team?

nfx avatar Aug 29 '22 14:08 nfx

okay, we can live without full "read" implementation, so that we can release this faster

nfx avatar Aug 29 '22 14:08 nfx

I can pick this up next week and ignore the changes

stikkireddy avatar Sep 09 '22 15:09 stikkireddy

@nfx please close this PR i am submitting another smaller PR. Eng has resolved the drift issue please close this for preference of managing the changes at #1748

stikkireddy avatar Nov 10 '22 15:11 stikkireddy

@stikkireddy i think you can close the PR yourself if needed ;)

nfx avatar Nov 10 '22 17:11 nfx