From d7e2eea8be020156299c69901e03a55bdc4e5252 Mon Sep 17 00:00:00 2001 From: UdhavPawar Date: Thu, 16 Sep 2021 14:39:34 -0700 Subject: [PATCH] added beanstalk resource --- terraform/aws/new-beanstalk/main.tf | 11 +++++++++++ terraform/aws/new-beanstalk/outputs.tf | 7 +++++++ terraform/aws/new-beanstalk/variables.tf | 25 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 terraform/aws/new-beanstalk/main.tf create mode 100644 terraform/aws/new-beanstalk/outputs.tf create mode 100644 terraform/aws/new-beanstalk/variables.tf diff --git a/terraform/aws/new-beanstalk/main.tf b/terraform/aws/new-beanstalk/main.tf new file mode 100644 index 0000000..1a55091 --- /dev/null +++ b/terraform/aws/new-beanstalk/main.tf @@ -0,0 +1,11 @@ +resource "aws_elastic_beanstalk_application" "demo_beanstalk_application" { + name = var.demo_beanstalk_application_name + description = var.demo_beanstalk_application_description +} + +resource "aws_elastic_beanstalk_environment" "demo_beanstalk_environment" { + name = var.demo_beanstalk_environment_name + application = aws_elastic_beanstalk_application.demo_beanstalk_application.name + // For all supported AWS BeanStalk Platforms / Stacks refer : https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html + solution_stack_name = var.demo_beanstalk_environment_platform +} \ No newline at end of file diff --git a/terraform/aws/new-beanstalk/outputs.tf b/terraform/aws/new-beanstalk/outputs.tf new file mode 100644 index 0000000..2aef4a1 --- /dev/null +++ b/terraform/aws/new-beanstalk/outputs.tf @@ -0,0 +1,7 @@ +output "demo_beanstalk_application_name" { + value = "${aws_elastic_beanstalk_application.demo_beanstalk_application.name}" +} + +output "demo_beanstalk_environment_name" { + value = "${aws_elastic_beanstalk_environment.demo_beanstalk_environment.name}" +} \ No newline at end of file diff --git a/terraform/aws/new-beanstalk/variables.tf b/terraform/aws/new-beanstalk/variables.tf new file mode 100644 index 0000000..c975a3f --- /dev/null +++ b/terraform/aws/new-beanstalk/variables.tf @@ -0,0 +1,25 @@ +// Define application variables +variable "demo_beanstalk_application_name" { + type = "string" + default = "" + description = "AWS beanstalk application name" +} + +variable "demo_beanstalk_application_description" { + type = "string" + default = "" + description = "AWS beanstalk application description" +} + +// Define environment variables +variable "demo_beanstalk_environment_name" { + type = "string" + default = "" + description = "AWS beanstalk environment name" +} + +variable "demo_beanstalk_environment_platform" { + type = "string" + default = "64bit Amazon Linux 2015.03 v2.0.3 running Go 1.4" + description = "AWS beanstalk environment platform" +} \ No newline at end of file