Search code examples
amazon-web-servicesaws-cloudformationaws-cloudformation-custom-resource

replicate existing AWS resource with CloudFormation


I have AWS resources that I manually created in the browser

Now I want to have the ability to create equivalent resources using CloudFormation. Is there a tool that turns an already existing AWS resource into a cloudformation template that would create it with all its current properties?

As an example, I have an IAM role with many attached policies. I would like to have a fully functional CloudFormation Template that replicates it.

Is this possible?

The alternative is going through the CloudFormation IAM Role documentation and see all options and manually inspect these properties on the console and replicate them with trial and error.

I have tried to create a stack in CloudFormation using existing resources but it asks for a template... I don't have a template I want to create one.. I also tried to create a stack using the Designer but I couldnt find an option to import existing resources there


Solution

  • Since February 2024, generating CloudFormation templates from existing resources is possible with AWS CloudFormation IaC generator