· 8 years ago · Nov 30, 2017, 10:52 PM
1|aws
2 |Environments
3 |STAGING
4 |Modules
5 |Compute
6 |Networking
7
8 |PRODUCTION
9 |Modules
10 |Compute
11 |Networking
12
13provider "aws" {
14 access_key = "${var.access_key}"
15 secret_key = "${var.secret_key}"
16 region = "${var.region}"
17}
18
19resource "aws_instance" "oracle_ec2" {
20 ami = "${lookup(var.ami, var.region)}"
21 instance_type = "${var.instance_type}"
22 key_name = "${var.key_name}"
23 subnet_id = "${var.subnet_id}"
24
25 vpc_security_group_ids = ["${aws_security_group.oracle_sg_new.id}"]
26
27 root_block_device {
28 volume_type = "gp2"
29 volume_size = 10
30 delete_on_termination = true
31 }
32
33 ebs_block_device {
34 device_name = "/dev/xvdb"
35 volume_type = "gp2"
36 volume_size = 200
37 delete_on_termination = true
38 }
39
40 count = "${var.instance_count}"
41
42 tags {
43 Name = "Ora"
44 }
45
46}