You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the current setup it is not possible to conditionally configure an S3 Bucket with replication_configuration.
The true and false result expressions can't have consistent types, because the module code is not designed for that.
If the condition is true (replication_configuration should be defined), then an empty object ({}) as false result is not accepted and raises a Terraform error The true and false result expressions must have consistent types. The 'true' value includes object attribute "role", which is absent in the 'false' value., only null is possible.
If the condition is false (replication_configuration should not be defined), null is not accepted by the module code, resulting in the error Invalid value for "inputMap" parameter: argument must not be null..
Versions
Module version [Required]: 4.2.2
Terraform version: Terraform v1.9.8 on linux_amd64
The module should not give an error and should not set replication if var.replication_configuration == null
Actual behavior
It is not possible to conditionally set replication_configuration
Terminal Output Screenshot(s)
╷
│ Error: Invalid function argument
│
│ on .terraform/modules/s3_bucket/main.tf line 373, in resource "aws_s3_bucket_replication_configuration" "this":
│ 373: count = local.create_bucket && length(keys(var.replication_configuration)) > 0 ? 1 : 0
│ ├────────────────
│ │ while calling keys(inputMap)
│ │ var.replication_configuration is null
│
│ Invalid value for "inputMap" parameter: argument must not be null.
Description
With the current setup it is not possible to conditionally configure an S3 Bucket with
replication_configuration
.The
true
andfalse
result expressions can't have consistent types, because the module code is not designed for that.If the condition is true (replication_configuration should be defined), then an empty object (
{}
) as false result is not accepted and raises a Terraform errorThe true and false result expressions must have consistent types. The 'true' value includes object attribute "role", which is absent in the 'false' value.
, onlynull
is possible.If the condition is false (replication_configuration should not be defined),
null
is not accepted by the module code, resulting in the errorInvalid value for "inputMap" parameter: argument must not be null.
.Versions
Module version [Required]: 4.2.2
Terraform version:
Terraform v1.9.8 on linux_amd64
Provider version(s):
+ provider registry.terraform.io/hashicorp/aws v5.73.0
Reproduction Code [Required]
Steps to reproduce the behavior:
Expected behavior
The module should not give an error and should not set replication if
var.replication_configuration == null
Actual behavior
It is not possible to conditionally set replication_configuration
Terminal Output Screenshot(s)
note: initially reported at #285
The text was updated successfully, but these errors were encountered: