in syndicate/core/transform/terraform/converter/tf_batch_jobdef_converter.py [0:0]
def batch_job_def(job_def_name, job_def_type, container_properties,
parameters, tags, timeout, retry_strategy):
params = {
'name': job_def_name,
'type': job_def_type
}
if parameters:
params['parameters'] = parameters
if tags:
params['tags'] = tags
if timeout:
params['timeout'] = timeout
if retry_strategy:
params['retry_strategy'] = retry_strategy
if container_properties:
properties = {}
image = container_properties.get('image')
if image:
properties['image'] = image
vcpus = container_properties.get('vcpus')
if vcpus:
properties['vcpus'] = vcpus
memory = container_properties.get('memory')
if memory:
properties['memory'] = memory
command = container_properties.get('command', [])
if command:
properties['command'] = command
job_role_arn = container_properties.get('job_role_arn')
if job_role_arn:
role_arn_ref = build_role_arn_ref(role_name=job_role_arn)
properties['executionRoleArn'] = role_arn_ref
if properties:
params['container_properties'] = json.dumps(properties)
resource = {
job_def_name: params
}
return resource