Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Code Engine job module

You can use this submodule to provision IBM Code Engine Job.

Usage

provider "ibm" {
  ibmcloud_api_key = "XXXXXXXXXX" # pragma: allowlist secret
  region           = "us-south"
}

module "job" {
  source        = "terraform-ibm-modules/code-engine/ibm//modules/job"
  version       = "latest" # Replace "latest" with a release version to lock into a specific release
  project_id    = "project_id"
  name          = "job_name"
  image_reference = "icr.io/codeengine/helloworld"
  run_env_variables = [{
        type  = "literal"
        name  = "env_name"
        value = "env_value"
    }]
}

Required IAM access policies

You need the following permissions to run this module.

  • IAM Services
    • Code Engine service
      • Editor platform access
      • Writer service access

Requirements

Name Version
terraform >= 1.3.0
ibm >= 1.63.0, <2.0.0

Modules

No modules.

Resources

Name Type
ibm_code_engine_job.ce_job resource

Inputs

Name Description Type Default Required
image_reference The name of the image that is used for this job. string n/a yes
image_secret The name of the image registry access secret. string null no
name The name of the job. string n/a yes
project_id The ID of the project where job will be created. string n/a yes
run_arguments Arguments for the app that are passed to start the container. list(string) [] no
run_as_user The user ID (UID) to run the app. number null no
run_commands Commands for the app that are passed to start the container. list(string) [] no
run_env_variables References to config maps, secrets or a literal values that are exposed as environment variables within the running application.
list(object({
type = optional(string)
name = optional(string)
value = optional(string)
prefix = optional(string)
key = optional(string)
reference = optional(string)
}))
[] no
run_mode Commands for the app that are passed to start the container. string "task" no
run_service_account The name of the service account. string "default" no
run_volume_mounts Optional mounts of config maps or a secrets.
list(object({
mount_path = string
reference = string
name = optional(string)
type = string
}))
[] no
scale_array_spec Define a custom set of array indices as comma-separated list containing single values and hyphen-separated ranges like 5,12-14,23,27. string null no
scale_cpu_limit The number of CPU set for the instance of the app. string "1" no
scale_ephemeral_storage_limit The amount of ephemeral storage to set for the instance of the app. string "400M" no
scale_max_execution_time The maximum execution time in seconds for runs of the job. number 7200 no
scale_memory_limit The amount of memory set for the instance of the app. string "4G" no
scale_retry_limit The number of times to rerun an instance of the job before the job is marked as failed. number 3 no

Outputs

Name Description
id The unique identifier of the created code engine job.
job_id The ID of the created code engine job.
name The name of the created code engine job.