forked from aws-samples/eb-php-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 2
/
eb.tf
54 lines (46 loc) · 1.55 KB
/
eb.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
resource "aws_elastic_beanstalk_application" "dev" {
name = "${var.project_name}"
description = "AWS Elastic Beanstalk Application"
}
resource "aws_elastic_beanstalk_environment" "dev" {
name = "${var.project_name}"
application = "${aws_elastic_beanstalk_application.dev.name}"
solution_stack_name = "64bit Amazon Linux 2018.03 v2.8.11 running PHP 7.2"
setting {
namespace = "aws:autoscaling:launchconfiguration"
name = "IamInstanceProfile"
value = "aws-elasticbeanstalk-ec2-role"
}
setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "RDS_DB_NAME"
value = "${var.rds_name}"
}
setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "RDS_HOSTNAME"
value = "${aws_db_instance.dev.address}"
}
setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "RDS_PORT"
value = "${var.rds_port}"
}
setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "RDS_USERNAME"
value = "${var.rds_username}"
}
setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "RDS_PASSWORD"
value = "${var.rds_password}"
}
}
resource "aws_elastic_beanstalk_application_version" "dev" {
name = "${var.project_version}"
application = "${var.project_name}"
description = "AWS Elastic Beanstalk Application Version"
bucket = "${aws_s3_bucket.dev.id}"
key = "${aws_s3_bucket_object.dev.id}"
}