Elastic Beanstalk returns InvalidParameterValue errors when environment parameters are invalid, outdated solution stacks are used, or the environment is in a non-ready state. This commonly occurs with Terraform when resource configurations conflict or provider versions mismatch.
This error indicates that AWS Elastic Beanstalk received a request with invalid or incompatible parameter values. The error can stem from multiple sources: using an outdated or unavailable solution stack (platform) in your AWS account, attempting to modify an environment that is not in a Ready state, referencing non-existent application versions or configuration templates, or conflicting API calls during simultaneous updates. In Terraform specifically, this error often occurs when environment settings and tags are updated together, causing race conditions in the AWS provider.
Check the AWS Elastic Beanstalk console to confirm your environment status:
1. Navigate to Elastic Beanstalk in AWS Console
2. Click on your application, then the environment name
3. Check the Status field - it should show "Ready" in green
4. If status is UPDATING, TERMINATING, or CREATING_FAILED, wait for it to stabilize or terminate and recreate
If the environment is stuck in a failed state, you may need to delete it and create a new one.
If you're using Terraform with AWS provider version 4.63.0 through 5.72.x, upgrade to 5.73.0+ to get the fix for simultaneous settings and tag updates:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.73.0"
}
}
}Then run:
terraform init
terraform plan
terraform applyCheck that the solution stack you specified is available in your AWS region:
data "aws_elastic_beanstalk_solution_stack" "app" {
most_recent = true
name_regex = "^64bit Amazon Linux 2 .* running Node\.js.*$"
}
resource "aws_elastic_beanstalk_environment" "app" {
solution_stack_name = data.aws_elastic_beanstalk_solution_stack.app.name
# ... other config
}Alternatively, query available stacks:
aws elasticbeanstalk describe-platform-branches --region us-east-1 --output tableIf you cannot upgrade the AWS provider immediately, split environment settings and tag changes into separate Terraform applies:
# First apply: settings only
terraform apply -target=aws_elastic_beanstalk_environment.app
# Wait a few minutes for environment to stabilize
# Second apply: tags
terraform apply -target=aws_elastic_beanstalk_environment.app_tagsOr manually separate them in your configuration to ensure they don't apply together.
Ensure any referenced application versions and configuration templates exist:
# List available application versions
aws elasticbeanstalk describe-application-versions \
--application-name my-app \
--region us-east-1
# List available configuration templates
aws elasticbeanstalk describe-configuration-settings \
--application-name my-app \
--region us-east-1Remove references to non-existent versions from your Terraform configuration.
Verify the underlying CloudFormation stack is healthy:
aws cloudformation describe-stacks \
--stack-name awseb-<environment-name> \
--region us-east-1 \
--query 'Stacks[0].StackStatus'If the status is CREATE_FAILED or ROLLBACK_COMPLETE, the Elastic Beanstalk environment cannot recover. You must terminate the environment and create a new one:
aws elasticbeanstalk terminate-environment \
--environment-name my-env \
--region us-east-1Solution stacks in Elastic Beanstalk are retired periodically. AWS rotates available platforms, so a stack that worked yesterday may not be available today if your account hasn't used it recently. Using a data source with name_regex to dynamically select the latest compatible stack is more reliable than hardcoding stack names. For the simultaneous update issue in Terraform 4.63.0+, the root cause is that UpdateEnvironment and UpdateTagsForResource are called concurrently instead of sequentially, causing the environment to be locked. This was fixed in provider version 5.73.0 by ensuring sequential API calls. If you're in an environment that cannot update the provider version, separate your Terraform applies by environment state: first apply infrastructure changes, then wait for environment to stabilize, then apply tag updates.
Error: Error installing helm release: cannot re-use a name that is still in use
How to fix "release name in use" error in Terraform with Helm
Error: Error creating GKE Cluster: BadRequest
BadRequest error creating GKE cluster in Terraform
Error: External program failed to produce valid JSON
External program failed to produce valid JSON
Error: Unsupported argument in child module call
How to fix "Unsupported argument in child module call" in Terraform
Error: network is unreachable
How to fix "network is unreachable" in Terraform