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

iam-assumable-role module variable name is set to "" instead of null #318

Closed
a-khaledf opened this issue Dec 9, 2022 · 3 comments
Closed

Comments

@a-khaledf
Copy link

Description

iam-assumable-role module have variablerole_name set to be "" instead of null like all other submodules

which causes issues when you only have role_prefix_name only set

Versions

  • Module version [Required]:
    5.9.1
  • Terraform version:
    1.2.6
  • Provider version(s):
    terraform-provider-aws: 4.44.0

Reproduction Code [Required]

Example source code

module "grafana_cloudwatch_role" {
  source  = "terraform-aws-modules/iam/aws//modules/iam-assumable-role"
  version = "5.9.1"

  trusted_role_arns = [
    <iam_role_arn>
  ]

  create_role = true

  role_name_prefix = "role_without_name-"

  custom_role_policy_arns = [
    <iam_policy_arn>
  ]
  number_of_custom_role_policy_arns = 1
}

Expected behavior

Should plan correctly since https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role input name is optional`

Actual behavior

╷
│ Error: Conflicting configuration arguments
│
│   with module.grafana_cloudwatch_role.aws_iam_role.this[0],
│   on .terraform/modules/grafana_cloudwatch_role/modules/iam-assumable-role/main.tf line 126, in resource "aws_iam_role" "this":
│  126:   name                 = var.role_name
│
│ "name": conflicts with name_prefix
╵
╷
│ Error: Conflicting configuration arguments
│
│   with module.grafana_cloudwatch_role.aws_iam_role.this[0],
│   on .terraform/modules/grafana_cloudwatch_role/modules/iam-assumable-role/main.tf line 127, in resource "aws_iam_role" "this":
│  127:   name_prefix          = var.role_name_prefix
│
│ "name_prefix": conflicts with name
╵

Terminal Output Screenshot(s)

image

@bryantbiggs
Copy link
Member

closed in #319 thanks to @magreenbaum 🎉

@a-khaledf
Copy link
Author

Thanks @bryantbiggs and @magreenbaum

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants