Skip to content

Commit

Permalink
feat: fix tflint and added vpc and subnet tag
Browse files Browse the repository at this point in the history
  • Loading branch information
theprashantyadav committed Aug 1, 2023
1 parent 573c39d commit 2315645
Show file tree
Hide file tree
Showing 24 changed files with 152 additions and 257 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These owners will be the default owners for everything in the repo.
* @anmolnagpal @clouddrove/approvers @clouddrove-ci
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## what
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
* Use bullet points to be concise and to the point.

## why
* Provide the justifications for the changes (e.g. business case).
* Describe why these changes were made (e.g. why do these commits fix the problem?)
* Use bullet points to be concise and to the point.

## references
* Link to any supporting jira issues or helpful documentation to add some context (e.g. stackoverflow).
* Use `closes #123`, if this PR closes a Jira issue `#123`
14 changes: 14 additions & 0 deletions .github/workflows/auto_assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Assign PRs

on:
pull_request:
types: [opened, reopened]

workflow_dispatch:
jobs:
assignee:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
assignees: 'clouddrove-ci'
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master
secrets: inherit
with:
branch: 'master'
branch: 'master'
22 changes: 11 additions & 11 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ on:
- master

jobs:
readme-create:
readme:
name: 'readme-create'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.3.4
uses: actions/checkout@master

- name: Set up Python 3.7.
uses: actions/setup-python@v2
- name: 'Set up Python 3.7'
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v9.0.2'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB}}'
github_token: '${{ secrets.GITHUB }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: pre-commit check errors
uses: pre-commit/action@v2.0.0
- name: 'pre-commit check errors'
uses: pre-commit/action@v3.0.0
continue-on-error: true

- name: pre-commit fix erros
uses: pre-commit/action@v2.0.0
- name: 'pre-commit fix erros'
uses: pre-commit/action@v3.0.0
continue-on-error: true

- name: 'push readme'
Expand All @@ -40,7 +40,7 @@ jobs:
with:
actions_subcommand: 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
Expand Down
85 changes: 0 additions & 85 deletions .github/workflows/terraform.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/terratest.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: tf-checks
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
basic_example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
with:
working_directory: './_example/basic_example/'
ebs_mount:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
with:
working_directory: './_example/ebs_mount/'
spot_instance:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
with:
working_directory: './_example/spot_instance/'

11 changes: 11 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: tf-lint
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
tflint:
uses: clouddrove/test-tfsec/.github/workflows/tflint.yaml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
2 changes: 1 addition & 1 deletion .github/workflows/tfsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master
secrets: inherit
with:
working_directory: '.'
working_directory: '.'
18 changes: 7 additions & 11 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@ github_repo: clouddrove/terraform-aws-ec2

# Badges to display
badges:
- name: "Terraform"
image: "https://img.shields.io/badge/Terraform-v1.1.7-green"
url: "https://www.terraform.io"
- name: "Licence"
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
url: "LICENSE.md"
- name: "Latest Release"
image: "https://img.shields.io/github/release/clouddrove/terraform-aws-ec2.svg"
url: "https://github.com/clouddrove/terraform-aws-ec2/releases/latest"
- name: "tfsec"
image: "https://github.com/clouddrove/terraform-aws-ec2/actions/workflows/tfsec.yml/badge.svg"
url: "https://github.com/clouddrove/terraform-aws-ec2/actions/workflows/tfsec.yml"
- name: "static-checks"
image: "https://github.com/clouddrove/terraform-aws-ec2/actions/workflows/terraform.yml/badge.svg"
url: "https://github.com/clouddrove/terraform-aws-ec2/actions/workflows/terraform.yml"
- name: "Licence"
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
url: "LICENSE.md"

# description of this project
# yamllint disable rule:line-length
description: |-
Terraform module to create an EC2 resource on AWS with ElasticC IP Addresses and Elastic Block Store.
Expand All @@ -38,7 +34,7 @@ include:
- "terraform.md"

# How to use this project
# yamllint disable rule:line-length
# How to use this project
usage: |-
Here is examples of how you can use this module in your inventory structure:
### Basic Example
Expand Down
2 changes: 1 addition & 1 deletion _example/basic_example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module "vpc" {
####----------------------------------------------------------------------------------
module "public_subnets" {
source = "clouddrove/subnet/aws"
version = "1.3.0"
version = "2.0.0"

name = "public-subnet"
environment = "test"
Expand Down
2 changes: 1 addition & 1 deletion _example/basic_example/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
output "instance_id" {
value = module.ec2.*.instance_id
value = module.ec2[*].instance_id
description = "The instance ID."
}

Expand Down
11 changes: 11 additions & 0 deletions _example/basic_example/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.5.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.9.0"
}
}
}
2 changes: 1 addition & 1 deletion _example/ebs_mount/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module "vpc" {
####----------------------------------------------------------------------------------
module "public_subnets" {
source = "clouddrove/subnet/aws"
version = "1.3.0"
version = "2.0.0"

name = "public-subnet"
environment = "test"
Expand Down
2 changes: 1 addition & 1 deletion _example/ebs_mount/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
output "instance_id" {
value = module.ec2.*.instance_id
value = module.ec2[*].instance_id
description = "The instance ID."
}

Expand Down
11 changes: 11 additions & 0 deletions _example/ebs_mount/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.5.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.9.0"
}
}
}
4 changes: 2 additions & 2 deletions _example/spot_instance/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ provider "aws" {
#tfsec:ignore:aws-ec2-require-vpc-flow-logs-for-all-vpcs
module "vpc" {
source = "clouddrove/vpc/aws"
version = "1.3.1"
version = "2.0.0"

name = "vpc"
environment = "test"
Expand All @@ -25,7 +25,7 @@ module "vpc" {
#tfsec:ignore:aws-ec2-no-public-ip-subnet
module "public_subnets" {
source = "clouddrove/subnet/aws"
version = "1.3.0"
version = "2.0.0"

name = "public-subnet"
environment = "test"
Expand Down
4 changes: 2 additions & 2 deletions _example/spot_instance/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
output "spot_instance_id" {
value = module.spot-ec2.*.spot_instance_id
value = module.spot-ec2[*].spot_instance_id
description = "The instance ID."
}

output "spot_tags" {
value = module.spot-ec2.*.tags
value = module.spot-ec2[*].tags
description = "The instance tags."
}

Expand Down
Loading

0 comments on commit 2315645

Please sign in to comment.