proud-art-41399
07/18/2023, 2:27 PMjob_definition = aws.batch.JobDefinition(
"xxx",
type="container",
platform_capabilities=["FARGATE"],
container_properties=pulumi.Output.all(
image=image.image_name,
execution_role=job_execution_role.arn,
job_role=job_role.arn,
log_group=job_log_group.name,
...
).apply(
lambda args: json.dumps(
{
"command": ["xxx"],
"image": args["image"],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": args["log_group"],
"awslogs-multiline-pattern": (
"^(NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL)"
),
},
},
"fargatePlatformConfiguration": {"platformVersion": "LATEST"},
"runtimePlatform": {
"cpuArchitecture": "ARM64",
"operatingSystemFamily": "LINUX",
},
"resourceRequirements": [
{"type": "VCPU", "value": "4"},
{"type": "MEMORY", "value": "30720"},
],
"environment": [
{"name": "xxx", "value": "xxx"},
...
],
"secrets": [
{
"name": "xxx",
"valueFrom": args["xxx"],
},
...
],
"executionRoleArn": args["execution_role"],
"jobRoleArn": args["job_role"],
}
)
),
retry_strategy=aws.batch.JobDefinitionRetryStrategyArgs(
attempts=5,
evaluate_on_exits=[
aws.batch.JobDefinitionRetryStrategyEvaluateOnExitArgs(
on_status_reason="ResourceInitializationError:*",
action="RETRY",
),
aws.batch.JobDefinitionRetryStrategyEvaluateOnExitArgs(
on_status_reason="Rate limit exceeded*", action="RETRY"
),
aws.batch.JobDefinitionRetryStrategyEvaluateOnExitArgs(
on_status_reason="Timeout waiting for network interface*",
action="RETRY",
),
aws.batch.JobDefinitionRetryStrategyEvaluateOnExitArgs(
on_reason="*", action="EXIT"
),
],
),
timeout=aws.batch.JobDefinitionTimeoutArgs(
attempt_duration_seconds=172800
),
tags={"user:Version": "..."},
propagate_tags=True,
)
However, when the job definition is created, the runtimePlatform
is missing in the job definition configuration seen in the AWS console, and the job fails with exec format error
due to mismatch between the Docker image architecture and runtime platform. I thought, given that container_properties
is passed as a plain JSON, that this would work right away after the support is added by AWS. Also, as mentioned in the issue, it works with Terraform already. Or do I have to wait for the new pulumi-aws
/ pulumi-terraform-bridge
package?melodic-tomato-39005
08/01/2023, 12:01 PMproud-art-41399
08/02/2023, 6:42 AM