aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
diff options
context:
space:
mode:
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.tf21
1 files changed, 9 insertions, 12 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
index 4a9f473baa..ace3aebbbc 100644
--- a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
+++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
@@ -1,7 +1,5 @@
locals {
- bucket = "${var.application_name}-bucket"
- key = "${var.application_name}.zip"
- source = "app.zip"
+ key = "${var.application_name_version}-${uuid()}.zip"
tags = {
"Name" = "${var.application_name}"
"Environment" = "${var.application_name}"
@@ -9,23 +7,22 @@ locals {
}
# Create elastic beanstalk Application Version
-resource "aws_s3_bucket" "bucket" {
- bucket = local.bucket
- tags = local.tags
-}
-
+# resource "aws_s3_bucket" "bucket" {
+# bucket = var.application_bucket
+# tags = local.tags
+# }
resource "aws_s3_object" "object" {
- bucket = aws_s3_bucket.bucket.id
+ bucket = var.application_bucket
key = local.key
- source = local.source
+ source = var.application_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
+ bucket = var.application_bucket
key = aws_s3_object.object.id
- name = var.application_version_name
+ name = var.application_name_version
tags = local.tags
}