Skip to content

Commit

Permalink
Updated documentation with additional examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjorn De Bakker committed Nov 12, 2021
1 parent 9197275 commit e47dd18
Showing 1 changed file with 73 additions and 0 deletions.
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

0 comments on commit e47dd18

Please sign in to comment.