aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.49k stars 404 forks source link

Error out earlier and more gracefully if attempted to change workload type / enable changing workload type #5833

Open gidsg opened 3 months ago

gidsg commented 3 months ago

Description:

We would like to switch an existing Backend service, to a Load-Balanced Web Service. i.e. expose it to the public internet.

We could not find any documentation specifically for this so attempted to switch the existing manifest service type.

Details:

Copilot 1.33.4 running via Github Actions

Observed result:

This failed with

    - A hosted zone named $ENV.$APP.internal for backends behind a private load balancer                   [delete failed]           [136.7s]
      The specified hosted zone contains non-required resource record sets a                                                              
      nd so cannot be deleted

This failed and left the stack in UPDATE_ROLLBACK_FAILED state making it difficult to recover from. (The full log is visible at: https://github.com/communitiesuk/funding-service-design-post-award-data-store/actions/runs/9385459996/job/25843783886)

Do you know if this is a supported action and if so is there a supported way to switch an existing service from Backend Service to Load-Balanced Web Service.

Expected result:

Successfully switch service from Backend Service to Load-Balanced Web Service

Debugging:

It does not appear this specific scenario is documented in the Copilot documentation

huanjani commented 3 months ago

Hi, @gidsg! Sorry, this is not a supported action. Different manifests and resources are created for the two types, so you'll need to create a new Load Balanced Web Service. I'll change the labels from 'bug' to 'feature request'. Thanks!

gidsg commented 3 months ago

this is not a supported action.

@huanjani it would be good currently if this change would be detected as an invalid change by the CLI prior to starting deployment, to prevent people attempting this and ending up in a UPDATE_ROLLBACK_FAILED state.

huanjani commented 3 months ago

Ah, you're right-- we should validate/fail earlier. I'll change the title of this issue. Thanks!