https://pulumi.com logo
#general
Title
# general
m

most-napkin-6669

10/02/2022, 1:16 PM
Hey team! I create ecs cluster and log-group to store the logs in there, but whenever the job has done and i want to destroy the resources the logs from cloudwatch are getting deleted also. How can i keep the log group but destroying all the other resources?
Eventually i addressed this issue by using
retainOnDelete
resource option:
Copy code
log_group = cloudwatch.LogGroup('cloudwatch-log-group',
                                name='cloudwatch-log-group',
                                opts=pulumi.ResourceOptions(
                                    retain_on_delete=True
                                ))
e

echoing-dinner-19531

10/02/2022, 4:04 PM
That's the sort of scenario that
retainOnDelete
is for 👍
2 Views