-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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]: data "aws_default_tags" "tags" output return null instead empty map cause downstream function error. #27372
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I do suspect this commit cause the behavior change for this issue. b88ec64#diff-b5fa0211b5d847acdd947ec2883f8d4b5c26ed49d43ce64e2df81d2bc9554b14R79 |
For this configuration provider "aws" {}
data "aws_default_tags" "test" {} after v4.35.0{
"version": 4,
"terraform_version": "1.0.9",
"serial": 1,
"lineage": "a36acc25-7b24-3722-9db9-d2a511f5a9bd",
"outputs": {},
"resources": [
{
"mode": "data",
"type": "aws_default_tags",
"name": "test",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "aws",
"tags": {}
},
"sensitive_attributes": []
}
]
}
]
} v4.36.0{
"version": 4,
"terraform_version": "1.0.9",
"serial": 1,
"lineage": "4c80dd1c-6f90-5d8a-383d-a86f23481cd8",
"outputs": {},
"resources": [
{
"mode": "data",
"type": "aws_default_tags",
"name": "test",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "aws",
"tags": null
},
"sensitive_attributes": []
}
]
}
]
} |
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.2.9
AWS Provider Version
4.36.0
Affected Resource(s)
data.aws_default_tags
Expected Behavior
data.aws_default_tags.example.tags returns empty map, this returns empty map in older versions.
Actual Behavior
data.aws_default_tags.example.tags returns null
Relevant Error/Panic Output Snippet
Terraform Configuration Files
data "aws_default_tags" "provider" {}
locals {
tags = {
for k, v in {
app_id = var.app_id
chargeback_id = local.chargeback_id
environment = local.workspace
product = var.product_name
} : k => v if lookup(data.aws_default_tags.provider.tags, k, null) == null || lookup(data.aws_default_tags.provider.tags, k, null) != v
}
all_tags = merge(local.tags, var.tags)
}
Steps to Reproduce
terraform init
terraform apply
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No response
The text was updated successfully, but these errors were encountered: