Skip to content

Commit

Permalink
test: lint tf files
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Aug 10, 2023
1 parent 5d02521 commit 637c74e
Show file tree
Hide file tree
Showing 4 changed files with 28 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
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: test

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Terraform Setup
run: |
terraform init
- name: Lint Terraform
uses: reviewdog/action-tflint@master
with:
github_token: ${{ secrets.github_token }}
filter_mode: "nofilter"
5 changes: 0 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,6 @@ resource "aws_s3_object" "image_files" {

# =================================================================== lookup ===

data "aws_ssm_parameter" "amzn2_image_id" {
count = module.teleport_cluster_label.enabled ? 1 : 0
name = "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-ebs"
}

data "aws_ami" "official_image" {
count = module.teleport_cluster_label.enabled ? 1 : 0

Expand Down
4 changes: 4 additions & 0 deletions version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.0.0, < 6.0.0"
}
random = {
source = "hashicorp/random"
version = ">= 3.0.0"
}
}
}

0 comments on commit 637c74e

Please sign in to comment.