Skip to content
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

Add ability to set propagate tags in AWS Batch job definitions #17278

Closed
jacobus-herman opened this issue Jan 25, 2021 · 2 comments · Fixed by #18336
Closed

Add ability to set propagate tags in AWS Batch job definitions #17278

jacobus-herman opened this issue Jan 25, 2021 · 2 comments · Fixed by #18336
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/batch Issues and PRs that pertain to the batch service.
Milestone

Comments

@jacobus-herman
Copy link

jacobus-herman commented Jan 25, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently, there is no way to set the propagate tags setting of an AWS Batch Job Definition as documented in the job definition parameters and job definition template.

Using the Terraform Configuration below shows that, by default, the propagate tags setting is disabled (i.e. set to false).

New or Affected Resource(s)

  • aws_batch_job_definition

Potential Terraform Configuration

locals {
  tags = {
    "tag1" = "value1",
    "tag2" = "value2"
  }
}

provider "aws" {
  region = "eu-central-1"
}

data "aws_iam_policy_document" "ecs_tasks_assume" {
  statement {
    effect = "Allow"
    actions = [
    "sts:AssumeRole"]

    principals {
      type = "Service"
      identifiers = [
      "ecs-tasks.amazonaws.com"]
    }
  }
}

resource "aws_batch_job_definition" "log_processor" {
  name = "test-job-definition"
  type = "container"

  timeout {
    attempt_duration_seconds = 600
  }

  container_properties = <<-CONTAINER_PROPERTIES
  {
      "command": ["echo 'success'"],
      "image": "public.ecr.aws/ubuntu/ubuntu:18.04_stable",
      "memory": 512,
      "vcpus": 1,
      "environment": [],
      "executionRoleArn": "${aws_iam_role.ecs_task_execution.arn}",
      "jobRoleArn": "${aws_iam_role.ecs_task.arn}"
  }
  CONTAINER_PROPERTIES

  tags = local.tags
}

resource "aws_iam_role" "ecs_task_execution" {
  name               = "ecs-task-exec"
  assume_role_policy = data.aws_iam_policy_document.ecs_tasks_assume.json
}

resource "aws_iam_role" "ecs_task" {
  name               = "ecs-task"
  assume_role_policy = data.aws_iam_policy_document.ecs_tasks_assume.json
}

References

@jacobus-herman jacobus-herman added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 25, 2021
@ghost ghost added service/batch Issues and PRs that pertain to the batch service. service/iam Issues and PRs that pertain to the iam service. labels Jan 25, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 25, 2021
@ewbankkit ewbankkit removed needs-triage Waiting for first response or review from a maintainer. service/iam Issues and PRs that pertain to the iam service. labels Apr 19, 2021
ewbankkit pushed a commit to leonsmith/terraform-provider-aws that referenced this issue Apr 19, 2021
@github-actions github-actions bot added this to the v3.38.0 milestone Apr 19, 2021
@ghost
Copy link

ghost commented Apr 30, 2021

This has been released in version 3.38.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 19, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators May 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/batch Issues and PRs that pertain to the batch service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants