August 2019
Beginner
608 pages
16h 7m
English
In this file, we declare the Amazon EC2 instances. We have several instances, but we will start with the first frontend application server defined in this file:
resource "aws_instance" "FRONTEND_A" { ami = "${lookup(var.aws_ubuntu_amis,var.region)}" subnet_id = "${aws_subnet.public-frontend_az-a.id}" key_name = "${aws_key_pair.keypair.key_name}" vpc_security_group_ids = ["${aws_security_group.SG-frontendservers.id}"] instance_type = "t2.medium" tags { Name = "${var.environment}-FRONTEND001" Environment = "${var.environment}" sshUser = "ubuntu" }}
The declaration that this block starts with constitutes an Amazon resource of aws_instance type and is called FRONTEND_A:
resource "aws_instance" "FRONTEND_A" {
Next, the first line ...
Read now
Unlock full access