Skip to content

Commit 228484b

Browse files
committed
moving away from profile_to_use
1 parent e44ae0f commit 228484b

File tree

7 files changed

+35
-14
lines changed

7 files changed

+35
-14
lines changed

.pre-commit-config.yaml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.48.0
3+
rev: v1.60.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_tflint
@@ -14,18 +14,24 @@ repos:
1414
- '--args=--only=terraform_typed_variables'
1515
- '--args=--only=terraform_module_pinned_source'
1616
- '--args=--only=terraform_naming_convention'
17+
- '--args=--only=terraform_required_providers'
18+
- '--args=--only=terraform_standard_module_structure'
1719
- '--args=--only=terraform_workspace_remote'
1820

1921
- repo: https://github.com/pre-commit/pre-commit-hooks
20-
rev: v3.4.0
22+
rev: v4.1.0
2123
hooks:
2224
- id: trailing-whitespace
23-
- id: check-merge-conflict
2425
- id: end-of-file-fixer
26+
- id: check-docstring-first
2527
- id: check-yaml
28+
- id: debug-statements
29+
- id: double-quote-string-fixer
30+
- id: name-tests-test
31+
- id: requirements-txt-fixer
2632

2733
- repo: https://github.com/bridgecrewio/checkov.git
28-
rev: '2.0.868'
34+
rev: '2.0.914'
2935
hooks:
3036
- id: checkov
3137
verbose: true

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Error: MALFORMED_REQUEST: Failed credentials validation checks: Spot Cancellatio
229229
| <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 |
230230
| <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 |
231231
| <a name="input_profile_for_iam"></a> [profile\_for\_iam](#input\_profile\_for\_iam) | profile to use for IAM | `string` | `null` | no |
232-
| <a name="input_profile_to_use"></a> [profile\_to\_use](#input\_profile\_to\_use) | Getting values from ~/.aws/credentials | `string` | `"default"` | no |
232+
| <a name="input_profile"></a> [profile\_to\_use](#input\_profile\_to\_use) | Getting values from ~/.aws/credentials | `string` | `"default"` | no |
233233
| <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 |
234234

235235
## Outputs

examples/sample/main.tf

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
terraform {
2+
required_version = ">= 1.0.1"
3+
required_providers {
4+
aws = {
5+
version = "~> 3.63"
6+
}
7+
}
8+
}
9+
110
provider "aws" {
2-
region = "us-west-2"
11+
region = var.aws_region
312
}
413

514
module "databricks_workspace" {
@@ -9,8 +18,8 @@ module "databricks_workspace" {
918
# - 'profile_for_iam' - for IAM creation (if none is provided 'default' is used)
1019
# - 'existing_role_name'
1120
profile_for_iam = "iam-admin"
12-
#existing_role_name = "arn:aws:iam::123456789012:role/demo-role"
13-
aws_region = "us-east-1"
21+
#existing_role_name = "arn:aws:iam::123456789012:role/demo-role"
22+
aws_region = var.aws_region
1423
databricks_account_username = "[email protected]"
1524
databricks_account_password = "sample123!"
1625
databricks_account_id = "1234567-1234-1234-1234-1234567"

examples/sample/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ variable "prjid" {
77
description = "Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply'"
88
type = string
99
}
10+
11+
variable "aws_region" {
12+
description = "AWS region to deploy resources"
13+
type = string
14+
default = "us-west-2"
15+
}

locals.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
locals {
2-
profile_to_use = var.profile_for_iam != null ? var.profile_for_iam : var.profile_to_use
2+
profile = var.profile_for_iam != null ? var.profile_for_iam : var.profile
33
}

variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ variable "prjid" {
88
type = string
99
}
1010

11-
variable "profile_to_use" {
11+
variable "profile" {
1212
description = "Getting values from ~/.aws/credentials"
1313
type = string
1414
default = "default"

versions.tf

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ terraform {
22
required_version = ">= 1.0.1"
33
required_providers {
44
aws = {
5-
version = "~> 3.47"
5+
version = "~> 3.63"
66
}
77
databricks = {
88
source = "databrickslabs/databricks"
9-
version = "0.4.7"
9+
version = "0.5.1"
1010
}
1111
random = {
1212
version = "~> 3.1"
@@ -19,14 +19,14 @@ terraform {
1919

2020
provider "aws" {
2121
region = var.aws_region
22-
profile = var.profile_to_use
22+
profile = var.profile
2323
}
2424

2525
provider "aws" {
2626
alias = "iam-management"
2727

2828
region = var.aws_region
29-
profile = local.profile_to_use
29+
profile = local.profile
3030
}
3131

3232
# initialize provider in "MWS" mode to provision new workspace

0 commit comments

Comments
 (0)