Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Output error when access key creation disabled #62

Closed
cdobbyn opened this issue Feb 10, 2022 · 1 comment · Fixed by #70
Closed

Bug: Output error when access key creation disabled #62

cdobbyn opened this issue Feb 10, 2022 · 1 comment · Fixed by #70
Labels
bug 🐛 An issue with the system

Comments

@cdobbyn
Copy link

cdobbyn commented Feb 10, 2022

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

  1. Use this module with create_iam_access_key = false.
  2. Try to do a plan.
  3. 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
@cdobbyn cdobbyn added the bug 🐛 An issue with the system label Feb 10, 2022
@joshuabalduff
Copy link

I think this is still happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants