SomeGuyFortune
SomeGuyFortune

Reputation: 1056

CloudFormation resource AWS::S3::Bucket doesn't show up in S3 console

Using my cloudformation template, i was able to create two buckets and one bucket policy in my stack. Turns out my bucket policy had the wrong permissions so i decided to delete the buckets and recreate them with a new template.

It doesn't look like cloudformation has detected my deleted s3 buckets. The buckets still show up in my stack resources but are marked as "Deleted" Bucket it deleted, but policy isn't checked

My stack is also marked as drifted. When i try to access the s3 buckets via the link in cloudformation, i get "Error Data not found" Error Data not found.

My stack has been in this state for about 16 hours. Any idea on how to get cloudformation to sync up with s3?

Upvotes: 1

Views: 1117

Answers (1)

TheClassic
TheClassic

Reputation: 1044

Your template isn't telling CloudFormation what resources to create, its telling CloudFormation the state that you want.

It sounds like you created a stack with a template with a resource for a bucket. You then realized a problem and deleted the bucket manually. You then updated the stack with an updated template with the same resource for the bucket (but with correct permissions)

When CloudFormation processed this updated template, it determined that it had already created the bucket and as a result it didn't recreate it.

You likely could have achieved your desired result without deleting the bucket by just updating the template.

Because you deleted the bucket, your stack is in a bad state. If you have the flexibility to do so, you could delete your stack and recreate it. When you delete it, it may complain about not being able to delete the bucket, you may have to retry once, then get the option to ignore it.

Upvotes: 6

Related Questions