_This issue was originally opened by @Techbrunch as hashicorp/terraform#14934. It was migrated here as part of the provider split. The original body of the issue is below._
0.9.6
resource "aws_elastic_beanstalk_environment" "environment" {
name = "test-${var.environment}"
application = "${var.application_name}"
version_label = "${aws_elastic_beanstalk_application_version.version.name}"
solution_stack_name = "${var.solution_stack_name}"
setting {
namespace = "aws:elasticbeanstalk:environment"
name = "LoadBalancerType"
value = "application"
}
}
Error applying plan:
1 error(s) occurred:
* module.elastic_beanstalk.aws_elastic_beanstalk_environment.environment: 1 error(s) occurred:
* aws_elastic_beanstalk_environment.environment: ConfigurationValidationException: Configuration validation exception: LoadBalancer type option cannot be changed.
status code: 400, request id: c18d1c94-4545-11e7-abe9-d1b0620a6517
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
It should have forced to a new resource.
Cf debug output.
classic loadbalancerapplication oneI had pretty much the same exact scenario. I had to do a tf taint and blow away the EBS environment to have it create with an app ELB.
This has me wondering, since EBS is backed by CloudFormation, and via the EBS console, you can only create a classic ELB. I wonder if you go through the classic to application ELB migration in the AWS console, if it updates any CloudFormation template accordingly. I'll bet it doesn't.
However, this would be nice to have working. I have 2 other apps I need to migrate at some point.
Same story here, need to migrate from Classic to Network load balancers in our environment but terraform doesn't seem to be able to accomplish this :(
Funny enough, I just struck this problem with cloudformation over elastic beanstalk. this may well be an AWS problem, and not terraform.
AWS Docs say the following:
You can choose the type of load balancer that your environment uses only during environment creation. You can change settings to manage the behavior of your running environment's load balancer, but you can't change its type.
It looks like you have to re-create the beanstalk environment if you want a different load balancer type, which could be why Terraform doesn't work in this case.
I verified this with the AWS Support:
"The functionality is not yet supported on elastic beanstalk you can only specify type while creating an environment. The option is to clone your your environment to a new environment and while creating the environment, specify the load balancer type"
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
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.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
I had pretty much the same exact scenario. I had to do a
tf taintand blow away the EBS environment to have it create with an app ELB.This has me wondering, since EBS is backed by CloudFormation, and via the EBS console, you can only create a classic ELB. I wonder if you go through the classic to application ELB migration in the AWS console, if it updates any CloudFormation template accordingly. I'll bet it doesn't.
However, this would be nice to have working. I have 2 other apps I need to migrate at some point.