Skip to content

Instantly share code, notes, and snippets.

@chrisferry
Created April 20, 2015 21:50
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrisferry/780140d709bfad51038c to your computer and use it in GitHub Desktop.
Save chrisferry/780140d709bfad51038c to your computer and use it in GitHub Desktop.
# iops
resource "aws_db_instance" "rds" {
identifier = "${var.identifier}"
allocated_storage = "${var.allocated_storage}"
iops = "${var.iops}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
instance_class = "${var.instance_class}"
name = "${var.db_name}"
username = "${var.db_username}"
password = "${var.db_password}"
db_subnet_group_name = "${var.db_subnet_group_name}"
parameter_group_name = "${var.parameter_group_name}"
vpc_security_group_ids = ["${split(",", var.vpc_security_group_ids)}"]
}
#non iops
resource "aws_db_instance" "rds" {
identifier = "${var.identifier}"
allocated_storage = "${var.allocated_storage}"
storage_type = "${var.storage_type}"
engine = "${var.engine}"
engine_version = "${var.engine_version}"
instance_class = "${var.instance_class}"
name = "${var.db_name}"
username = "${var.db_username}"
password = "${var.db_password}"
db_subnet_group_name = "${var.db_subnet_group_name}"
parameter_group_name = "${var.parameter_group_name}"
vpc_security_group_ids = ["${split(",", var.vpc_security_group_ids)}"]
}
#elb non-ssl
resource "aws_elb" "elb" {
name = "${var.elb_name}"
subnets = ["${split(",", var.subnet_azs)}"]
internal = "${var.elb_is_internal}"
security_groups = ["${var.elb_security_group}"]
listener {
instance_port = "${var.backend_port}"
instance_protocol = "${var.backend_protocol}"
lb_port = "${var.lb_port}"
lb_protocol = "${var.lb_protocol}"
}
health_check {
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 3
target = "${var.health_check_target}"
interval = 30
}
cross_zone_load_balancing = true
}
#elb ssl
resource "aws_elb" "elb" {
name = "${var.elb_name}"
subnets = ["${split(",", var.subnet_azs)}"]
internal = "${var.elb_is_internal}"
security_groups = ["${var.elb_security_group}"]
listener {
instance_port = "${var.backend_port}"
instance_protocol = "${var.backend_protocol}"
lb_port = "${var.lb_port}"
lb_protocol = "${var.lb_protocol}"
ssl_certificate_id = "${var.ssl_certificate_id}"
}
health_check {
healthy_threshold = 2
unhealthy_threshold = 2
timeout = 3
target = "${var.health_check_target}"
interval = 30
}
cross_zone_load_balancing = true
}
@ringods
Copy link

ringods commented Oct 26, 2016

For the ELB example, another variant is whether or not you want the access logs stored in an S3 bucket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment