This message was deleted.
# aws
s
This message was deleted.
l
Hello @aloof-sugar-9157, if you create the cluster and the tasks in the same Pulumi stack, when you destroy that stack, Pulumi tries to destroy the task(s) and the cluster. If the cluster should be shared by many tasks, create the cluster in a separate Pulumi program+stack and export the cluster information as stack output(s). From the program setting up the tasks, use a StackReference to resolve this information and deploy the tasks on the shared cluster. If you now destroy a stack managing one or more tasks, it will not touch the shared cluster.
a
Thank you!
s
What @limited-rainbow-51650 said! 😄 Also, you may find some of the recommendations/considerations for how to structure Pulumi projects in this article helpful: https://www.pulumi.com/blog/iac-recommended-practices-structuring-pulumi-projects/
a
Here is the error I get when destroying.
Copy code
Diagnostics:
  aws:ecs:Service (ITD-1234-wc-ecs-service):
    error: deleting urn:pulumi:ITD-1234::wirecare::aws:ecs/service:Service::ITD-1234-wc-ecs-service: 1 error occurred:
    	* waiting for ECS Service (arn:aws:ecs:us-east-1:877180728458:service/p-wirecare/ITD-1234-wc-ecs-service) delete: timeout while waiting for state to become 'INACTIVE' (last state: 'DRAINING', timeout: 20m0s)
We are creating the service cluster in a different stack set