#refarch (2023-12)

Cloud Posse Reference Architecture

2023-12-12

johncblandii avatar
johncblandii
#931 ecs-service: circuit breaker params are ignored

Describe the Bug

https://github.com/cloudposse/terraform-aws-components/blob/main/modules/ecs-service/main.tf#L259

deployment_controller_type = lookup(local.task, "deployment_controller_type", null) ends up passing in null which does not default to ECS for this conditional https://github.com/cloudposse/terraform-aws-ecs-alb-service-task/blob/main/main.tf#L642 so circuit_breaker_deployment_enabled and circuit_breaker_rollback_enabled never get enabled.

Expected Behavior

...
        task:
          circuit_breaker_deployment_enabled: true
          circuit_breaker_rollback_enabled: true

…should trigger…

      ~ deployment_circuit_breaker {
          ~ enable   = false -> true
          ~ rollback = false -> true
        }

Changing the values should trigger an update, but it requires manually setting deployment_controller_type: ECS.

Steps to Reproduce

Enable the circuit breaker for a task without explicitly setting the deployment controller.

Screenshots

No response

Environment

No response

Additional Context

No response

Dan Miller (Cloud Posse) avatar
Dan Miller (Cloud Posse)

@Jeremy White (Cloud Posse) @Ben Smith (Cloud Posse) have either of you seen this bug in recent ECS engagements?

#931 ecs-service: circuit breaker params are ignored

Describe the Bug

https://github.com/cloudposse/terraform-aws-components/blob/main/modules/ecs-service/main.tf#L259

deployment_controller_type = lookup(local.task, "deployment_controller_type", null) ends up passing in null which does not default to ECS for this conditional https://github.com/cloudposse/terraform-aws-ecs-alb-service-task/blob/main/main.tf#L642 so circuit_breaker_deployment_enabled and circuit_breaker_rollback_enabled never get enabled.

Expected Behavior

...
        task:
          circuit_breaker_deployment_enabled: true
          circuit_breaker_rollback_enabled: true

…should trigger…

      ~ deployment_circuit_breaker {
          ~ enable   = false -> true
          ~ rollback = false -> true
        }

Changing the values should trigger an update, but it requires manually setting deployment_controller_type: ECS.

Steps to Reproduce

Enable the circuit breaker for a task without explicitly setting the deployment controller.

Screenshots

No response

Environment

No response

Additional Context

No response

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

Haven’t, but I’ve not seen folks using the circuit breaker in general until this bug report.

Ben Smith (Cloud Posse) avatar
Ben Smith (Cloud Posse)

This looks like a relatively easy fix to the component by changing some inputs and or the conditionals. If you have time to write a PR to this I’d be happy to review and merge this, otherwise I can try to get to it, though my plate is pretty loaded ATM. How much of a blocker is this issue>

Gabriela Campana (Cloud Posse) avatar
Gabriela Campana (Cloud Posse)

@johncblandii

johncblandii avatar
johncblandii

It isn’t a blocker since we found a way to work around it

johncblandii avatar
johncblandii

I haven’t provided an update for it, but if i get a window I will

1
1

2023-12-13

2023-12-15

2023-12-21

Matthew Reggler avatar
Matthew Reggler

Found a tiny bug in the spacelift-stack module in terraform-spacelift-cloud-infrastructure-automation Posting in this channel as it feels like the closest fit for this issue.

https://github.com/cloudposse/terraform-spacelift-cloud-infrastructure-automation/issues/159

2
Gabriela Campana (Cloud Posse) avatar
Gabriela Campana (Cloud Posse)

@Dan Miller (Cloud Posse)

Dan Miller (Cloud Posse) avatar
Dan Miller (Cloud Posse)
#160 fix `spacelift-stack`: changed resource type from `set(string)` to `list(string)`

what

• Change the resource type used for var.context_attachments and var. policy_ids to a list of strings rather than a set of strings

why

• The terraform logic for Spacelift stack attachments (found in attachments.tf) uses a terraform for-loop in the two-symbol form to retrieve the index in each iteration of the loop. This leads to an error as the type of the variables used for these attachments is set(string), which does not support two-symbol loops.

references

• closes #159 • related to cloudposse/terraform-aws-components#939

1
Dan Miller (Cloud Posse) avatar
Dan Miller (Cloud Posse)
#940 fix `spacelift/admin-stack`: changed resource type from set to list

what

• Change the resource type used for var.context_attachments to a list of strings rather than a set of strings

why

• The terraform logic for Spacelift stack attachments (found in attachments.tf) uses a terraform for-loop in the two-symbol form to retrieve the index in each iteration of the loop. This leads to an error as the type of the variables used for these attachments is set(string), which does not support two-symbol loops.

references

cloudposse/terraform-spacelift-cloud-infrastructure-automation#160 • resolves #939

1
Dan Miller (Cloud Posse) avatar
Dan Miller (Cloud Posse)

done!

1
Matthew Reggler avatar
Matthew Reggler

Amazing! Thanks for the quick fix!

np1

2023-12-22

    keyboard_arrow_up