aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
diff options
context:
space:
mode:
authorpmikus <peter.mikus@protonmail.ch>2023-01-25 12:54:28 +0000
committerPeter Mikus <peter.mikus@protonmail.ch>2023-01-25 15:12:17 +0000
commit61cf4d230c3bd88cd0a6f3782796cc3949485b72 (patch)
tree90aa5f8366dd561bb2b5d64c4d3b77edb81ed40b /fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/main.tf
parenta76b2a54b95e2a6b9620a631098f0016a0dc8e40 (diff)
feat(terraform): Refactor application version deploy
Signed-off-by: pmikus <peter.mikus@protonmail.ch> Change-Id: I065a018745a82762c816de96d8a69116416aa0ce
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
}