Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ The following properties has been defined as variables in order to pass data to
|`security_group` |`list` | -- |True |Security groups to be used by Compute Environment.
|`ce_name` |`string`| -- |True |Given name for Compute Environment.
|`instance_type` |`string`| `optimal`|True |The instance_type for compute environment to use.
|`ecs_containerr_properties`|`map` | -- |False |"A valid container properties provided as a single valid JSON document.|
|`ce_type` |`string`|`EC2` |False |A valid container properties provided as a single valid JSON document.
|`ecs_containerr_properties`|`map` | -- |False |A valid container properties provided as a single valid JSON document.|
|`ce_type` |`string`|`MANAGED` |False |Compute Environment type.
|`ce_provisioning_model |`string`|`EC2` |False |Compute Environment provisioning mode.
|`ce_allocation_strategy` |`string`|`BEST_FIT`|False | The allocation strategy to use for compute resource.
|`max_vcpu` |`int` |32 |False |Maximum allowed VCPUs allocated to instances.
|`min_vcpu` |`int` |0 |False |Minimum number of VCPUs allocated to instances.
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "aws_batch_compute_environment" "compute-environment" {
allocation_strategy = var.ce_allocation_strategy
security_group_ids = var.security_groups
subnets = [data.aws_subnet_ids.subnets.id]
type = "EC2"
type = var.ce_provisioning_model
}
// To prevent a race condition during environment deletion, make sure to set depends_on to the related
// aws_iam_role_policy_attachment; otherwise, the policy may be destroyed too soon and the compute environment
Expand Down
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ variable "ce_type" {
default = "MANAGED"
}

variable "ce_provisioning_model" {
description = "Compute Environment provisioning_model."
type = string
default = "EC2"
}

// Valid items are BEST_FIT_PROGRESSIVE, SPOT_CAPACITY_OPTIMIZED or BEST_FIT.
variable "ce_allocation_strategy" {
description = "The allocation strategy to use for the compute resource."
Expand Down Expand Up @@ -84,4 +90,4 @@ variable "batch_job_queue_priority" {
description = "Priority of the created Job Queue."
type = string
default = "100"
}
}