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

fix: log config #93

Closed ArchiFleKs closed 4 years ago

ArchiFleKs commented 4 years ago

Fix this error:

Error: Invalid function argument                                                                                                                                                                                                         

  on main.tf line 32, in locals:                                                                                                                                                                                                         
  32:   log_configuration_secret_options = var.log_configuration != null ? lookup(var.log_configuration, "secretOptions", null) : null                                                                                                   
    |----------------                                                                                                                                                                                                                        | var.log_configuration is "{\"logDriver\":\"json-file\",\"options\":{\"max-file\":\"3\",\"max-size\":\"10m\"},\"secretOptions\":null}"                                                                                                                                                                                                                                                                                                                                       
Invalid value for "inputMap" parameter: lookup() requires a map as the first                                                                                                                                                             argument.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
Releasing state lock. This may take a few moments...                                                                                                                                                                                     
[terragrunt] 2020/08/04 10:29:47 Hit multiple errors:          
nitrocode commented 4 years ago

/rebuild-readme

nitrocode commented 4 years ago

/test all

nitrocode commented 4 years ago

@archifleks can you share your input for that variable?

ArchiFleKs commented 4 years ago

@nitrocode:

log_configuration = {
    logDriver = "awslogs"
    options = {
      "awslogs-create-group"  = true
      "awslogs-region"        = "eu-central-1"
      "awslogs-group"         = "mysqldump"
      "awslogs-stream-prefix" = "cfd-dev"
    }
    secretOptions = null
nitrocode commented 4 years ago

Thank you.

Have you tested this change locally to make sure this works too?