Skip to content

Commit

Permalink
rm: rhel7 -> reason defunct
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Weber <[email protected]>
  • Loading branch information
mm-weber committed Nov 1, 2024
1 parent b9c8ada commit 516da0d
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 60 deletions.
46 changes: 31 additions & 15 deletions aws/ec2-instances/amis.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,21 @@ data "aws_ami" "rhel9_cis" {
}


data "aws_ami" "rhel7" {
most_recent = true

filter {
name = "name"
values = ["RHEL_HA-7*_HVM-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

owners = ["309956199498"]
}
#data "aws_ami" "rhel7" {
# most_recent = true
#
# filter {
# name = "name"
# values = ["RHEL_HA-7*_HVM-*"]
# }
#
# filter {
# name = "virtualization-type"
# values = ["hvm"]
# }
#
# owners = ["309956199498"]
#}

data "aws_ami" "rhel7-cis-pass-private" {
most_recent = true
Expand Down Expand Up @@ -411,6 +411,22 @@ data "aws_ami" "debian12" {
owners = ["136693071363"]
}

data "aws_ami" "debian12_cis" {
most_recent = true

filter {
name = "name"
values = ["CIS Debian Linux 12*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

owners = ["679593333241"]
}

data "aws_ami" "suse15" {
most_recent = true

Expand Down
62 changes: 31 additions & 31 deletions aws/ec2-instances/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -613,37 +613,37 @@ module "centos7_hardened_community" {
associate_public_ip_address = true
}


// Red Hat Linux 7
module "rhel7" {
source = "terraform-aws-modules/ec2-instance/aws"
version = "~> 5.6.1"

create = var.create_rhel7
name = "${var.prefix}-rhel7-${random_id.instance_id.id}"
ami = data.aws_ami.rhel7.id
instance_type = var.linux_instance_type
vpc_security_group_ids = [module.linux_sg.security_group_id]
subnet_id = module.vpc.public_subnets[0]
key_name = var.aws_key_pair_name
associate_public_ip_address = true
}

module "rhel7_cnspec" {
source = "terraform-aws-modules/ec2-instance/aws"
version = "~> 5.6.1"

create = var.create_rhel7_cnspec
name = "${var.prefix}-rhel7-cnspec-${random_id.instance_id.id}"
ami = data.aws_ami.rhel7.id
instance_type = var.linux_instance_type
vpc_security_group_ids = [module.linux_sg.security_group_id]
subnet_id = module.vpc.public_subnets[0]
key_name = var.aws_key_pair_name
associate_public_ip_address = true
user_data = base64encode(local.linux_user_data)
user_data_replace_on_change = true
}
# DISFUNCT
#// Red Hat Linux 7
#module "rhel7" {
# source = "terraform-aws-modules/ec2-instance/aws"
# version = "~> 5.6.1"
#
# create = var.create_rhel7
# name = "${var.prefix}-rhel7-${random_id.instance_id.id}"
# ami = data.aws_ami.rhel7.id
# instance_type = var.linux_instance_type
# vpc_security_group_ids = [module.linux_sg.security_group_id]
# subnet_id = module.vpc.public_subnets[0]
# key_name = var.aws_key_pair_name
# associate_public_ip_address = true
#}
#
#module "rhel7_cnspec" {
# source = "terraform-aws-modules/ec2-instance/aws"
# version = "~> 5.6.1"
#
# create = var.create_rhel7_cnspec
# name = "${var.prefix}-rhel7-cnspec-${random_id.instance_id.id}"
# ami = data.aws_ami.rhel7.id
# instance_type = var.linux_instance_type
# vpc_security_group_ids = [module.linux_sg.security_group_id]
# subnet_id = module.vpc.public_subnets[0]
# key_name = var.aws_key_pair_name
# associate_public_ip_address = true
# user_data = base64encode(local.linux_user_data)
# user_data_replace_on_change = true
#}

// Private RHEL7 Image
module "rhel7_pass_private" {
Expand Down
16 changes: 8 additions & 8 deletions aws/ec2-instances/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ output "centos7_hardened_community" {
}

# rhel 7
output "rhel7" {
value = module.rhel7.public_ip == null ? "" : "ssh -o StrictHostKeyChecking=no -i ~/.ssh/${var.aws_key_pair_name} ec2-user@${module.rhel7.public_ip}"
}

#output "rhel7" {
# value = module.rhel7.public_ip == null ? "" : "ssh -o StrictHostKeyChecking=no -i ~/.ssh/${var.aws_key_pair_name} ec2-user@${module.rhel7.public_ip}"
#}
#
output "rhel7_pass_private" {
value = module.rhel7_pass_private.public_ip == null ? "" : "ssh -o StrictHostKeyChecking=no -i ~/.ssh/${var.aws_key_pair_name} ec2-user@${module.rhel7_pass_private.public_ip}"
}


output "rhel7_cnspec" {
value = module.rhel7_cnspec.public_ip == null ? "" : "ssh -o StrictHostKeyChecking=no -i ~/.ssh/${var.aws_key_pair_name} ec2-user@${module.rhel7_cnspec.public_ip}"
}
#output "rhel7_cnspec" {
# value = module.rhel7_cnspec.public_ip == null ? "" : "ssh -o StrictHostKeyChecking=no -i ~/.ssh/${var.aws_key_pair_name} ec2-user@${module.rhel7_cnspec.public_ip}"
#}
#

# rhel8
output "rhel8" {
Expand Down
12 changes: 6 additions & 6 deletions aws/ec2-instances/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ variable "create_centos7_hardened_community" {
default = false
}

variable "create_rhel7" {
default = false
}
#variable "create_rhel7" {
# default = false
#}

variable "create_rhel7_pass_private" {
default = false
}

variable "create_rhel7_cnspec" {
default = false
}
#variable "create_rhel7_cnspec" {
# default = false
#}

variable "create_rhel7_cis" {
default = false
Expand Down

0 comments on commit 516da0d

Please sign in to comment.