terraform-aws-iam-system-user
terraform-aws-iam-system-user copied to clipboard
Bug: Output error when access key creation disabled
Describe the Bug
When you configure:
create_iam_access_key = false
After PR #58 the code will fail with the error:
Expand me
╷
│ Error: Splat of null value
│
│ on .terraform/modules/aws_iam_user_ses/outputs.tf line 17, in output "access_key_id":
│ 17: value = join("", local.access_key.*.id)
│ ├────────────────
│ │ local.access_key is null
│
│ Splat expressions (with the * symbol) cannot be applied to null sequences.
╵
╷
│ Error: Splat of null value
│
│ on .terraform/modules/aws_iam_user_ses/outputs.tf line 23, in output "secret_access_key":
│ 23: value = join("", local.access_key.*.secret)
│ ├────────────────
│ │ local.access_key is null
│
│ Splat expressions (with the * symbol) cannot be applied to null sequences.
╵
╷
│ Error: Splat of null value
│
│ on .terraform/modules/aws_iam_user_ses/outputs.tf line 29, in output "ses_smtp_password_v4":
│ 29: value = join("", compact(local.access_key.*.ses_smtp_password_v4))
│ ├────────────────
│ │ local.access_key is null
│
│ Splat expressions (with the * symbol) cannot be applied to null sequences.
╵
Expected Behavior
This code runs without this error
Steps to Reproduce
- Use this module with
create_iam_access_key = false. - Try to do a plan.
- See error
Screenshots
If applicable, add screenshots or logs to help explain your problem.
Environment (please complete the following information):
Terraform v1.1.5
on linux_amd64
+ provider registry.terraform.io/cloudposse/awsutils v0.11.0
+ provider registry.terraform.io/hashicorp/aws v3.74.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
I think this is still happening.