|
@@ -18,117 +18,6 @@ data "aws_kms_key" "ebs-key" {
|
|
|
#------------------------------------
|
|
|
# EC2 ASG
|
|
|
#------------------------------------
|
|
|
-# TODO: switch this to Launch Template for gp3 volume usage.
|
|
|
-# https://github.com/terraform-community-modules/tf_aws_asg_elb/issues/11
|
|
|
-# module "customer_portal_asg" {
|
|
|
-# source = "terraform-aws-modules/autoscaling/aws"
|
|
|
-# version = "3.9.0"
|
|
|
-# name = "customer-portal"
|
|
|
-
|
|
|
-# lc_name = "customer-portal-lc"
|
|
|
-
|
|
|
-# iam_instance_profile = aws_iam_instance_profile.portal_server_instance_profile.name
|
|
|
-# image_id = local.ami_map[local.ami_selection]
|
|
|
-# instance_type = var.instance_type
|
|
|
-# security_groups = [ data.aws_security_group.typical-host.id, aws_security_group.customer_portal.id ]
|
|
|
-# user_data = data.template_cloudinit_config.cloud-init.rendered
|
|
|
-# key_name = "msoc-build"
|
|
|
-# ebs_optimized = true
|
|
|
-# target_group_arns = [ aws_alb_target_group.portal.arn, ]
|
|
|
-
|
|
|
-# root_block_device = [
|
|
|
-# {
|
|
|
-# volume_type = "gp2"
|
|
|
-# volume_size = "100"
|
|
|
-# delete_on_termination = true
|
|
|
-# encrypted = true
|
|
|
-# kms_key_id = data.aws_kms_key.ebs-key.arn
|
|
|
-# },
|
|
|
-# ]
|
|
|
-
|
|
|
-# ebs_block_device = [
|
|
|
-# {
|
|
|
-# # swap
|
|
|
-# device_name = "/dev/xvdm"
|
|
|
-# #volume_size = xx
|
|
|
-# delete_on_termination = true
|
|
|
-# encrypted = true
|
|
|
-# kms_key_id = data.aws_kms_key.ebs-key.arn
|
|
|
-# # Snapshot IDs need to be grabbed from the ami, or it will replace every time. It's ugly.
|
|
|
-# # This may prompt replacement when the AMI is updated.
|
|
|
-# # See:
|
|
|
-# # https://github.com/hashicorp/terraform/issues/19958
|
|
|
-# # https://github.com/terraform-providers/terraform-provider-aws/issues/13118
|
|
|
-# snapshot_id = local.block_device_mappings[local.ami_selection]["/dev/xvdm"].ebs.snapshot_id
|
|
|
-# },
|
|
|
-# {
|
|
|
-# # /home
|
|
|
-# device_name = "/dev/xvdn"
|
|
|
-# # volume_size = xx
|
|
|
-# delete_on_termination = true
|
|
|
-# encrypted = true
|
|
|
-# kms_key_id = data.aws_kms_key.ebs-key.arn
|
|
|
-# snapshot_id = local.block_device_mappings[local.ami_selection]["/dev/xvdn"].ebs.snapshot_id
|
|
|
-# },
|
|
|
-# {
|
|
|
-# # /var
|
|
|
-# device_name = "/dev/xvdo"
|
|
|
-# # volume_size = xx
|
|
|
-# delete_on_termination = true
|
|
|
-# encrypted = true
|
|
|
-# kms_key_id = data.aws_kms_key.ebs-key.arn
|
|
|
-# snapshot_id = local.block_device_mappings[local.ami_selection]["/dev/xvdo"].ebs.snapshot_id
|
|
|
-# },
|
|
|
-# {
|
|
|
-# # /var/tmp
|
|
|
-# device_name = "/dev/xvdp"
|
|
|
-# # volume_size = xx
|
|
|
-# delete_on_termination = true
|
|
|
-# encrypted = true
|
|
|
-# kms_key_id = data.aws_kms_key.ebs-key.arn
|
|
|
-# snapshot_id = local.block_device_mappings[local.ami_selection]["/dev/xvdp"].ebs.snapshot_id
|
|
|
-# },
|
|
|
-# {
|
|
|
-# # /var/log
|
|
|
-# device_name = "/dev/xvdq"
|
|
|
-# # volume_size = xx
|
|
|
-# delete_on_termination = true
|
|
|
-# encrypted = true
|
|
|
-# kms_key_id = data.aws_kms_key.ebs-key.arn
|
|
|
-# snapshot_id = local.block_device_mappings[local.ami_selection]["/dev/xvdq"].ebs.snapshot_id
|
|
|
-# },
|
|
|
-# {
|
|
|
-# # /var/log/audit
|
|
|
-# device_name = "/dev/xvdr"
|
|
|
-# # volume_size = xx
|
|
|
-# delete_on_termination = true
|
|
|
-# encrypted = true
|
|
|
-# kms_key_id = data.aws_kms_key.ebs-key.arn
|
|
|
-# snapshot_id = local.block_device_mappings[local.ami_selection]["/dev/xvdr"].ebs.snapshot_id
|
|
|
-# },
|
|
|
-# {
|
|
|
-# # /tmp
|
|
|
-# device_name = "/dev/xvds"
|
|
|
-# # volume_size = xx
|
|
|
-# delete_on_termination = true
|
|
|
-# encrypted = true
|
|
|
-# kms_key_id = data.aws_kms_key.ebs-key.arn
|
|
|
-# snapshot_id = local.block_device_mappings[local.ami_selection]["/dev/xvds"].ebs.snapshot_id
|
|
|
-# },
|
|
|
-# ]
|
|
|
-
|
|
|
-
|
|
|
-# # Auto scaling group
|
|
|
-# asg_name = "customer-portal-asg"
|
|
|
-# vpc_zone_identifier = var.private_subnets
|
|
|
-# health_check_type = "EC2"
|
|
|
-# min_size = 1
|
|
|
-# max_size = 2
|
|
|
-# desired_capacity = 2
|
|
|
-# wait_for_capacity_timeout = 0
|
|
|
-# tags_as_map = merge(var.standard_tags, var.tags)
|
|
|
-# }
|
|
|
-
|
|
|
resource "aws_launch_template" "customer_portal" {
|
|
|
name = "customer-portal-lt"
|
|
|
instance_type = var.instance_type
|