oci_batch_batch_task_environment
This resource provides the Batch Task Environment resource in Oracle Cloud Infrastructure Batch service. Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/
Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/batch
Creates a batch task environment.
Example Usage
resource "oci_batch_batch_task_environment" "test_batch_task_environment" {
#Required
compartment_id = var.compartment_id
image_url = var.batch_task_environment_image_url
#Optional
defined_tags = {"Operations.CostCenter"= "42"}
description = var.batch_task_environment_description
display_name = var.batch_task_environment_display_name
freeform_tags = {"Department"= "Finance"}
security_context {
#Optional
fs_group = var.batch_task_environment_security_context_fs_group
run_as_group = var.batch_task_environment_security_context_run_as_group
run_as_user = var.batch_task_environment_security_context_run_as_user
}
volumes {
#Required
local_mount_directory_path = var.batch_task_environment_volumes_local_mount_directory_path
mount_target_export_path = var.batch_task_environment_volumes_mount_target_export_path
mount_target_fqdn = var.batch_task_environment_volumes_mount_target_fqdn
name = var.batch_task_environment_volumes_name
type = var.batch_task_environment_volumes_type
}
working_directory = var.batch_task_environment_working_directory
}
Argument Reference
The following arguments are supported:
compartment_id- (Required) (Updatable) The OCID of the compartment.defined_tags- (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:{"Operations.CostCenter": "42"}description- (Optional) (Updatable) The batch task environment description.display_name- (Optional) (Updatable) A user-friendly name. Does not have to be unique, and it’s changeable. If not specified or provided as null or empty string, it be generated as “”, where timeCreated corresponds with the resource creation time in ISO 8601 basic format, i.e. omitting separating punctuation, at second-level precision and no UTC offset. Example: batchtaskenvironment20250914115623. freeform_tags- (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}image_url- (Required) The URL of the ocir image.security_context- (Optional) Security context for container runtime configuration.See also docs.
fs_group- (Optional) A special supplemental group ID that applies to all containers in a pod.run_as_group- (Optional) Group ID for running processes inside the container.run_as_user- (Optional) User ID for running processes inside the container.
volumes- (Optional) List of volumes attached to the image. The use cases of the volumes are but not limited to: read the input of the task and write the output.local_mount_directory_path- (Required) The local path to mount the NFS share to.mount_target_export_path- (Required) The path to the directory on the NFS server to be mounted.mount_target_fqdn- (Required) The FQDN of the NFS server to connect to.name- (Required) The name of the NfsVolume.type- (Required) Discriminator for sub-entities.
working_directory- (Optional) Container’s working directory.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
Attributes Reference
The following attributes are exported:
compartment_id- The OCID of the compartment.defined_tags- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:{"Operations.CostCenter": "42"}description- The batch task environment description.display_name- A user-friendly name. Does not have to be unique, and it’s changeable. If not specified or provided as null or empty string, it be generated as “”, where timeCreated corresponds with the resource creation time in ISO 8601 basic format, i.e. omitting separating punctuation, at second-level precision and no UTC offset. Example: batchtaskenvironment20250914115623. freeform_tags- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}id- The OCID of the batch task environment.image_url- The URL of the ocir image.security_context- Security context for container runtime configuration.See also docs.
fs_group- A special supplemental group ID that applies to all containers in a pod.run_as_group- Group ID for running processes inside the container.run_as_user- User ID for running processes inside the container.
state- The current state of the batch task environment.system_tags- System tags for this resource. Each key is predefined and scoped to a namespace. Example:{"orcl-cloud.free-tier-retained": "true"}time_created- The date and time the batch task environment was created, in the format defined by RFC 3339. Example:2016-08-25T21:10:29.600Ztime_updated- The date and time the batch task environment was updated, in the format defined by RFC 3339. Example:2016-08-25T21:10:29.600Zvolumes- List of volumes attached to the image. The use cases of the volumes are but not limited to: read the input of the task and write the output.local_mount_directory_path- The local path to mount the NFS share to.mount_target_export_path- The path to the directory on the NFS server to be mounted.mount_target_fqdn- The FQDN of the NFS server to connect to.name- The name of the NfsVolume.type- Discriminator for sub-entities.
working_directory- Container’s working directory.
Timeouts
The timeouts block allows you to specify timeouts for certain operations:
* create - (Defaults to 20 minutes), when creating the Batch Task Environment
* update - (Defaults to 20 minutes), when updating the Batch Task Environment
* delete - (Defaults to 20 minutes), when destroying the Batch Task Environment
Import
BatchTaskEnvironments can be imported using the id, e.g.
$ terraform import oci_batch_batch_task_environment.test_batch_task_environment "id"