From 79a3fcacdf42a02df70f2f138fd3d9c7392b26a5 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Thu, 5 Jan 2017 20:35:52 +0000 Subject: [PATCH] elasticbeanstalk demo fixes --- demo-17/elasticbeanstalk.tf | 4 +-- demo-17/iam.tf | 65 +++++++++++++++++++++++++++++++++++++ demo-17/output.tf | 3 ++ demo-17/rds.tf | 6 ++-- demo-17/vpc.tf | 33 +++++++++++++++++++ 5 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 demo-17/iam.tf diff --git a/demo-17/elasticbeanstalk.tf b/demo-17/elasticbeanstalk.tf index 7ef7cb7..0aad060 100644 --- a/demo-17/elasticbeanstalk.tf +++ b/demo-17/elasticbeanstalk.tf @@ -25,7 +25,7 @@ resource "aws_elastic_beanstalk_environment" "app-prod" { setting { namespace = "aws:autoscaling:launchconfiguration" name = "IamInstanceProfile" - value = "app-ec2-role" + value = "${aws_iam_instance_profile.app-ec2-role.name}" } setting { namespace = "aws:autoscaling:launchconfiguration" @@ -45,7 +45,7 @@ resource "aws_elastic_beanstalk_environment" "app-prod" { setting { namespace = "aws:elasticbeanstalk:environment" name = "ServiceRole" - value = "aws-elasticbeanstalk-service-role" + value = "${aws_iam_role.elasticbeanstalk-service-role.name}" } setting { namespace = "aws:ec2:vpc" diff --git a/demo-17/iam.tf b/demo-17/iam.tf new file mode 100644 index 0000000..0113051 --- /dev/null +++ b/demo-17/iam.tf @@ -0,0 +1,65 @@ +# iam roles +resource "aws_iam_role" "app-ec2-role" { + name = "app-ec2-role" + assume_role_policy = <