cloudposse / terraform-aws-ecs-container-definition

Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource
https://cloudposse.com/accelerate
Apache License 2.0
340 stars 245 forks source link

An argument named "log_options" is not expected here. #51

Closed noatec closed 4 years ago

noatec commented 5 years ago

Error: Unsupported argument on ../shared/ecs_docker/main.tf line 148, in module "container_definition": 148: log_options = { An argument named "log_options" is not expected here.

This error occurs in this module: module "container_definition" { source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=master" container_name = module.label.id container_image = "${data.aws_caller_identity.account.account_id}.dkr.ecr.${var.aws_region}.amazonaws.com/${aws_ecr_repository.repo.name}:release"

port_mappings = [ { containerPort = var.container_port hostPort = 80 protocol = "tcp" }, ]

secrets = "${var.secrets}"

log_options = { "awslogs-region" = var.aws_region "awslogs-group" = aws_cloudwatch_log_group.logs.name "awslogs-stream-prefix" = "ecs" } }

aknysh commented 5 years ago

@noatec the new version of the module (in TF 0.12) supports this variable (which includes options (instead of log_options) https://github.com/cloudposse/terraform-aws-ecs-container-definition/blob/master/variables.tf#L109

In general, to prevent breaking changes, in your code you should not pin to master (which could be changed anytime). Instead pin to a release (which will never change). For example, https://github.com/cloudposse/terraform-aws-ecs-alb-service-task/blob/master/examples/complete/main.tf#L48

noatec commented 5 years ago

Thanks for the speedy reply. Investigating now.

aknysh commented 4 years ago

@noatec if it's working for you, you can close the issue

aknysh commented 4 years ago

closing for now