I lost my mind for a few hours between yesterday a...
# aws
d
I lost my mind for a few hours between yesterday and today figuring out all the necessary fields in the json inside a new aws.batch.JobDefinition
Copy code
containerProperties: pulumi.interpolate`{
        "command": ["yarn", "start"],
        "jobRoleArn": "${ecsTaskExecutionRole.arn}",
        "environment": [
          {"name": "POSTGRES_ARN", "value": "${cluster.arn}"},
          {"name": "REGION", "value": "${region}"},
          {"name": "SECRET_ARN", "value": "${secret.arn}"}
        ],        
        "image": "${image}", 
        "fargatePlatformConfiguration": {
          "platformVersion": "LATEST"
        },
        "networkConfiguration": {
          "assignPublicIp": "ENABLED"
        },
        "resourceRequirements": [
          {"type": "VCPU", "value": "0.25"},
          {"type": "MEMORY", "value": "512"}
        ],
        "executionRoleArn": "${ecsTaskExecutionRole.arn}"
      }`,
Perhaps I should have read the aws batch manual but types here would really be helpful ... 🤔 instead of a slab of text...
g
Check the AWS CDK docs they have better types for these objects and docs are less wordy than AWS API docs. I often end up reading API docs for a specific call https://docs.aws.amazon.com/batch/latest/APIReference/API_RegisterJobDefinition.html
👍 1