Skip to content

Commit

Permalink
dev: resolve all tflint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Aug 13, 2023
1 parent cd51c7f commit 17ba6fd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
&& terraform version \
&& rm terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip

# install tflint
RUN curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash

# install docker
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/

Expand Down
8 changes: 4 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Terraform",
"dockerFile": "Dockerfile",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.0.1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2.3.0": {}
},
"mounts": [
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
Expand Down Expand Up @@ -37,8 +37,8 @@
"hashicorp.terraform",
"ms-azuretools.vscode-docker",
"tsandall.opa",
"VisualStudioExptTeam.vscodeintellicode",
],
"VisualStudioExptTeam.vscodeintellicode"
]
}
},
}
}
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ clean:
@find . -type d -name ".tfstate" -exec rm -rf {} +
@find . -type d -name ".tfstate.backup" -exec rm -rf {} +
@touch .devcontainer/.terraform.d/.gitkeep || true

lint:
@tflint
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locals {
auth_service_enabled = local.enabled && var.auth_service_config.enabled
urlrewrite_service_enabled = local.enabled && var.urlrewrite_service_config.enabled

aws_account_id = try(coalesce(var.aws_account_id, data.aws_caller_identity.current[0].account_id), "")
aws_account_id = try(coalesce(var.aws_account_id, data.aws_caller_identity.current[0].account_id), "") # tflint-ignore: terraform_unused_declarations
aws_region_name = try(coalesce(var.aws_region_name, data.aws_region.current[0].name), "")

service_config = {
Expand Down
4 changes: 4 additions & 0 deletions version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ terraform {
source = "kreuzwerker/docker"
version = ">= 3.0.0, < 4.0.0"
}
random = {
source = "hashicorp/random"
version = ">= 3.5.1"
}
}
}

0 comments on commit 17ba6fd

Please sign in to comment.