Open vainkop opened 2 months ago
Voting for Prioritization
Volunteering to Work on This Issue
any updates? seeing up to 60 minutes of deployment & failing only in the end really is annoying, takes too much time & dissapoints. other resources are implemented better if they limits they report of them immediately & here there's a limit which can even aws cli can poll from the api so it should be there.
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [43m50s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [43m50s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [44m0s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [44m0s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [44m10s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [44m10s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [44m20s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [44m20s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [44m30s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [44m30s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [44m40s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [44m40s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [44m50s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [44m50s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [45m0s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [45m0s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [45m10s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [45m10s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [45m20s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [45m20s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [45m30s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [45m30s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [45m40s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [45m40s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [45m50s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [45m50s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [46m0s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [46m0s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [46m10s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [46m10s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [46m20s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [46m20s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [46m30s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [46m30s elapsed]
module.kinesis_abc_def.aws_kinesis_stream.stream: Still creating... [46m40s elapsed]
module.kinesis_ghi_log.aws_kinesis_stream.stream: Still creating... [46m40s elapsed]
...
In the meantime here's a workaround for those who might need it:
resource "null_resource" "check_aws_limits" {
provisioner "local-exec" {
command = "python3 ${path.module}/check_aws_limits.py"
}
}
resource "aws_kinesis_stream" "stream" {
...
depends_on = [null_resource.check_aws_limits]
}
# check_aws_limits.py
import boto3
import json
import sys
def check_kinesis_limits():
client = boto3.client('kinesis')
# Fetch Kinesis limits
limits = client.describe_limits()
# Extract limit values
on_demand_stream_count = limits['OnDemandStreamCount']
on_demand_stream_count_limit = limits['OnDemandStreamCountLimit']
# Print the extracted values
print(f"OnDemandStreamCount={on_demand_stream_count}")
print(f"OnDemandStreamCountLimit={on_demand_stream_count_limit}")
# Check limits and exit with appropriate code
if on_demand_stream_count >= on_demand_stream_count_limit:
error_message = (
"OnDemandStreamCountLimit is less or equal to OnDemandStreamCount!\n"
"#######################################################\n"
"#######################################################\n"
"### AWS LIMITS ARE REACHED !!! ###\n"
"### REQUEST MORE STREAMS FROM AWS SUPPORT ###\n"
"#######################################################\n"
"#######################################################\n"
)
print(error_message)
sys.exit(1)
print("Kinesis limits are within acceptable range.")
sys.exit(0)
if __name__ == "__main__":
check_kinesis_limits()
Output:
ā Error: local-exec provisioner error
ā
ā with module.kinesis_abc.null_resource.check_aws_limits,
ā on .terraform/modules/kinesis/main.tf line 17, in resource "null_resource" "check_aws_limits":
ā 17: provisioner "local-exec" {
ā
ā Error running command 'python3
ā .terraform/modules/kinesis/check_aws_limits.py':
ā exit status 1. Output: OnDemandStreamCount=50
ā OnDemandStreamCountLimit=50
ā OnDemandStreamCountLimit is less or equal to OnDemandStreamCount!
ā #######################################################
ā #######################################################
ā ### AWS LIMITS ARE REACHED !!! ###
ā ### REQUEST MORE STREAMS FROM AWS SUPPORT ###
ā #######################################################
ā #######################################################
ā
ā
āµ
ā·
ā Error: local-exec provisioner error
ā
ā with module.kinesis_def.null_resource.check_aws_limits,
ā on .terraform/modules/kinesis_def/kinesis/main.tf line 17, in resource "null_resource" "check_aws_limits":
ā 17: provisioner "local-exec" {
ā
ā Error running command 'python3
ā .terraform/modules/kinesis_def/kinesis/check_aws_limits.py':
ā exit status 1. Output: OnDemandStreamCount=50
ā OnDemandStreamCountLimit=50
ā OnDemandStreamCountLimit is less or equal to OnDemandStreamCount!
ā #######################################################
ā #######################################################
ā ### AWS LIMITS ARE REACHED !!! ###
ā ### REQUEST MORE STREAMS FROM AWS SUPPORT ###
ā #######################################################
ā #######################################################
Terraform Core Version
1.8.5
AWS Provider Version
5.55.0
Affected Resource(s)
aws_kinesis_stream
Expected Behavior
An error should be printed & Terraform should exit with exit code 1.
Th AWS console error looks like so:
Actual Behavior
Terraform seems to keep trying to create the resources (1 hour by default) while the AWS console immediately errors out with the following error:
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Try to create more kinesis streams than available per account service limits.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No