-
Notifications
You must be signed in to change notification settings - Fork 10.1k
[Bug]: Error "connection reset by peer" when performing kms:ListAliases #41732
Copy link
Copy link
Closed
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.prioritizedPart of the maintainer teams immediate focus. To be addressed within the current quarter.Part of the maintainer teams immediate focus. To be addressed within the current quarter.providerPertains to the provider itself, rather than any interaction with AWS.Pertains to the provider itself, rather than any interaction with AWS.regressionPertains to a degraded workflow resulting from an upstream patch or internal enhancement.Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.
Description
Terraform Core Version
1.9.6,1.10.5
AWS Provider Version
5.90.0
Affected Resource(s)
aws_kms_alias (data source)
aws_kms_key (data source)
Expected Behavior
data.aws_kms_alias.lambda: Reading...
data.aws_kms_alias.lambda: Read complete after 1s [id=arn:aws:kms:us-east-1:xxxx:alias/aws/lambda]
Changes to Outputs:
+ kms_alias = {
+ arn = "arn:aws:kms:us-east-1:xxxx:alias/aws/lambda"
+ id = "arn:aws:kms:us-east-1:xxxx:alias/aws/lambda"
+ name = "alias/aws/lambda"
+ target_key_arn = "arn:aws:kms:us-east-1:xxxx:key/481cxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
+ target_key_id = "481cxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.Actual Behavior
data.aws_kms_alias.lambda: Reading...
data.aws_kms_alias.lambda: Still reading... [10s elapsed]
data.aws_kms_alias.lambda: Still reading... [20s elapsed]
data.aws_kms_alias.lambda: Still reading... [30s elapsed]
data.aws_kms_alias.lambda: Still reading... [40s elapsed]
data.aws_kms_alias.lambda: Still reading... [50s elapsed]
data.aws_kms_alias.lambda: Still reading... [1m0s elapsed]
data.aws_kms_alias.lambda: Still reading... [1m10s elapsed]
...(rinse-repeat)...
data.aws_kms_alias.lambda: Still reading... [50m50s elapsed]
data.aws_kms_alias.lambda: Still reading... [51m0s elapsed]
data.aws_kms_alias.lambda: Still reading... [51m10s elapsed]
data.aws_kms_alias.lambda: Still reading... [51m20s elapsed]
data.aws_kms_alias.lambda: Still reading... [51m30s elapsed]
data.aws_kms_alias.lambda: Still reading... [51m40s elapsed]
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: reading KMS Alias (alias/aws/lambda): operation error KMS: ListAliases, exceeded maximum number of attempts, 25, https response error StatusCode: 0, RequestID: , request send failed, Post "https://kms.us-east-1.amazonaws.com/": read tcp 10.x.y.z:59723->209.x.y.z:443: read: connection reset by peer
│
│ with data.aws_kms_alias.lambda,
│ on main.tf line 15, in data "aws_kms_alias" "lambda":
│ 15: data "aws_kms_alias" "lambda" {
│
╵Relevant Error/Panic Output Snippet
Terraform Configuration Files
provider "aws" {
region = "us-east-1"
max_retries = 0 # didn't seem to have done any good though
}
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.90.0"
}
}
}
data "aws_kms_alias" "lambda" {
name = "alias/aws/lambda"
}
output "kms_alias" {
value = data.aws_kms_alias.lambda
}Steps to Reproduce
TF plan with a configuration which includes data "aws_kms_alias" "foo"" {...} is all that is needed.
Debug Output
No response
Panic Output
No response
Important Factoids
The "encountered an error generating this plan" is likely because I deleted the credentials for the profile out of my ~/.aws/credentials file to avoid waiting any longer.
This data source works quickly and consistently on v5.89.0 and fails consistently on v5.90.0, with changing nothing else in the configuration or runtime environment.
Side note/separate issue/observation: the max_retries setting in the provider configuration seems to not have been honored by this data source lookup, at least according to the error message. 🤷
References
No response
Would you like to implement a fix?
None
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.prioritizedPart of the maintainer teams immediate focus. To be addressed within the current quarter.Part of the maintainer teams immediate focus. To be addressed within the current quarter.providerPertains to the provider itself, rather than any interaction with AWS.Pertains to the provider itself, rather than any interaction with AWS.regressionPertains to a degraded workflow resulting from an upstream patch or internal enhancement.Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.