3535
3636## Versions
3737
38- - Module tested for Terraform 0.14 .
39- - ` databrickslabs/databricks ` provider version [ 0.3.3 ] ( https://registry.terraform.io/providers/databrickslabs/databricks/latest )
40- - AWS provider version [ 3.30 ] ( https://registry.terraform.io/providers/hashicorp/aws/latest ) .
38+ - Module tested for Terraform 1.0.1 .
39+ - ` databrickslabs/databricks ` provider version [ 0.3.5 ] ( https://registry.terraform.io/providers/databrickslabs/databricks/latest )
40+ - AWS provider version [ 3.47 ] ( https://registry.terraform.io/providers/hashicorp/aws/latest ) .
4141- ` main ` branch: Provider versions not pinned to keep up with Terraform releases.
4242- ` tags ` releases: Tags are pinned with versions (use <a href =" https://github.com/tomarv2/terraform-databricks-aws-workspace/tags " alt =" GitHub tag " >
4343 <img src =" https://img.shields.io/github/v/tag/tomarv2/terraform-databricks-aws-workspace " /></a >).
@@ -57,7 +57,7 @@ terraform destroy -var='teamid=tryme' -var='prjid=project1'
5757
5858### Option 2:
5959
60- #### Recommended method (store remote state in S3 using ` prjid ` and ` teamid ` to create directory structure):
60+ #### Recommended method (stores remote state in S3 using ` prjid ` and ` teamid ` to create directory structure):
6161
6262- Create python 3.6+ virtual environment
6363```
@@ -66,41 +66,55 @@ python3 -m venv <venv name>
6666
6767- Install package:
6868```
69- pip install tfremote
69+ pip install tfremote --upgrade
7070```
7171
7272- Set below environment variables:
7373```
7474export TF_AWS_BUCKET=<remote state bucket name>
75- export TF_AWS_PROFILE=default
7675export TF_AWS_BUCKET_REGION=us-west-2
76+ export TF_AWS_PROFILE=<profile from ~/.ws/credentials>
7777```
7878
79- - Updated ` examples ` directory with required values.
79+ or
80+
81+ - Set below environment variables:
82+ ```
83+ export TF_AWS_BUCKET=<remote state bucket name>
84+ export TF_AWS_BUCKET_REGION=us-west-2
85+ export AWS_ACCESS_KEY_ID=<aws_access_key_id>
86+ export AWS_SECRET_ACCESS_KEY=<aws_secret_access_key>
87+ ```
88+
89+ - Update [ main.tf] ( examples/sample/main.tf ) file with required values.
8090
8191- Run and verify the output before deploying:
8292```
83- tf -cloud aws plan -var='teamid=foo' -var='prjid=bar'
93+ tf -c= aws plan -var='teamid=foo' -var='prjid=bar'
8494```
8595
8696- Run below to deploy:
8797```
88- tf -cloud aws apply -var='teamid=foo' -var='prjid=bar'
98+ tf -c= aws apply -var='teamid=foo' -var='prjid=bar'
8999```
90100
91101- Run below to destroy:
92102```
93- tf -cloud aws destroy -var='teamid=foo' -var='prjid=bar'
103+ tf -c= aws destroy -var='teamid=foo' -var='prjid=bar'
94104```
95105
96106** NOTE:**
97107
98108- Read more on [ tfremote] ( https://github.com/tomarv2/tfremote )
99109
110+ ### Databricks workspace creation with new role
100111```
101112module "databricks_workspace" {
102113 source = "git::git@github.com:tomarv2/terraform-databricks-aws-workspace.git"
103114
115+ # NOTE: One of the below is required:
116+ # - 'profile_for_iam' - for IAM creation (if none is provided 'default' is used)
117+ # - 'existing_role_name'
104118 profile_for_iam = "iam-admin"
105119 aws_region = "us-east-2"
106120 databricks_account_username = "example@example.com"
@@ -113,6 +127,26 @@ module "databricks_workspace" {
113127}
114128```
115129
130+ ### Databricks workspace creation with existing role
131+ ```
132+ module "databricks_workspace" {
133+ source = "git::git@github.com:tomarv2/terraform-databricks-aws-workspace.git"
134+
135+ # NOTE: One of the below is required:
136+ # - 'profile_for_iam' - for IAM creation (if none is provided 'default' is used)
137+ # - 'existing_role_name'
138+ existing_role_arn = "arn:aws:iam::123456789012:role/demo-role"
139+ aws_region = "us-east-2"
140+ databricks_account_username = "example@example.com"
141+ databricks_account_password = "sample123!"
142+ databricks_account_id = "1234567-1234-1234-1234-1234567"
143+ # -----------------------------------------
144+ # Do not change the teamid, prjid once set.
145+ teamid = var.teamid
146+ prjid = var.prjid
147+ }
148+ ```
149+
116150Please refer to examples directory [ link] ( examples ) for references.
117151
118152## Coming up:
0 commit comments