Hello! I have a s3 bucket policy for my cloudfront...
# python
c
Hello! I have a s3 bucket policy for my cloudfront. and because of reasons i had to change the pulumi name on it. causing a delete+create. But even if i add the option delete_before_replace, it is deleted after the new one is created. And since the name is only used inside pulumi, it deletes the policy on my bucket. any way to work around this?
Copy code
aws.s3.BucketPolicy(
            f"policy-{self.origin_bucket.id}",   #<--- i changed this name.
            bucket=self.origin_bucket.id,
            opts=ResourceOptions(delete_before_replace=True),
            policy=self.__get_policy_with_origins(distributions),
        )
output from a test run where i changed the name:
Copy code
+   ├─ aws:s3:BucketPolicy  policy-bucket1     created (0.89s)
 +   ├─ aws:s3:BucketPolicy  policy-bucket2     created (0.82s)
 -   ├─ aws:s3:BucketPolicy  policyyyy-bucket1  deleted (0.81s)
 -   └─ aws:s3:BucketPolicy  policyyyy-bucket2  deleted (1s)
a pulumi refresh makes pulumi find the policy is deleted. and then a second up will created the policy again.