-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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]: Empty "assume_role.role_arn" results in provider error and fails to plan/apply #39296
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
This issue was well documented by @evan-cleary. My team has experienced the same problem. |
Fix/workaround for error 'The argument "role_arn" is required, but no definition was found.' (terraform-provider-aws v5.67.0). See also issue hashicorp/terraform-provider-aws#39296.
Hi, To have a cleaner TF syntax, this works with dynamic "assume_role" {
for_each = var.aws_assume_role != null ? [1] : []
content {
role_arn = var.aws_assume_role
}
} |
This will be resolved by #39328. We're planning to release a bug fix update this Monday, 16 September. In addition to the workarounds listed above, you can also set the value of variable "var.aws_assume_role" {
type = string
default = null
} |
I am getting the same error even with with following config that defaults provider "aws" {
profile = var.aws_profile
region = var.region
shared_credentials_files = [pathexpand(var.shared_credentials_file)]
assume_role {
role_arn = var.role_arn
# Inherit session tags from the configure-aws-credentials action
transitive_tag_keys = [
"GitHub",
"Repository",
"Workflow",
"Action",
"Actor",
"Branch",
"Commit"
]
}
default_tags {
tags = local.tags
}
}
variable "aws_profile" {
type = string
default = null
}
variable "role_arn" {
type = string
default = null
}
variable "shared_credentials_file" {
type = string
default = "~/.aws/credentials"
}
variable "vault_address" {
default = null
} |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
Is this bug fix release still planned? |
This functionality has been released in v5.68.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Terraform Core Version
1.4.7
AWS Provider Version
5.67.0
Affected Resource(s)
Expected Behavior
Provider previously ignored assume role blocks when
role_arn
was left as empty string""
ornull
.We depend on this as we optionally configure assume_role in our terraform using configurations like:
and
Actual Behavior
Provider now fails to plan/apply saying the role_arn is required.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
The majority of our terraform configurations support conditionally using an assume_role to support our local development and the CI pipelines, this change has broken conditional assume roles for any configuration set up prior to the introduction of dynamics.
References
This appears to be the result of: #39255
Comments within the schema change show intentional of backwards compatibility with empty
assume_role.role_arn
attributeshttps://github.com/hashicorp/terraform-provider-aws/pull/39255/files#diff-cddd9e71748414f0ca51a47f3c35f8c45522d41c9477d3cfae3374dd656610f1R192
But then in implementation requirement of that property is enforced
https://github.com/hashicorp/terraform-provider-aws/pull/39255/files#diff-58d6a027753b50994deb7e11e4a99dde423f35844986019bd9cea5e0c94aba22R793-R798
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: