This message was deleted.
# general
s
This message was deleted.
🙏 1
g
It might be helpful to run
TF_LOG=DEBUG pulumi up --debug
to see what the actual API request to AWS looks like.
h
Thanks, I let you know the output. Was trying to find a debug feature like that in the pulumi commands options.
@gentle-diamond-70147 where should I expect to see the debug logs?
g
Should print directly to the console.
h
forgot to add
--debug
. I'll send you the print shortly
Here is one of the logs
Copy code
pulumi:pulumi:Stack booksloth-import-dev running debug: RegisterResource RPC prepared: t=aws:batch/jobDefinition:JobDefinition, name=booksloth-import-dev-importLauncher-job-definition
    pulumi:pulumi:Stack booksloth-import-dev running debug: RegisterResource RPC finished: resource:booksloth-import-dev-importLauncher-job-definition[aws:batch/jobDefinition:JobDefinition]; err: null, resp: urn:pulumi:dev::booksloth-import::aws:batch/jobDefinition:JobDefinition::booksloth-import-dev-importLauncher-job-definition,,__defaults,,,,,,,containerProperties,,,{"image":"import/launcher","command":["node","index.js"],"memory":2000,"jobRoleArn":"arn:aws:iam::062155736059:role/booksloth-import-dev-importLauncher-job-role","environment":[{"name":"NODE_ENV","value":"dev"},{"name":"APP_VARS","value":"{\"resourcePrefix\":\"booksloth-import-dev\",\"retry\":{\"retires\":3,\"minTimeout\":200,\"maxTimeout\":1000}}"},{"name":"BOOKSLOTH_API_VARS","value":"Calling [toJSON] on an [Output<T>] is not supported.\n\nTo get the value of an Output as a JSON value or JSON string consider either:\n    1: o.apply(v => v.toJSON())\n    2: o.apply(v => JSON.stringify(v))\n\nSee <https://pulumi.io/help/outputs> for more details.\nThis function may throw in a future version of @pulumi/pulumi."}]},name,,,booksloth-import-dev-importLauncher-job-definition,parameters,,,,,BATCH_MESSAGE,,,Empty,__defaults,,,,,,,retryStrategy,,,,,__defaults,,,,,,,attempts,,3,tags,,,,,Environment,,,development,__defaults,,,,,,,timeout,,,,,__defaults,,,,,,,attemptDurationSeconds,,3600,type,,,container,,
Just saw that a variable wasn't been properly converted to string. Made the fix, and still same results
👀 1
g
What is
bookslothApiVars
in your code? It looks like that needs to be
.apply
as well. You can apply multiple values with
.all
- e.g. https://www.pulumi.com/docs/intro/concepts/programming-model/#all.
h
Found the problem. I first fixed the apply with pulumi all. it fixed the
bookslothApiVars
value. Stlil had the same problem. The issue was the container image. I was using this to build the image:
const img = awsx.ecs.Image.fromPath('import/launcher', "../");
and it wants and image from a ecr repository. So building the image like this:
Copy code
const img = awsx.ecr.buildAndPushImage(`${config.prefix}-${serviceName}-img`, '../', {
  tags: {
    Environment: config.env,
  },
})
and passing img.imageValue to containerProperties fix it.
It wasn't obvious to me to determine this because there is no interface for the
containerProperties
It would be helpful to add it, since I had to go to API_RegisterJobDefinition to check the format.
👍 2
g
Glad you figured it out!
g
Awesome!