diff --git a/README.md b/README.md index 97afcb8..764038e 100644 --- a/README.md +++ b/README.md @@ -155,11 +155,12 @@ No modules. | [schedulers](#input\_schedulers) | (Optional) The number of schedulers that you want to run in your environment. | `string` | `null` | no | | [security\_group\_ids](#input\_security\_group\_ids) | Security group IDs for MWAA | `list(string)` | `[]` | no | | [source\_bucket\_arn](#input\_source\_bucket\_arn) | (Required) The Amazon Resource Name (ARN) of your Amazon S3 storage bucket. For example, arn:aws:s3:::airflow-mybucketname | `string` | `null` | no | -| [source\_bucket\_name](#input\_source\_bucket\_name) | New bucket will be created with the given name for MWAA when create\_s3\_bucket=true | `string` | `null` | no | +| [source\_bucket\_name](#input\_source\_bucket\_name) | New bucket will be created with the given name for MWAA when create\_s3\_bucket=true.
If set to null, then the default bucket name prefix will be set, irrespective of the value of `var.use_source_bucket_name_as_prefix` | `string` | `null` | no | | [source\_cidr](#input\_source\_cidr) | (Required) Source CIDR block which will be allowed on MWAA SG to access Airflow UI
Used only if `create_security_group=true` | `list(string)` | `[]` | no | | [startup\_script\_s3\_object\_version](#input\_startup\_script\_s3\_object\_version) | (Optional) The version of the startup shell script you want to use. You must specify the version ID that Amazon S3 assigns to the file every time you update the script. | `string` | `null` | no | | [startup\_script\_s3\_path](#input\_startup\_script\_s3\_path) | (Optional) The relative path to the script hosted in your bucket. The script runs as your environment starts before starting the Apache Airflow process. Use this script to install dependencies, modify configuration options, and set environment variables. | `string` | `null` | no | | [tags](#input\_tags) | (Optional) A map of resource tags to associate with the resource | `map(string)` | `{}` | no | +| [use\_source\_bucket\_name\_as\_prefix](#input\_use\_source\_bucket\_name\_as\_prefix) | Whether or not to use the `var.source_bucket_name` as the S3 bucket name prefix | `bool` | `true` | no | | [vpc\_id](#input\_vpc\_id) | (Required) VPC ID to deploy the MWAA Environment.
Mandatory if `create_security_group=true` | `string` | `""` | no | | [webserver\_access\_mode](#input\_webserver\_access\_mode) | (Optional) Specifies whether the webserver should be accessible over the internet or via your specified VPC. Possible options: PRIVATE\_ONLY (default) and PUBLIC\_ONLY | `string` | `"PRIVATE_ONLY"` | no | | [weekly\_maintenance\_window\_start](#input\_weekly\_maintenance\_window\_start) | (Optional) Specifies the start date for the weekly maintenance window | `string` | `null` | no | diff --git a/locals.tf b/locals.tf index e646acd..8c83d27 100644 --- a/locals.tf +++ b/locals.tf @@ -7,7 +7,7 @@ locals { source_bucket_prefix = var.source_bucket_name == null ? format("%s-%s-", "mwaa", data.aws_caller_identity.current.account_id) : (var.use_source_bucket_name_as_prefix ? var.source_bucket_name : null) - source_bucket_name = local.source_bucket_prefix != null ? null : var.var.source_bucket_name + source_bucket_name = local.source_bucket_prefix != null ? null : var.source_bucket_name default_airflow_configuration_options = { "logging.logging_level" = "INFO" diff --git a/main.tf b/main.tf index 5a73ae2..e689ee8 100644 --- a/main.tf +++ b/main.tf @@ -105,7 +105,7 @@ resource "aws_iam_role_policy_attachment" "mwaa" { resource "aws_s3_bucket" "mwaa" { count = var.create_s3_bucket ? 1 : 0 - name = local.source_bucket_name + bucket = local.source_bucket_name bucket_prefix = local.source_bucket_prefix tags = var.tags