-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Bug]: Error: The terraform-provider-aws_v4.67.0_x5 plugin crashed! #31443
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
can reproduce on
|
I wasn't able to reproduce the crash, but I did observe some issues running an apply. Probably best described using the plan output. First, the minimal reproducer I tried: terraform {
required_version = ">= 1.4.6"
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.67.0"
}
}
}
resource "aws_ecs_cluster" "test" {
name = "test"
}
resource "aws_ecs_task_definition" "test" {
family = "test"
container_definitions = <<DEFINITION
[
{
"cpu": 128,
"essential": true,
"image": "mongo:latest",
"memory": 128,
"name": "mongodb"
}
]
DEFINITION
}
variable "alarm_names" {
type = list(string)
default = []
}
resource "aws_ecs_service" "test" {
name = "test"
cluster = aws_ecs_cluster.test.id
task_definition = aws_ecs_task_definition.test.arn
desired_count = 1
dynamic "alarms" {
for_each = var.alarm_names == null ? [] : [true]
content {
enable = true
rollback = true
alarm_names = var.alarm_names
}
}
} This produces the following plan: $ terraform plan
...
# aws_ecs_service.test will be created
+ resource "aws_ecs_service" "test" {
+ cluster = (known after apply)
+ deployment_maximum_percent = 200
+ deployment_minimum_healthy_percent = 100
+ desired_count = 1
+ enable_ecs_managed_tags = false
+ enable_execute_command = false
+ iam_role = (known after apply)
+ id = (known after apply)
+ launch_type = (known after apply)
+ name = "test"
+ platform_version = (known after apply)
+ scheduling_strategy = "REPLICA"
+ tags_all = (known after apply)
+ task_definition = (known after apply)
+ triggers = (known after apply)
+ wait_for_steady_state = false
+ alarms {
+ enable = true
+ rollback = true
}
} Note the weird looking $ terraform apply
...
aws_ecs_service.test: Creating...
╷
│ Error: creating ECS Service (test): InvalidParameter: 1 validation error(s) found.
│ - missing required field, CreateServiceInput.DeploymentConfiguration.Alarms.AlarmNames.
│
│
│ with aws_ecs_service.test,
│ on main.tf line 36, in resource "aws_ecs_service" "test":
│ 36: resource "aws_ecs_service" "test" { If we change the resource "aws_ecs_service" "test" {
name = "test"
cluster = aws_ecs_cluster.test.id
task_definition = aws_ecs_task_definition.test.arn
desired_count = 1
dynamic "alarms" {
for_each = var.alarm_names == null || length(var.alarm_names) == 0 ? [] : [true]
content {
enable = true
rollback = true
alarm_names = var.alarm_names
}
}
} $ terraform plan
...
# aws_ecs_service.test will be created
+ resource "aws_ecs_service" "test" {
+ cluster = (known after apply)
+ deployment_maximum_percent = 200
+ deployment_minimum_healthy_percent = 100
+ desired_count = 1
+ enable_ecs_managed_tags = false
+ enable_execute_command = false
+ iam_role = (known after apply)
+ id = (known after apply)
+ launch_type = (known after apply)
+ name = "test"
+ platform_version = (known after apply)
+ scheduling_strategy = "REPLICA"
+ tags_all = (known after apply)
+ task_definition = (known after apply)
+ triggers = (known after apply)
+ wait_for_steady_state = false
} And the resulting apply works just fine. If you're able to adjust the minimal reproducer above so that it crashes for you, that'd be useful please. Alternatively, applying that fix for the |
This happens to me as well. Even in versions |
terraform-provider-aws/internal/service/ecs/service.go Lines 855 to 859 in c67e7e0
My guess is that we'll need to add: if input.DeploymentConfiguration == nil {
input.DeploymentConfiguration = &ecs.DeploymentConfiguration{}
} |
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. |
Terraform Core Version
Terraform v1.4.2
AWS Provider Version
aws_v4.67.0_x5
Affected Resource(s)
aws_ecs_service
Expected Behavior
it should be add this block:
Actual Behavior
Error: The terraform-provider-aws_v4.67.0_x5 plugin crashed!
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
do a
terraform apply
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No
The text was updated successfully, but these errors were encountered: