-
Notifications
You must be signed in to change notification settings - Fork 523
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
Feat:(AWS) Adds Lambda provisioned concurrency #2281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @robh007 thanks this looks excellent. I had a look through the pricing and agree with this approach and not using the references.
In the AWS calculator I'm also seeing $2 'Requests' charge for the example you have in the tests, so it looks like we need another cost component for that.
internal/providers/terraform/aws/lambda_provisioned_concurrency_config.go
Outdated
Show resolved
Hide resolved
Hi @aliscott, Yes that cost component is requests, the requests are needed to generate the Duration cost component. I can add that in no problem. I probably need to document something somewhere, because if you had something like this in your code. resource "aws_lambda_provisioned_concurrency_config" "without_usage" {
function_name = aws_lambda_function.name
provisioned_concurrent_executions = 100
qualifier = 1
}
resource "aws_lambda_function" "lambda" {
function_name = "lambda_function_name"
role = "arn:aws:lambda:us-east-1:account-id:resource-id"
handler = "exports.test"
filename = "function.zip"
runtime = "nodejs12.x"
}
With these usage parameters aws_lambda_function.my_function:
monthly_requests: 10000000 # Monthly requests to the Lambda function.
request_duration_ms: 350 # Average duration of each request in milliseconds.
aws_lambda_provisioned_concurrency_config.my_config:
monthly_duration_hrs: 730 # Number of hours in a month that provisioned concurrency will be enabled.
request_duration_ms: 350 # Average duration of each request in milliseconds during the enabled period.
monthly_requests: 10000000 # Number of requests sent to the function during the enabled period.
architecture: arm64 # Architecture of the Lambda function.
memory_mb: 512 # Memory size of the Lambda function. The estimates for requests are duplicated, I think that's why I wanted to use something with the reference. It probably just needs to highlight the differences somewhere for now. I could use the usage parameters supplied & do some calculation between the lambda_function request & the provisioned concurrency request? Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay @robh007. This looks great, thanks!
Adds new resource
aws_lambda_provisioned_concurrency_config
to support provisioned concurrency in lambda. I think there's potentially more that can be done to merge withaws_lambda_function
. I did try to use the references logic within the code but couldn't get it to work. This resource provides 2 cost components, duration & concurrency.Closes more of #2138