aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2022-03-16 16:42:57 +0100
committerPeter Mikus <pmikus@cisco.com>2022-03-17 13:06:15 +0000
commit6c8ca0ad2a9fe0bab2033e41c6b056226cf9a856 (patch)
tree532941f4850185b3c174de1696d58357bacdc0f7 /fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
parent273a9aa49bba07740b7f7e15277d05f334ab6cc1 (diff)
feat(dash): Terraform AWS Beanstalk split
Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I6a9f54be0f734cd267c7ea5aa7f9933e04a8e139
Diffstat (limited to 'fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf')
-rw-r--r--fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf31
1 files changed, 31 insertions, 0 deletions
diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
new file mode 100644
index 0000000000..4a9f473baa
--- /dev/null
+++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
@@ -0,0 +1,31 @@
+locals {
+ bucket = "${var.application_name}-bucket"
+ key = "${var.application_name}.zip"
+ source = "app.zip"
+ tags = {
+ "Name" = "${var.application_name}"
+ "Environment" = "${var.application_name}"
+ }
+}
+
+# Create elastic beanstalk Application Version
+resource "aws_s3_bucket" "bucket" {
+ bucket = local.bucket
+ tags = local.tags
+}
+
+resource "aws_s3_object" "object" {
+ bucket = aws_s3_bucket.bucket.id
+ key = local.key
+ source = local.source
+ tags = local.tags
+}
+
+resource "aws_elastic_beanstalk_application_version" "application_version" {
+ application = var.application_name
+ description = var.application_description
+ bucket = aws_s3_bucket.bucket.id
+ key = aws_s3_object.object.id
+ name = var.application_version_name
+ tags = local.tags
+}