diff --git a/README.md b/README.md index 0821a06..d482e5c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/main.tf b/main.tf index 294f888..709d804 100644 --- a/main.tf +++ b/main.tf @@ -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 diff --git a/variables.tf b/variables.tf index fa2bcd6..d2a1493 100644 --- a/variables.tf +++ b/variables.tf @@ -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." @@ -84,4 +90,4 @@ variable "batch_job_queue_priority" { description = "Priority of the created Job Queue." type = string default = "100" -} \ No newline at end of file +}