Skip to content

Commit

Permalink
fix: added versions.tf and updated vpc tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mamrajyadav committed Jun 5, 2023
1 parent f2a000e commit b7552fb
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 103 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
- ${{ needs.versionExtract.outputs.minVersion }}
- ${{ needs.versionExtract.outputs.maxVersion }}
directory:
- _example/
- _example/alb
- _example/clb
- _example/nlb

steps:
- name: Checkout
Expand Down
100 changes: 51 additions & 49 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,26 @@ usage : |-
source = "clouddrove/alb/aws"
version = "1.3.0"
name = "alb"
internal = false
enable = true
internal = true
load_balancer_type = "application"
instance_count = module.ec2.instance_count
security_groups = [module.ssh.security_group_ids, module.http-https.security_group_ids]
security_groups = [module.ssh.security_group_ids, module.http_https.security_group_ids]
subnets = module.public_subnets.public_subnet_id
enable_deletion_protection = false
target_id = module.ec2.instance_id
vpc_id = module.vpc.vpc_id
https_enabled = true
http_enabled = true
https_port = 443
listener_type = "forward"
listener_certificate_arn = "arn:aws:acm:eu-west-1:924144197303:certificate/0418d2ba-91f7-4196-991b-28b5c60cd4cf"
target_group_port = 80
target_groups = [
with_target_group = true
target_id = module.ec2.instance_id
vpc_id = module.vpc.vpc_id
https_enabled = true
http_enabled = true
https_port = 443
listener_type = "forward"
listener_certificate_arn = "arn:aws:acm:eu-west-1:924144197303:certificate/0418d2ba-91f7-4196-991b-28b5c60cd4cf"
target_group_port = 80
target_groups = [
{
backend_protocol = "HTTP"
backend_port = 80
Expand All @@ -84,34 +89,30 @@ usage : |-
### NLB Example
```hcl
module "alb" {
module "nlb" {
source = "clouddrove/alb/aws"
version = "1.3.0"
name = "nlb"
internal = false
load_balancer_type = "application"
enable = true
internal = true
load_balancer_type = "network"
instance_count = module.ec2.instance_count
subnets = module.public_subnets.public_subnet_id
enable_deletion_protection = false
target_id = module.ec2.instance_id
vpc_id = module.vpc.vpc_id
with_target_group = true
target_id = module.ec2.instance_id
vpc_id = module.vpc.vpc_id
http_tcp_listeners = [
{
port = 80
protocol = "TCP"
target_group_index = 0
},
]
https_listeners = [
{
port = 443
protocol = "TLS"
certificate_arn = "arn:aws:acm:eu-west-1:924144197303:certificate/0418d2ba-91f7-4196-991b-28b5c60cd4cf"
target_group_index = 1
},
]
target_groups = [
{
backend_protocol = "TCP"
Expand All @@ -132,35 +133,36 @@ usage : |-
module "clb" {
source = "clouddrove/alb/aws"
version = "1.3.0"
name = "clb"
name = "clb"
load_balancer_type = "classic"
internal = false
target_id = module.ec2.instance_id
security_groups = [module.ssh.security_group_ids, module.http_https.security_group_ids]
subnets = module.public_subnets.public_subnet_id
clb_enable = true
internal = true
target_id = module.ec2.instance_id
security_groups = [module.ssh.security_group_ids, module.http_https.security_group_ids]
subnets = module.public_subnets.public_subnet_id
with_target_group = true
listeners = [
{
lb_port = 22000
lb_protocol = "TCP"
instance_port = 22000
instance_protocol = "TCP"
ssl_certificate_id = null
},
{
lb_port = 4444
lb_protocol = "TCP"
instance_port = 4444
instance_protocol = "TCP"
ssl_certificate_id = null
}
{
lb_port = 22000
lb_protocol = "TCP"
instance_port = 22000
instance_protocol = "TCP"
ssl_certificate_id = null
},
{
lb_port = 4444
lb_protocol = "TCP"
instance_port = 4444
instance_protocol = "TCP"
ssl_certificate_id = null
}
]
health_check_target = "TCP:4444"
health_check_timeout = 10
health_check_interval = 30
health_check_unhealthy_threshold = 5
health_check_healthy_threshold = 5
}
}
```
24 changes: 24 additions & 0 deletions _example/alb/example.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
##---------------------------------------------------------------------------------------------------------------------------
## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS.
##--------------------------------------------------------------------------------------------------------------------------
provider "aws" {
region = "eu-west-1"
}

##---------------------------------------------------------------------------------------------------------------------------
## 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 = "1.3.1"
Expand All @@ -13,6 +19,9 @@ module "vpc" {
cidr_block = "172.16.0.0/16"
}

##-----------------------------------------------------
## A subnet is a range of IP addresses in your VPC.
##-----------------------------------------------------
module "public_subnets" {
source = "clouddrove/subnet/aws"
version = "1.3.0"
Expand All @@ -30,6 +39,9 @@ module "public_subnets" {
ipv6_cidr_block = module.vpc.ipv6_cidr_block
}

##-----------------------------------------------------
## An AWS security group acts as a virtual firewall for incoming and outgoing traffic with http-https.
##-----------------------------------------------------
module "http_https" {
source = "clouddrove/security-group/aws"
version = "1.3.0"
Expand All @@ -44,6 +56,9 @@ module "http_https" {
allowed_ports = [80, 443]
}

##-----------------------------------------------------
## An AWS security group acts as a virtual firewall for incoming and outgoing traffic with ssh.
##-----------------------------------------------------
module "ssh" {
source = "clouddrove/security-group/aws"
version = "1.3.0"
Expand All @@ -58,6 +73,9 @@ module "ssh" {
allowed_ports = [22]
}

##-----------------------------------------------------
## When your trusted identities assume IAM roles, they are granted only the permissions scoped by those IAM roles.
##-----------------------------------------------------
module "iam-role" {
source = "clouddrove/iam-role/aws"
version = "1.3.0"
Expand Down Expand Up @@ -96,6 +114,9 @@ data "aws_iam_policy_document" "iam-policy" {
}
}

##-----------------------------------------------------
## Amazon EC2 provides cloud hosted virtual machines, called "instances", to run applications.
##-----------------------------------------------------
module "ec2" {
source = "clouddrove/ec2/aws"
version = "1.3.0"
Expand Down Expand Up @@ -126,6 +147,9 @@ module "ec2" {
ebs_volume_size = 30
}

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

Expand Down
24 changes: 24 additions & 0 deletions _example/clb/example.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
##---------------------------------------------------------------------------------------------------------------------------
## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS.
##--------------------------------------------------------------------------------------------------------------------------
provider "aws" {
region = "eu-west-1"
}

##---------------------------------------------------------------------------------------------------------------------------
## 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 = "1.3.1"
Expand All @@ -13,6 +19,9 @@ module "vpc" {
cidr_block = "172.16.0.0/16"
}

##-----------------------------------------------------
## A subnet is a range of IP addresses in your VPC.
##-----------------------------------------------------
module "public_subnets" {
source = "clouddrove/subnet/aws"
version = "1.3.0"
Expand All @@ -29,6 +38,9 @@ module "public_subnets" {
ipv6_cidr_block = module.vpc.ipv6_cidr_block
}

##-----------------------------------------------------
## An AWS security group acts as a virtual firewall for incoming and outgoing traffic with http-https.
##-----------------------------------------------------
module "http_https" {
source = "clouddrove/security-group/aws"
version = "1.3.0"
Expand All @@ -43,6 +55,9 @@ module "http_https" {
allowed_ports = [80, 443]
}

##-----------------------------------------------------
## An AWS security group acts as a virtual firewall for incoming and outgoing traffic with ssh.
##-----------------------------------------------------
module "ssh" {
source = "clouddrove/security-group/aws"
version = "1.3.0"
Expand All @@ -56,6 +71,9 @@ module "ssh" {
allowed_ports = [22]
}

##-----------------------------------------------------
## When your trusted identities assume IAM roles, they are granted only the permissions scoped by those IAM roles.
##-----------------------------------------------------
module "iam-role" {
source = "clouddrove/iam-role/aws"
version = "1.3.0"
Expand Down Expand Up @@ -94,6 +112,9 @@ data "aws_iam_policy_document" "iam-policy" {
}
}

##-----------------------------------------------------
## Amazon EC2 provides cloud hosted virtual machines, called "instances", to run applications.
##-----------------------------------------------------
module "ec2" {
source = "clouddrove/ec2/aws"
version = "1.3.0"
Expand Down Expand Up @@ -124,6 +145,9 @@ module "ec2" {
ebs_volume_size = 30
}

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

Expand Down
11 changes: 0 additions & 11 deletions _example/clb/versions.tf

This file was deleted.

25 changes: 24 additions & 1 deletion _example/nlb/example.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
##---------------------------------------------------------------------------------------------------------------------------
## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS.
##--------------------------------------------------------------------------------------------------------------------------
provider "aws" {
region = "eu-west-1"
}

##---------------------------------------------------------------------------------------------------------------------------
## 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 = "1.3.1"
Expand All @@ -13,6 +19,9 @@ module "vpc" {
cidr_block = "172.16.0.0/16"
}

##-----------------------------------------------------
## A subnet is a range of IP addresses in your VPC.
##-----------------------------------------------------
module "public_subnets" {
source = "clouddrove/subnet/aws"
version = "1.3.0"
Expand All @@ -29,6 +38,9 @@ module "public_subnets" {
ipv6_cidr_block = module.vpc.ipv6_cidr_block
}

##-----------------------------------------------------
## An AWS security group acts as a virtual firewall for incoming and outgoing traffic with http-https.
##-----------------------------------------------------
module "http-https" {
source = "clouddrove/security-group/aws"
version = "1.3.0"
Expand All @@ -43,6 +55,9 @@ module "http-https" {
allowed_ports = [80, 443]
}

##-----------------------------------------------------
## An AWS security group acts as a virtual firewall for incoming and outgoing traffic with ssh.
##-----------------------------------------------------
module "ssh" {
source = "clouddrove/security-group/aws"
version = "1.3.0"
Expand All @@ -56,6 +71,9 @@ module "ssh" {
allowed_ports = [22]
}

##-----------------------------------------------------
## When your trusted identities assume IAM roles, they are granted only the permissions scoped by those IAM roles.
##-----------------------------------------------------
module "iam-role" {
source = "clouddrove/iam-role/aws"
version = "1.3.0"
Expand Down Expand Up @@ -94,6 +112,9 @@ data "aws_iam_policy_document" "iam-policy" {
}
}

##-----------------------------------------------------
## Amazon EC2 provides cloud hosted virtual machines, called "instances", to run applications.
##-----------------------------------------------------
module "ec2" {
source = "clouddrove/ec2/aws"
version = "1.3.0"
Expand Down Expand Up @@ -123,7 +144,9 @@ module "ec2" {
ebs_volume_size = 30
}


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

Expand Down
Loading

0 comments on commit b7552fb

Please sign in to comment.