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

fix(terraform): add jobRoleArn to Batch containers #181

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

JoshuaLicense
Copy link
Contributor

@JoshuaLicense JoshuaLicense commented Jul 18, 2024

Description

Adds a jobRoleArn for the application when calling AWS via—the SDK.
Update the CloudWatch log name to include environment.

@JoshuaLicense JoshuaLicense self-assigned this Jul 18, 2024
Copy link
Contributor

github-actions bot commented Jul 18, 2024

Terraform plan for environment: int

Commit: 8e9dc29

API version: c5ba4e9
Selfserve version: c5ba4e9
Internal version: c5ba4e9

Plan summary

0 to add, 0 to change, 0 to destroy


Show full plan
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

Copy link
Contributor

github-actions bot commented Jul 18, 2024

Terraform plan for environment: dev

Commit: 8e9dc29

API version: c5ba4e9
Selfserve version: c5ba4e9
Internal version: c5ba4e9

Plan summary

0 to add, 2 to change, 1 to destroy

🗑️ Deletes

module.service.aws_cloudwatch_log_group.this

🔄 Updates

module.service.module.batch.aws_batch_job_definition.this["process-queue"]
module.service.module.batch.aws_batch_job_queue.this["default"]

Show full plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # module.service.aws_cloudwatch_log_group.this must be replaced
-/+ resource "aws_cloudwatch_log_group" "this" {
      ~ arn               = "arn:aws:logs:eu-west-1:054614622558:log-group:/aws/batch" -> (known after apply)
      ~ id                = "/aws/batch" -> (known after apply)
      ~ log_group_class   = "STANDARD" -> (known after apply)
      ~ name              = "/aws/batch" -> "/aws/batch/vol-app-dev" # forces replacement
      + name_prefix       = (known after apply)
      - tags              = {} -> null
        # (4 unchanged attributes hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
      ~ arn                        = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue:2" -> (known after apply)
      ~ container_properties       = jsonencode(
            {
              - command                      = [
                  - "/var/www/html/vendor/bin/laminas",
                  - "--container=/var/www/html/config/container-cli.php",
                  - "queue:process-queue",
                ]
              - environment                  = [
                  - {
                      - name  = "ENVIRONMENT_NAME"
                      - value = "dev"
                    },
                  - {
                      - name  = "APP_VERSION"
                      - value = "da12d1b"
                    },
                ]
              - executionRoleArn             = "arn:aws:iam::054614622558:role/vol-app-dev-api-service-20240418150301367500000003"
              - fargatePlatformConfiguration = {
                  - platformVersion = "LATEST"
                }
              - image                        = "054614622558.dkr.ecr.eu-west-1.amazonaws.com/vol-app/cli:da12d1b"
              - logConfiguration             = {
                  - logDriver     = "awslogs"
                  - options       = {
                      - awslogs-group         = "/aws/batch"
                      - awslogs-region        = "eu-west-1"
                      - awslogs-stream-prefix = "process-queue"
                    }
                  - secretOptions = []
                }
              - mountPoints                  = []
              - resourceRequirements         = [
                  - {
                      - type  = "VCPU"
                      - value = "1"
                    },
                  - {
                      - type  = "MEMORY"
                      - value = "2048"
                    },
                ]
              - runtimePlatform              = {
                  - cpuArchitecture       = "ARM64"
                  - operatingSystemFamily = "LINUX"
                }
              - secrets                      = []
              - ulimits                      = []
              - volumes                      = []
            }
        ) -> (known after apply)
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue:2"
        name                       = "vol-app-dev-process-queue"
      ~ revision                   = 2 -> (known after apply)
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (8 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_queue.this["default"] will be updated in-place
  ~ resource "aws_batch_job_queue" "this" {
        id                    = "arn:aws:batch:eu-west-1:054614622558:job-queue/vol-app-dev-default"
        name                  = "vol-app-dev-default"
      + tags                  = {}
        # (6 unchanged attributes hidden)
    }

Plan: 1 to add, 2 to change, 1 to destroy.

@JoshuaLicense JoshuaLicense merged commit f4ec653 into main Jul 18, 2024
17 checks passed
@JoshuaLicense JoshuaLicense deleted the add-job-role-arn-to-batch-containers branch July 18, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants