Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update main.tf, version.tf and github action and add locals in e… #20

Merged
merged 8 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# EditorConfig is awesome: http://EditorConfig.org
# Uses editorconfig to maintain consistent coding styles

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.{tf,tfvars}]
indent_size = 2
indent_style = space

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[Makefile]
tab_width = 2
indent_style = tab

[COMMIT_EDITMSG]
max_line_length = 0
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# These owners will be the default owners for everything in the repo.
* @anmolnagpal @clouddrove/approvers @clouddrove-ci
* @anmolnagpal @clouddrove/approvers @clouddrove-ci
20 changes: 18 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 3
assignees:
- "clouddrove-ci"
reviewers:
- "approvers"

- package-ecosystem: "terraform" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
Expand All @@ -15,8 +26,11 @@ updates:
# Add reviewer
reviewers:
- "approvers"
# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3

- package-ecosystem: "terraform" # See documentation for possible values
directory: "_example/" # Location of package manifests
directory: "/_example" # Location of package manifests
schedule:
interval: "weekly"
# Add assignees
Expand All @@ -25,5 +39,7 @@ updates:
# Add reviewer
reviewers:
- "approvers"

# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3


4 changes: 1 addition & 3 deletions .github/workflows/auto_assignee.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
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'
assignees: 'clouddrove-ci'
1 change: 0 additions & 1 deletion .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- master

jobs:
readme:
name: 'readme-create'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
workflow_dispatch:
jobs:
example:
alb:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
with:
working_directory: './_example/'
6 changes: 3 additions & 3 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
workflow_dispatch:
jobs:
tflint:
uses: clouddrove/test-tfsec/.github/workflows/tflint.yaml@master
tf-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master
secrets:
GITHUB: ${{ secrets.GITHUB }}
GITHUB: ${{ secrets.GITHUB }}
18 changes: 10 additions & 8 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ badges:
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
url: "LICENSE.md"

prerequesties:
- name: Terraform 1.5.3
url: https://learn.hashicorp.com/terraform/getting-started/install.html

# description of this project
description: |-
Terraform module to create Client VPN resource on AWS.
Expand All @@ -41,17 +45,15 @@ usage: |-
module "vpn" {
source = "clouddrove/client-vpn/aws"
version = "1.0.5"
name = "test-vpn"
enabled = true
name = local.name
environment = local.environment
split_tunnel_enable = true
environment = "example"
label_order = ["name", "environment"]
cidr_block = "172.0.0.0/16"
vpc_id = module.vpc.vpc_id
subnet_ids = module.subnets.public_subnet_id
route_cidr = ["0.0.0.0/0", "0.0.0.0/0"]
security_group_ids = [""]
security_group_ids = [""]
route_subnet_ids = module.subnets.public_subnet_id
network_cidr = ["0.0.0.0/0"]

}
```
}
```
56 changes: 56 additions & 0 deletions _example/example.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
provider "aws" {
region = "us-east-1"
}

locals {
name = "vpn"
environment = "test"
}

##---------------------------------------------------------------------------------------------------------------------------
## A VPC is a virtual network that closely resembles a traditional network that you'd operate in your own data center.
##---------------------------------------------------------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
version = "2.0.0"

name = local.name
environment = local.environment
enable_flow_log = false
cidr_block = "10.0.0.0/16"
}

##-----------------------------------------------------
## A subnet is a range of IP addresses in your VPC.
##-----------------------------------------------------
module "subnets" {
source = "clouddrove/subnet/aws"
version = "2.0.0"

nat_gateway_enabled = true
name = local.name
environment = local.environment
availability_zones = ["us-east-1a", "us-east-1b"]
vpc_id = module.vpc.vpc_id
type = "public-private"
igw_id = module.vpc.igw_id
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
}
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

##-----------------------------------------------------------------------------
## vpn module call.
##-----------------------------------------------------------------------------
module "vpn" {
source = "../"

name = local.name
environment = local.environment
split_tunnel_enable = true
cidr_block = "172.0.0.0/16"
vpc_id = module.vpc.vpc_id
subnet_ids = module.subnets.private_subnet_id
route_cidr = ["0.0.0.0/0", "0.0.0.0/0"]
route_subnet_ids = module.subnets.private_subnet_id
network_cidr = ["0.0.0.0/0"]
}

Check notice

Code scanning / defsec

CloudWatch log groups should be encrypted using CMK Note

Log group is not encrypted.

Check notice

Code scanning / defsec

Missing description for security group. Note

Security group explicitly uses the default description.

Check notice

Code scanning / defsec

Missing description for security group rule. Note

Security group rule does not have a description.

Check notice

Code scanning / defsec

Missing description for security group rule. Note

Security group rule does not have a description.

Check notice

Code scanning / defsec

Missing description for security group rule. Note

Security group rule does not have a description.

Check notice

Code scanning / defsec

Missing description for security group rule. Note

Security group rule does not have a description.

Check failure

Code scanning / defsec

An egress security group rule allows traffic to /0. Error

Security group rule allows egress to multiple public internet addresses.

Check failure

Code scanning / defsec

An egress security group rule allows traffic to /0. Error

Security group rule allows egress to multiple public internet addresses.
62 changes: 0 additions & 62 deletions _example/main.tf

This file was deleted.

20 changes: 20 additions & 0 deletions _example/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,23 @@ output "tags" {
value = module.vpc.tags
description = "A mapping of tags to assign to the resource."
}

output "sg_id" {
value = module.vpn.sg_id
description = "The ID of the SG for Client VPN."
}

output "vpn_id" {
value = module.vpn.vpn_id
description = "The ID of the Client VPN endpoint."
}

output "vpn_arn" {
value = module.vpn.vpn_arn
description = "The ARN of the Client VPN endpoint."
}

output "vpn_dns_name" {
value = module.vpn.vpn_dns_name
description = "VPN DNS name"
}
6 changes: 3 additions & 3 deletions _example/versions.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Terraform version
terraform {
required_version = ">= 1.5.0"
required_version = ">= 1.5.5"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.9.0"
version = ">= 5.13.1"
}
}
}
}
Loading