Skip to content

ECS_ENABLE_SPOT_INSTANCE_DRAINING should be enabled with one conditionΒ #18

@jakubserwatka-oktawave

Description

@jakubserwatka-oktawave

Describe the Bug

In line

echo ECS_ENABLE_SPOT_INSTANCE_DRAINING=${provider.instance_market_options != null && provider.mixed_instances_policy != null} >> /etc/ecs/ecs.config

The spot instance draining is only enabled if both instance_market_options and mixed_instances_policy are set.
However, spot instances will be created if only mixed_instances_policy is set.

Didn't test it with only instance_market_options but I suspect it will also be enough for spot instance to be created

Expected Behavior

ECS_ENABLE_SPOT_INSTANCE_DRAINING=true when using only instance_market_options

Steps to Reproduce

    container_insights_enabled      = false
    capacity_providers_fargate      = false
    capacity_providers_fargate_spot = false

    capacity_providers_ec2 = {
        "arm-spot" = {
            image_id = "ami-04e33f2552051ccaa"

            instance_type = "t4g.small"
            mixed_instances_policy = {
                instances_distribution = {
                    on_demand_allocation_strategy            = "prioritized"
                    on_demand_base_capacity                  = 0
                    on_demand_percentage_above_base_capacity = 0
                    spot_allocation_strategy                 = "price-capacity-optimized"
                    spot_instance_pools                      = 0
                    spot_max_price                           = ""
                }
            }

            max_size = 3
            min_size = 1
            target_capacity_utilization = 80

            subnet_ids    = [
                ...
            ]
            security_group_ids = [
                ...
            ]
            associate_public_ip_address = true

            enable_monitoring = false
        }
    }

Screenshots

No response

Environment

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugπŸ› An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions