Skip to content

Commit

Permalink
ran pre-commit and added new terraform validation checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank0202 committed Apr 20, 2024
1 parent 4c08f83 commit e2a2d8a
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ max_line_length = 80
trim_trailing_whitespace = true

[*.{yaml,yml}]
max_line_length = 120
max_line_length = 180

[*.{tf,tfvars}]
indent_size = 2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: Terraform
on:
on: # yamllint disable-line rule:truthy
push:
branches: [main]
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.tag }}
release_name: v${{ steps.tag.outputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
hooks:
- id: yamllint
args:
- '-d {extends: default, rules: {line-length: {max: 120}}}' # override to match .editorconfig
- '-d {extends: default, rules: {line-length: {max: 180}}}' # override to match .editorconfig
- -s
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
34 changes: 17 additions & 17 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

## Providers

No providers.
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.67.0 |

## Modules

Expand All @@ -21,7 +23,9 @@ No providers.

## Resources

No resources.
| Name | Type |
|------|------|
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |

## Inputs

Expand Down
14 changes: 7 additions & 7 deletions example/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ locals {
],
Resource = "*",
},
# {
# Sid = "AllowKeyOwnerToUpdate",
# Effect = "Allow",
# Principal = { AWS = data.aws_caller_identity.current.account_id }, // if required then use it
# Action = "kms:*",
# Resource = "*",
# },
{
Sid = "AllowKeyOwnerToUpdate",
Effect = "Allow",
Principal = { AWS = data.aws_caller_identity.current.account_id }, // if required then use it
Action = "kms:*",
Resource = "*",
},
],
})
}
2 changes: 1 addition & 1 deletion example/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# data "aws_caller_identity" "current" {}
data "aws_caller_identity" "current" {}
module "tags" {
source = "sourcefuse/arc-tags/aws"
version = "1.2.3"
Expand Down
4 changes: 2 additions & 2 deletions example/mock_provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform {
}

provider "aws" {
region = "us-east-1"
region = var.region
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
Expand Down Expand Up @@ -38,4 +38,4 @@ provider "aws" {
sts = "http://localstack:4566"
kms = "http://localstack:4566"
}
}
}

0 comments on commit e2a2d8a

Please sign in to comment.