This terraform script is used to setup Unity Metastore, assign workspaces, create storage credentials and create external locations.
This script assumes that prerequisites such as storage account,storage containers etc are already created.
Current config stores the terraform state on adls. Please amend backend section in providers.tf file as per user's requirement.
It consists of following sections:
- meta-setup
- env-setup
This section is expected to be executed once to setup unity metatsore
This section will create access connector and assign 'Storage Blob Data Contributor' role to access connector on meta account provided user executing the script has the required accesses.
If access connector already exists then it can be provided by setting following variables:
existing_access_connector_id ="<access-connector-resource-id>"
access_connector_exist = true
Please refer to variables file and provide required values. User can refer to meta.tfvars file for the sample values
This section is expected to be executed once per each environment
This section will assign workspaces to the metastore, create storage credential for env and create external locations.
Please efer to variables file and required values. User can refer to dev.tfvars file for the sample values
terraform init - To initialize terraform config
terraform validate - To validate terraform config
terraform workspace new <workspace-name> - To create new workspace
It is recommended to create one workspace per env. It helps to keep the states of workspaces isolated
terraform plan --var-file=<path-of-var-file> - To run terraform plan
terraform apply --var-file=<path-of-var-file> - To deploy resources
terraform destroy --var-file=<path-of-var-file> - To destroy resources
terraform refresh --var-file=<path-of-var-file> - To refresh state