Open mou opened 4 years ago
Hey @mou 👋 Thank you for taking the time to file this issue! Given that there's been a number of AWS provider releases since you initially filed it, can you confirm whether you're still experiencing this behavior?
provider "aws" {
region = "us-east-1" # Replace with your desired region
version = "~> 1.60" # Ensure you're using the correct version constraint
}
resource "aws_ecs_task_definition" "example" {
family = "my-task-family"
network_mode = "bridge"
container_definitions = jsonencode([
{
name = "my-container"
image = "my-docker-image"
cpu = 256
memory = 512
essential = true
portMappings = [
{
containerPort = 80
hostPort = 80
protocol = "tcp"
}
]
}
])
tags = {
Name = "My ECS Task Definition"
}
}
# Optional: Use lifecycle to prevent recreation due to minor changes
resource "aws_ecs_task_definition" "example" {
# Your task definition settings...
lifecycle {
ignore_changes = [
container_definitions, # Ignore changes to this attribute
tags # Ignore changes to tags, if necessary
]
}
}
output "task_definition_arn" {
value = aws_ecs_task_definition.example.arn
}
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Minimum reproducible configuration
Debug Output
Contains two log files with TRACE level: one for plan, and one for apply https://gist.github.com/mou/9e56eb603173a6428b42933e4ab49058
Panic Output
Expected Behavior
Security group should be created
Actual Behavior
Error was reported
Steps to Reproduce
terraform plan
terraform apply
Important Factoids
References