Allow to set logConfiguration
section in Batch job definition.
resource "aws_batch_job_definition" "job_definition" {
name = "${var.job_definition_name}"
type = "container"
container_properties = "${data.template_file.job_definition.rendered}"
timeout = {
attempt_duration_seconds = "${var.attempt_duration_seconds}"
}
retry_strategy = {
attempts = 2
}
log_configuration": {
log_driver: "awslogs"
"options": {
"awslogs-region": "${var.region}",
"awslogs-group": "${var.group_name}",
},
}
}
https://aws.amazon.com/blogs/compute/custom-logging-with-aws-batch/
To match the API I guess this could go within container_properties eg:
resource "aws_batch_job_definition" "test" {
name = "tf_test_batch_job_definition"
type = "container"
container_properties = <<CONTAINER_PROPERTIES
{
"command": ["ls", "-la"],
"image": "busybox",
"memory": 1024,
"vcpus": 1,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "example"
}
}
}
CONTAINER_PROPERTIES
}
Weirdly when testing locally putting logConfiguration within the container_properties works when I compile the provider with the latest code, but ignores logConfiguration when I use version 3.8.0/3.9.0. Guessing some change that hasn't been released yet fixes this? Couldn't figure out which one though
@philnichol it works with the newest v3.10.0 release :) I just tested it with logConfiguration inside container_properties like in your example.
Hi folks 👋 For clarity here, this is one of the places in the Terraform AWS Provider where it will automatically start working with AWS Go SDK updates we perform each week. If something is not working on version 3.10.0 or later of the Terraform AWS Provider, please reach out. 👍
Thanks @bflad, Is there any way to use it with version 2.7 and TF 0.11?
@shlomi-viz not in an officially supported release, please see the backport policy in our FAQ. You can potentially pull the code from the release/2.x
branch, update the AWS Go SDK (go get github.com/aws/[email protected]
), custom build the provider (go build
), and point Terraform to the custom version of the provider (the Terraform 0.11 documentation is no longer available on terraform.io, but it amounts to overwriting the existing provider binary or using the plugin cache directory), however the maintainers cannot provide additional assistance if you go that route.
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
@philnichol it works with the newest v3.10.0 release :) I just tested it with logConfiguration inside container_properties like in your example.