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

[pre-commit.ci] pre-commit autoupdate #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,3 @@ updates:
- "approvers"
# Allow up to 3 open pull requests for pip dependencies
open-pull-requests-limit: 3

6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:

- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.12 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
rev: v0.1.23 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
hooks:
- id: terraform-fmt
- id: shellcheck
- id: tflint

- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 # Use the ref you want to point at
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 # Use the ref you want to point at
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[v0.15.3]: https://github.com/clouddrove/terraform-aws-subnet/compare/v0.15.2...v0.15.3
[v1.0.1]: https://github.com/clouddrove/terraform-aws-subnet/compare/v0.15.3...v1.0.1
[v1.3.0]: https://github.com/clouddrove/terraform-aws-subnet/compare/v1.0.1...v1.3.0
[2.0.0]: https://github.com/clouddrove/terraform-aws-subnet/compare/1.3.0...2.0.0
[2.0.0]: https://github.com/clouddrove/terraform-aws-subnet/compare/1.3.0...2.0.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<hr>


We are a group of DevOps engineers & architects, joining hands in this ever evolving digital landscape. With our strong belief in Automation; just like microservices, always on the lookout to split the the infrastructure into smaller connected resources (database, cluster and more) which could be standardized, are manageable, scalable, secure & follow industry best practices.
We are a group of DevOps engineers & architects, joining hands in this ever evolving digital landscape. With our strong belief in Automation; just like microservices, always on the lookout to split the the infrastructure into smaller connected resources (database, cluster and more) which could be standardized, are manageable, scalable, secure & follow industry best practices.


This module includes Terraform open source, examples, and automation tests (for better understanding), which would help you create and improve your infrastructure with minimalistic coding.
Expand Down Expand Up @@ -79,7 +79,7 @@ This table contains both Prerequisites and Providers:
Refer to complete documentation: [here](docs/io.md)


<!--
<!--
## Module Dependencies

This module has dependencies on:
Expand Down Expand Up @@ -107,7 +107,7 @@ Refer [here](CHANGELOG.md).

## ✨ Contributors

Big thanks to our contributors for elevating our project with their dedication and expertise! But, we do not wish to stop there, would like to invite contributions from the community in improving these projects and making them more versatile for better reach. Remember, every bit of contribution is immensely valuable, as, together, we are moving in only 1 direction, i.e. forward.
Big thanks to our contributors for elevating our project with their dedication and expertise! But, we do not wish to stop there, would like to invite contributions from the community in improving these projects and making them more versatile for better reach. Remember, every bit of contribution is immensely valuable, as, together, we are moving in only 1 direction, i.e. forward.

<a href="https://github.com/clouddrove/terraform-aws-subnet/graphs/contributors">
<img src="https://contrib.rocks/image?repo=clouddrove/terraform-aws-subnet&max" />
Expand Down Expand Up @@ -135,7 +135,7 @@ Big thanks to our contributors for elevating our project with their dedication a



## Feedback
## Feedback
Spot a bug or have thoughts to share with us? Let's squash it together! Log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-subnet/issues), feel free to drop us an email at [[email protected]](mailto:[email protected]).

Show some love with a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-subnet)! if our work has brightened your day! – your feedback fuels our journey!
Expand All @@ -147,7 +147,7 @@ We have [*100+ Terraform modules*][terraform_modules] 🙌. You could consider t

- [Terraform Module Registry:](https://registry.terraform.io/namespaces/clouddrove) Discover our Terraform modules here.

- [Terraform Modules for AWS/Azure Modules:](https://github.com/clouddrove/toc) Explore our comprehensive Table of Contents for easy navigation through our documentation for modules pertaining to AWS, Azure & GCP.
- [Terraform Modules for AWS/Azure Modules:](https://github.com/clouddrove/toc) Explore our comprehensive Table of Contents for easy navigation through our documentation for modules pertaining to AWS, Azure & GCP.

- [Terraform Modules for Digital Ocean:](https://github.com/terraform-do-modules/toc) Check out our specialized Terraform modules for Digital Ocean.

Expand All @@ -173,7 +173,7 @@ Join our tech elites [Join Now][slack] 🚀
Click [here][blog] :books: :star2:

## Tap into our capabilities
We provide a platform for organizations to engage with experienced top-tier DevOps & Cloud services. Tap into our pool of certified engineers and architects to elevate your DevOps and Cloud Solutions.
We provide a platform for organizations to engage with experienced top-tier DevOps & Cloud services. Tap into our pool of certified engineers and architects to elevate your DevOps and Cloud Solutions.

At [CloudDrove][website], has extensive experience in designing, building & migrating environments, securing, consulting, monitoring, optimizing, automating, and maintaining complex and large modern systems. With remarkable client footprints in American & European corridors, our certified architects & engineers are ready to serve you as per your requirements & schedule. Write to us at [[email protected]](mailto:[email protected]).

Expand Down
1 change: 0 additions & 1 deletion docs/io.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@
| public\_subnet\_cidrs\_ipv6 | CIDR blocks of the created public subnets. |
| public\_subnet\_id | The ID of the subnet. |
| public\_tags | A mapping of public tags to assign to the resource. |

10 changes: 5 additions & 5 deletions examples/basic/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ locals {
environment = "test"
}

##-----------------------------------------------------------------------------
## Subnet Module Call.
## Both private and public subnet will be deployed.
##-----------------------------------------------------------------------------
#tfsec:ignore:aws-ec2-no-excessive-port-access
## Subnet Module Call.
## Both private and public subnet will be deployed.
##-----------------------------------------------------------------------------
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-public-ingress-acl
module "subnets" {
source = "./../../"
Expand All @@ -20,4 +20,4 @@ module "subnets" {
igw_id = "vpc_igw_id-xxxxxxx"
cidr_block = "10.0.0.0/16"
enable_ipv6 = false
}
}
10 changes: 5 additions & 5 deletions examples/complete/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ locals {
region = "eu-west-1"
}

##-----------------------------------------------------------------------------
## Vpc Module call.
##-----------------------------------------------------------------------------
## Vpc Module call.
##-----------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
Expand All @@ -28,11 +28,11 @@ module "vpc" {
assign_generated_ipv6_cidr_block = true
}

##-----------------------------------------------------------------------------
##-----------------------------------------------------------------------------
## Subnet Module call.
## Below module will deploy both public and private subnets.
## Below module will deploy both public and private subnets.
##-----------------------------------------------------------------------------
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-public-ingress-acl
module "subnets" {
source = "./../../"
Expand Down
10 changes: 5 additions & 5 deletions examples/private-subnet/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ locals {
environment = "test"
}

##-----------------------------------------------------------------------------
## Vpc Module call.
##-----------------------------------------------------------------------------
## Vpc Module call.
##-----------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
Expand All @@ -24,11 +24,11 @@ module "vpc" {
assign_generated_ipv6_cidr_block = true
}

##-----------------------------------------------------------------------------
##-----------------------------------------------------------------------------
## Subnet Module call.
## Below module will deploy only private subnet.
## Below module will deploy only private subnet.
##-----------------------------------------------------------------------------
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-public-ingress-acl
module "private-subnets" {
source = "./../../"
Expand Down
1 change: 0 additions & 1 deletion examples/private-subnet/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ output "nat_gateway_private_ip" {
value = module.private-subnets.nat_gateway_private_ip
description = "The private IPv4 address to assign to the NAT Gateway. If you don't provide an address, a private IPv4 address will be automatically assigned."
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ locals {
environment = "test"
}

##-----------------------------------------------------------------------------
## Vpc Module call.
##-----------------------------------------------------------------------------
## Vpc Module call.
##-----------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
Expand All @@ -24,11 +24,11 @@ module "vpc" {
assign_generated_ipv6_cidr_block = true
}

##-----------------------------------------------------------------------------
##-----------------------------------------------------------------------------
## Subnet Module call.
## Below module will deploy both public and private subnets with single nat gateway.
##-----------------------------------------------------------------------------
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-public-ingress-acl
module "subnets" {
source = "./../../"
Expand Down
10 changes: 5 additions & 5 deletions examples/public-subnet/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ locals {
environment = "test"
}

##-----------------------------------------------------------------------------
## Vpc Module call.
##-----------------------------------------------------------------------------
## Vpc Module call.
##-----------------------------------------------------------------------------
module "vpc" {
source = "clouddrove/vpc/aws"
Expand All @@ -23,11 +23,11 @@ module "vpc" {
assign_generated_ipv6_cidr_block = true
}

##-----------------------------------------------------------------------------
##-----------------------------------------------------------------------------
## Subnet Module call.
## Below module will deploy only public subnet.
## Below module will deploy only public subnet.
##-----------------------------------------------------------------------------
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-excessive-port-access
#tfsec:ignore:aws-ec2-no-public-ingress-acl
module "subnets" {
source = "./../../"
Expand Down
46 changes: 23 additions & 23 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Managed By : CloudDrove
# Managed By : CloudDrove
# Copyright @ CloudDrove. All Right Reserved.

##-----------------------------------------------------------------------------
## Locals declration to determine count of public subnet, private subnet, and nat gateway.
##-----------------------------------------------------------------------------
## Locals declration to determine count of public subnet, private subnet, and nat gateway.
##-----------------------------------------------------------------------------
locals {
public_count = var.enable == true && (var.type == "public" || var.type == "public-private") ? length(var.availability_zones) : 0
private_count = var.enable == true && (var.type == "private" || var.type == "public-private") ? length(var.availability_zones) : 0
nat_gateway_count = var.enable == true && var.single_nat_gateway ? 1 : (var.enable == true && (var.type == "private" || var.type == "public-private") && var.nat_gateway_enabled == true ? length(var.availability_zones) : 0)
}
##-----------------------------------------------------------------------------
## Labels module called that will be used for naming and tags.
##-----------------------------------------------------------------------------
## Labels module called that will be used for naming and tags.
##-----------------------------------------------------------------------------
module "private-labels" {
source = "clouddrove/labels/aws"
Expand Down Expand Up @@ -42,8 +42,8 @@ module "public-labels" {
}
}

##-----------------------------------------------------------------------------
## Below resource will deploy public subnets and its related components in aws environment.
##-----------------------------------------------------------------------------
## Below resource will deploy public subnets and its related components in aws environment.
##-----------------------------------------------------------------------------
resource "aws_subnet" "public" {
count = local.public_count
Expand Down Expand Up @@ -74,8 +74,8 @@ resource "aws_subnet" "public" {
}
}

##-----------------------------------------------------------------------------
## Below resource will deploy network acl and its rules that will be attached to public subnets.
##-----------------------------------------------------------------------------
## Below resource will deploy network acl and its rules that will be attached to public subnets.
##-----------------------------------------------------------------------------
resource "aws_network_acl" "public" {
count = var.enable && local.public_count > 0 && var.enable_public_acl && (var.type == "public" || var.type == "public-private") ? 1 : 0
Expand Down Expand Up @@ -115,8 +115,8 @@ resource "aws_network_acl_rule" "public_outbound" {
ipv6_cidr_block = lookup(var.public_outbound_acl_rules[count.index], "ipv6_cidr_block", null)
}

##-----------------------------------------------------------------------------
## Below resources will deploy route table and routes for public subnet and will be associated to public subnets.
##-----------------------------------------------------------------------------
## Below resources will deploy route table and routes for public subnet and will be associated to public subnets.
##-----------------------------------------------------------------------------
resource "aws_route_table" "public" {
count = local.public_count
Expand Down Expand Up @@ -159,8 +159,8 @@ resource "aws_route_table_association" "public" {
]
}

##-----------------------------------------------------------------------------
## Below resource will deploy flow logs for public subnet.
##-----------------------------------------------------------------------------
## Below resource will deploy flow logs for public subnet.
##-----------------------------------------------------------------------------
resource "aws_flow_log" "public_subnet_flow_log" {
count = var.enable && var.enable_flow_log && local.public_count > 0 ? 1 : 0
Expand Down Expand Up @@ -188,8 +188,8 @@ resource "aws_flow_log" "public_subnet_flow_log" {
)
}

##-----------------------------------------------------------------------------
## Below resource will deploy private subnets and its related components in aws environment.
##-----------------------------------------------------------------------------
## Below resource will deploy private subnets and its related components in aws environment.
##-----------------------------------------------------------------------------
resource "aws_subnet" "private" {
count = local.private_count
Expand Down Expand Up @@ -221,8 +221,8 @@ resource "aws_subnet" "private" {
}
}

##-----------------------------------------------------------------------------
## Below resource will deploy network acl and its rules that will be attached to private subnets.
##-----------------------------------------------------------------------------
## Below resource will deploy network acl and its rules that will be attached to private subnets.
##-----------------------------------------------------------------------------
resource "aws_network_acl" "private" {
count = var.enable && var.enable_private_acl && (var.type == "private" || var.type == "public-private") ? 1 : 0
Expand Down Expand Up @@ -262,8 +262,8 @@ resource "aws_network_acl_rule" "private_outbound" {
ipv6_cidr_block = lookup(var.private_outbound_acl_rules[count.index], "ipv6_cidr_block", null)
}

##-----------------------------------------------------------------------------
## Below resources will deploy route table and routes for private subnet and will be associated to private subnets.
##-----------------------------------------------------------------------------
## Below resources will deploy route table and routes for private subnet and will be associated to private subnets.
##-----------------------------------------------------------------------------
resource "aws_route_table" "private" {
count = local.private_count
Expand Down Expand Up @@ -292,7 +292,7 @@ resource "aws_route" "nat_gateway" {
}

##----------------------------------------------------------------------------------
## Below resource will create Elastic IP (EIP) for nat gateway.
## Below resource will create Elastic IP (EIP) for nat gateway.
##----------------------------------------------------------------------------------
resource "aws_eip" "private" {
count = local.nat_gateway_count
Expand All @@ -309,7 +309,7 @@ resource "aws_eip" "private" {
}

##----------------------------------------------------------------------------------
## Below resource will deploy nat gateway for private subnets.
## Below resource will deploy nat gateway for private subnets.
##----------------------------------------------------------------------------------
resource "aws_nat_gateway" "private" {
count = local.nat_gateway_count
Expand All @@ -323,8 +323,8 @@ resource "aws_nat_gateway" "private" {
)
}

##-----------------------------------------------------------------------------
## Below resource will deploy flow logs for private subnet.
##-----------------------------------------------------------------------------
## Below resource will deploy flow logs for private subnet.
##-----------------------------------------------------------------------------
resource "aws_flow_log" "private_subnet_flow_log" {
count = var.enable && var.enable_flow_log && local.private_count > 0 ? 1 : 0
Expand Down