diff options
author | Peter Mikus <pmikus@cisco.com> | 2022-03-16 16:42:57 +0100 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2022-03-17 13:06:15 +0000 |
commit | 6c8ca0ad2a9fe0bab2033e41c6b056226cf9a856 (patch) | |
tree | 532941f4850185b3c174de1696d58357bacdc0f7 /fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version | |
parent | 273a9aa49bba07740b7f7e15277d05f334ab6cc1 (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')
10 files changed, 122 insertions, 0 deletions
diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/README.md b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/README.md new file mode 100644 index 0000000000..0ab18bdbb8 --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/README.md @@ -0,0 +1,38 @@ +<!-- BEGIN_TF_DOCS --> +## Requirements + +| Name | Version | +|------|---------| +| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.1.4 | +| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.3.0 | + +## Providers + +| Name | Version | +|------|---------| +| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.3.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_elastic_beanstalk_application_version.application_version](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elastic_beanstalk_application_version) | resource | +| [aws_s3_bucket.bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | +| [aws_s3_object.object](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_object) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| <a name="input_application_description"></a> [application\_description](#input\_application\_description) | Short description of the Application Version. | `string` | `"Beanstalk Application"` | no | +| <a name="input_application_name"></a> [application\_name](#input\_application\_name) | Name of the Beanstalk Application the version is associated. | `string` | `"Beanstalk"` | no | +| <a name="input_application_version_name"></a> [application\_version\_name](#input\_application\_version\_name) | Unique name for the this Application Version. | `string` | `"Beanstalk Version"` | no | + +## Outputs + +No outputs. +<!-- END_TF_DOCS -->
\ No newline at end of file diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/main.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/main.tf new file mode 100644 index 0000000000..652509225f --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/main.tf @@ -0,0 +1,4 @@ +module "elastic_beanstalk_application_version" { + source = "../" + application_description = var.application_description +} diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/output.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/output.tf new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/output.tf diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/providers.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/providers.tf new file mode 100644 index 0000000000..5ff54f0d65 --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/providers.tf @@ -0,0 +1,3 @@ +provider "aws" { + region = var.region +}
\ No newline at end of file diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/variables.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/variables.tf new file mode 100644 index 0000000000..12af1d64c6 --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/variables.tf @@ -0,0 +1,11 @@ +variable "region" { + description = "AWS Region." + type = string + default = "us-east-1" +} + +variable "application_description" { + description = "Short description of the application." + type = string + default = "Beanstalk Application" +} diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/versions.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/versions.tf new file mode 100644 index 0000000000..af1be4a4e1 --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/example/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.3.0" + } + } + required_version = ">= 1.1.4" +} 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 +} diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/output.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/output.tf new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/output.tf diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/variables.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/variables.tf new file mode 100644 index 0000000000..6ac2ae7bfe --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/variables.tf @@ -0,0 +1,17 @@ +variable "application_description" { + description = "Short description of the Application Version." + type = string + default = "Beanstalk Application" +} + +variable "application_name" { + description = "Name of the Beanstalk Application the version is associated." + type = string + default = "Beanstalk" +} + +variable "application_version_name" { + description = "Unique name for the this Application Version." + type = string + default = "Beanstalk Version" +} diff --git a/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/versions.tf b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/versions.tf new file mode 100644 index 0000000000..66b9c17f9b --- /dev/null +++ b/fdio.infra.terraform/terraform-aws-elastic-beanstalk-application-version/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 4.3.0" + } + } + required_version = ">= 1.1.4" +} |