12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- /***************************************************
- * AUTO SCALING GROUP FOR NUXEO INSTANCE
- ****************************************************/
- resource "aws_launch_configuration" "asg_launch_nuxeo" {
- name = "asg_launch_nuxeo"
- image_id = "ami-2b10bc4b"
- instance_type = "t2.micro"
- key_name = "packer_5832e178-3196-2110-e869-232a71aa6853"
- security_groups = ["${var.alb_secgroups}"]
- enable_monitoring = false
- ebs_optimized = false
- #iam_instance_profile = "${aws_iam_instance_profile.nuxeo_instance_profile.id}"
- user_data = "${file("userdata.sh")}"
- root_block_device {
- volume_type = "gp2"
- volume_size = 20
- delete_on_termination = true
- }
- }
- resource "aws_autoscaling_group" "asg_nuxeo" {
- name = "asg_nuxeo"
- health_check_grace_period = 60
- health_check_type = "EC2"
- launch_configuration = "${aws_launch_configuration.asg_launch_nuxeo.name}"
- max_size = "${var.asg_max}"
- min_size = "${var.asg_min}"
- desired_capacity = "${var.asg_desired}"
- vpc_zone_identifier = ["${var.app_subnets}"]
- target_group_arns = ["${aws_alb_target_group.nuxeo.arn}"]
- tag {
- key = "role"
- value = "nuxeo"
- propagate_at_launch = true
- }
- }
|