Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.48.0
rev: v1.60.0
hooks:
- id: terraform_fmt
- id: terraform_tflint
Expand All @@ -14,18 +14,24 @@ repos:
- '--args=--only=terraform_typed_variables'
- '--args=--only=terraform_module_pinned_source'
- '--args=--only=terraform_naming_convention'
- '--args=--only=terraform_required_providers'
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml
- id: debug-statements
- id: double-quote-string-fixer
- id: name-tests-test
- id: requirements-txt-fixer

- repo: https://github.com/bridgecrewio/checkov.git
rev: '2.0.868'
rev: '2.0.914'
hooks:
- id: checkov
verbose: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Error: MALFORMED_REQUEST: Failed credentials validation checks: Spot Cancellatio
| <a name="input_existing_role_name"></a> [existing\_role\_name](#input\_existing\_role\_name) | If you want to use existing role name, else a new role will be created | `string` | `null` | no |
| <a name="input_prjid"></a> [prjid](#input\_prjid) | Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply' | `string` | n/a | yes |
| <a name="input_profile_for_iam"></a> [profile\_for\_iam](#input\_profile\_for\_iam) | profile to use for IAM | `string` | `null` | no |
| <a name="input_profile_to_use"></a> [profile\_to\_use](#input\_profile\_to\_use) | Getting values from ~/.aws/credentials | `string` | `"default"` | no |
| <a name="input_profile"></a> [profile\_to\_use](#input\_profile\_to\_use) | Getting values from ~/.aws/credentials | `string` | `"default"` | no |
| <a name="input_teamid"></a> [teamid](#input\_teamid) | Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply' | `string` | n/a | yes |

## Outputs
Expand Down
15 changes: 12 additions & 3 deletions examples/sample/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
terraform {
required_version = ">= 1.0.1"
required_providers {
aws = {
version = "~> 3.63"
}
}
}

provider "aws" {
region = "us-west-2"
region = var.aws_region
}

module "databricks_workspace" {
Expand All @@ -9,8 +18,8 @@ module "databricks_workspace" {
# - 'profile_for_iam' - for IAM creation (if none is provided 'default' is used)
# - 'existing_role_name'
profile_for_iam = "iam-admin"
#existing_role_name = "arn:aws:iam::123456789012:role/demo-role"
aws_region = "us-east-1"
#existing_role_name = "arn:aws:iam::123456789012:role/demo-role"
aws_region = var.aws_region
databricks_account_username = "example@example.com"
databricks_account_password = "sample123!"
databricks_account_id = "1234567-1234-1234-1234-1234567"
Expand Down
6 changes: 6 additions & 0 deletions examples/sample/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ variable "prjid" {
description = "Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply'"
type = string
}

variable "aws_region" {
description = "AWS region to deploy resources"
type = string
default = "us-west-2"
}
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
profile_to_use = var.profile_for_iam != null ? var.profile_for_iam : var.profile_to_use
profile = var.profile_for_iam != null ? var.profile_for_iam : var.profile
}
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variable "prjid" {
type = string
}

variable "profile_to_use" {
variable "profile" {
description = "Getting values from ~/.aws/credentials"
type = string
default = "default"
Expand Down
8 changes: 4 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ terraform {
required_version = ">= 1.0.1"
required_providers {
aws = {
version = "~> 3.47"
version = "~> 3.63"
}
databricks = {
source = "databrickslabs/databricks"
version = "0.4.7"
version = "0.5.1"
}
random = {
version = "~> 3.1"
Expand All @@ -19,14 +19,14 @@ terraform {

provider "aws" {
region = var.aws_region
profile = var.profile_to_use
profile = var.profile
}

provider "aws" {
alias = "iam-management"

region = var.aws_region
profile = local.profile_to_use
profile = local.profile
}

# initialize provider in "MWS" mode to provision new workspace
Expand Down