Skip to content

Commit

Permalink
Merge pull request proppy#19 from GoogleCloudPlatform/data-science-up…
Browse files Browse the repository at this point in the history
…grade

Data science upgrade (deploy in existing project/networks)
  • Loading branch information
guptamukul-google authored Nov 16, 2021
2 parents 25b1cae + 439ca19 commit 7d70304
Show file tree
Hide file tree
Showing 7 changed files with 380 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ terraform.tfvars
*.lock.hcl
elk/
test/**
**/deployments
**/deployments
96 changes: 96 additions & 0 deletions modules/data_science/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions modules/data_science/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,79 @@ The lab need to be deployed by a _Cloud Admin_ persona with the following GCP ro
* `Storage Object Viewer`
* [OPTIONAL] `Organization Policy Administrator`

## Using Terraform module
Here are a couple of examples to use the module directly in your Terraform code, as opposed to using the RAD Lab Launcher.

### Simple

```hcl
module "simple" {
source = "./modules/data_science"
billing_account_id = "123456-123456-123465"
organization_id = "12345678901"
folder_id = "1234567890"
}
```
### Use existing project

Make sure the identity running the Terraform code has the following IAM permissions on the project:
* `roles/compute.admin`
* `roles/resourcemanager.projectIamAdmin`
* `roles/iam.serviceAccountAdmin`
* `roles/storage.admin`
* `roles/notebooks.admin`

This example assumes that all the necessary APIs have been enabled as well.

````hcl
module "existing_project" {
source = "./modules/data_science"
billing_account_id = "123456-123456-123465"
organization_id = "12345678901"
folder_id = "1234567890"
create_project = false
project_name = "ds-project-id"
enable_services = false
set_external_ip_policy = false
set_shielded_vm_policy = false
set_trustedimage_project_policy = false
}
````

### Existing network
Make sure the identity running the Terraform code has the following IAM permissions on the project:
* `roles/resourcemanager.projectIamAdmin`
* `roles/iam.serviceAccountAdmin`
* `roles/storage.admin`
* `roles/notebooks.admin`

```hcl
module "existing_project_and_network" {
source = "./modules/data_science"
billing_account_id = "123456-123456-123465"
organization_id = "12345678901"
folder_id = "1234567890"
create_project = false
project_name = "ds-project-id"
enable_services = false
enable_services = false
create_network = false
network_name = "data-science-network"
subnet_name = "data-science-subnetwork"
set_external_ip_policy = false
set_shielded_vm_policy = false
set_trustedimage_project_policy = false
}
```

<!-- BEGIN TFDOC -->
## Variables

Expand Down
Loading

0 comments on commit 7d70304

Please sign in to comment.