Skip to content

Commit

Permalink
fix: update source of ec2 module
Browse files Browse the repository at this point in the history
  • Loading branch information
mamrajyadav committed Sep 6, 2023
1 parent 1c46d99 commit ef91c0c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
7 changes: 4 additions & 3 deletions _example/alb/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,17 @@ data "aws_iam_policy_document" "iam-policy" {
## Amazon EC2 provides cloud hosted virtual machines, called "instances", to run applications.
##-----------------------------------------------------
module "ec2" {
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=master"
source = "clouddrove/ec2/aws"
version = "2.0.0"

name = local.name
environment = local.environment
vpc_id = module.vpc.vpc_id
ssh_allowed_ip = ["0.0.0.0/0"]
ssh_allowed_ports = [22]
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCmPuPTJ58AMvweGBuAqKX+tkb0ylYq5k6gPQnl6+ivQ8i/jsUJ+juI7q/7vSoTpd0k9Gv7DkjGWg1527I+LJeropVSaRqwDcrnuM1IfUCu0QdRoU8e0sW7kQGnwObJhnRcxiGPa1inwnneq9zdXK8BGgV2E4POKdwbEBlmjZmW8j4JMnCsLvZ4hxBjZB/3fnvHhn7UCqd2C6FhOz9k+aK2kxXHxdDdO9BzKqtvm5dSAxHhw6nDHSU+cHupjiiY/SvmFH0QpR5Fn1kyZH7DxV4D8R9wvP9jKZe/RRTEkB2HY7FpVNz/EqO/z"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCmPuPTJ58AMvweGBuAqKX+tkb0ylYq5k6gPQnl6+ivQ8i/jsUJ+juI7q/7vSoTpd0k9Gv7DkjGWg1527I+LJeropVSaRqwDcrnuM1IfUCu0QdRoU8e0sW7kQGnwObJhnRcxiGPa1inwnneq9zdXK8BGgV2E4POKdwbEBlmjZmW8j4JMnCsLvZ4hxBjZB/3fnvHhn7UCqd2C6FhOz9k+aK2kxXHxdDdO9BzKqtvm5dSAxHhw6nDHSU+cHupjiiY/SvmFH0QpR5Fn1kyZH7DxV4D8R"
instance_count = 2
ami = "ami-08d658f84a6d84a80"
ami = "ami-01dd271720c1ba44f"
instance_type = "t2.nano"
monitoring = true
tenancy = "default"
Expand Down
7 changes: 4 additions & 3 deletions _example/clb/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,20 @@ data "aws_iam_policy_document" "iam-policy" {
## Amazon EC2 provides cloud hosted virtual machines, called "instances", to run applications.
##-----------------------------------------------------
module "ec2" {
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=master"
source = "clouddrove/ec2/aws"
version = "2.0.0"

name = local.name
environment = local.environment
vpc_id = module.vpc.vpc_id
ssh_allowed_ip = ["0.0.0.0/0"]
ssh_allowed_ports = [22]
instance_count = 2
ami = "ami-08d658f84a6d84a80"
ami = "ami-01dd271720c1ba44f"
instance_type = "t2.nano"
monitoring = false
tenancy = "default"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCmPuPTJ58AMvweGBuAqKX+tkb0ylYq5k6gPQnl6+ivQ8i/jsUJ+juI7q/7vSoTpd0k9Gv7DkjGWg1527I+LJeropVSaRqwDcrnuM1IfUCu0QdRoU8e0sW7kQGnwObJhnRcxiGPa1inwnneq9zdXK8BGgV2E4POKdwbEBlmjZmW8j4JMnCsLvZ4hxBjZB/3fnvHhn7UCqd2C6FhOz9k+aK2kxXHxdDdO9BzKqtvm5dSAxHhw6nDHSU+cHupjiiY/SvmFH0QpR5Fn1kyZH7DxV4D8R9wvP9jKZe/RRTEkB2HY7FpVNz/EqO/z5bv7japQ5LZY1fFOK47S5K"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCmPuPTJ58AMvweGBuAqKX+tkb0ylYq5k6gPQnl6+ivQ8i/jsUJ+juI7q/7vSoTpd0k9Gv7DkjGWg1527I+LJeropVSaRqwDcrnuM1IfUCu0QdRoU8e0sW7kQGnwObJhnRcxiGPa1inwnneq9zdXK8BGgV2E4POKdwbEBlmjZmW8j4JMnCsLvZ4hxBjZB/3fnvHhn7UCqd2C6FhOz9k+aK2kxXHxdDdO9BzKqtvm5dSAxHhw6nDHSU+cHupjiiY/SvmFH0QpR5Fn1kyZH7DxV4D8R9wvP9jKZe/RRTEkB2HY7FpVNz"
subnet_ids = tolist(module.public_subnets.public_subnet_id)
iam_instance_profile = module.iam-role.name
assign_eip_address = true
Expand Down
8 changes: 4 additions & 4 deletions _example/nlb/exampe.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,20 @@ data "aws_iam_policy_document" "iam-policy" {
## Amazon EC2 provides cloud hosted virtual machines, called "instances", to run applications.
##-----------------------------------------------------
module "ec2" {
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=master"
source = "clouddrove/ec2/aws"
version = "2.0.0"

name = local.name
environment = local.environment
instance_count = 1
ami = "ami-08d658f84a6d84a80"
ami = "ami-01dd271720c1ba44f"
instance_type = "t2.nano"
monitoring = false
vpc_id = module.vpc.vpc_id
ssh_allowed_ip = ["0.0.0.0/0"]
ssh_allowed_ports = [22]
tenancy = "default"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCm63Yf1+E6Fkts7LcAdOalvdUrZE0oA1A6pJUkx9c/V8ZFuclg7uNdnXV98iHWlA6tcvV69HsdBJZU3w66+6rxGgM0dbwSalRz60IGM40HwRT"
public_key = "l6+ivQ8i/jsUJ+juI7q/7vSoTpd0k9Gv7DkjGWg1527I+LJeropVSaRqwDcrnuM1IfUCu0QdRoU8e0sW7kQGnwObJhnRcxiGPa1inwnneq9zdXK8BGgV2E4POKdwbEBlmjZmW8j4JMnCsLvZ4hxBjZB/3fnvHhn7UCqd2C6FhOz9k+aK2kxXHxdDdO9BzKqtvm5dSAxHhw6nDHSU+cHupjiiY/SvmFH0QpR5Fn1kyZH7DxV4D8R9wvP9jKZe/RRTEkB2HY7FpVNz/EqO/z5bv7japQ5LZY1fFOK47S5KVo20y12XwkBcHeL5Bc8MuKt552JSRH7KKxvr2KD9QN5lCc0sOnQnlOK0INGHeIY4WnUSBvlVd4aOAJa4xE2PP0/k"
subnet_ids = tolist(module.public_subnets.public_subnet_id)
iam_instance_profile = module.iam-role.name
assign_eip_address = true
Expand All @@ -113,7 +114,6 @@ module "acm" {
enable_dns_validation = false
}


##-----------------------------------------------------------------------------
## nlb module call.
##-----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ resource "aws_lb_target_group" "main" {
## For attaching resources with Elastic Load Balancer (ELB), see the aws_elb_attachment resource.
##-----------------------------------------------------------------------------
resource "aws_lb_target_group_attachment" "attachment" {
# count = var.enable && var.with_target_group && var.load_balancer_type == "application" && var.target_type == "" ? var.instance_count : 0
count = var.enable && var.with_target_group && var.load_balancer_type == "application" ? length(var.https_listeners) : 0

target_group_arn = element(aws_lb_target_group.main[*].arn, count.index)
Expand Down
12 changes: 0 additions & 12 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -277,18 +277,6 @@ variable "health_check_healthy_threshold" {
description = "The number of successful health checks before an instance is put into service."
}

variable "target_type" {
type = string
default = ""
description = "The type of target that you must specify when registering targets with this target group."
}

#variable "access_logs" {
# type = bool
# default = false
# description = "Access logs Enable or Disable."
#}

variable "access_logs" {
type = map(string)
default = {}
Expand Down

0 comments on commit ef91c0c

Please sign in to comment.