0

I have an S3 bucket that already has all the correct policies, lifecycles, etc. that I like.

I am converting what is pre-existing into Terraform Infra as Code because we are going to be deploying in multiple regions.

I cannot seem to figure out how to export a CloudFormation template of a pre-existing S3 bucket. I can figure it out for generic services, but not for a specific S3 bucket.

Can this be done?

Eg, I would like to do something like what is described here but for an S3 bucket.

Otherwise, I can try my best to look at the GUI and see if I'm capturing all the little details, but I'd rather not.

(I am not including details on the contents of the bucket, of course, but just the configuration of the bucket. I.e., how would I recreate the same bucket, but using Terraform -- or CloudFormation -- instead.)

Mike Williamson
  • 4,915
  • 14
  • 67
  • 104
  • 1
    As describe in your link, use https://former2.com to scan your account then select your S3 bucket and it will generate your template with the configurations as they are actually on the bucket – Mickael B. Aug 18 '22 at 16:27
  • Yeah, I was hoping there was a newer solution. I would rather not use *user* IAM credentials. We try to do everything through roles and try to minimize the use of secret access keys. This is trivial to do in Azure for any of their resources. :( – Mike Williamson Aug 19 '22 at 09:24
  • Create a specific user for former2, attach a role to him and activate the credentials just when you want to scan your account, then deactivate the credentials. – Mickael B. Aug 19 '22 at 15:22
  • It's a year later. Any better solutions Mike? :) – Roelant Aug 16 '23 at 14:46
  • Not to my knowledge, @Roelant . But I have switched companies, and I'm now using GCP (Google). As it turns out, Google also does not have such a service, so Azure stands out in this regards. – Mike Williamson Aug 22 '23 at 09:18

0 Answers0