The export-aws-to-pulumi.sh
script is a utility for importing AWS resources into Pulumi. It supports importing resources from multiple AWS regions and of multiple types, including EC2 instances, S3 buckets, RDS instances, and VPCs.
- AWS CLI installed and configured with appropriate permissions.
- Pulumi CLI installed.
-
Ensure that you have the necessary permissions to access the resources you want to import.
-
Set the
AWS_PROFILE
environment variable to the name of the AWS profile you want to use. This ensures that the script runs on the correct AWS account. You can do this by running the following command in your terminal:
export AWS_PROFILE=<your-profile-name>
- Run the script:
chmod +x export-aws-to-pulumi.sh
./export-aws-to-pulumi.sh
This will generate Pulumi import commands for the AWS resources in the regions specified in the script.
You can customize the types of resources to import and the regions to import from by modifying the resource_types
and regions
variables in the script, respectively.
This script generates Pulumi import commands but does not execute them. You will need to manually execute these commands to import the resources into Pulumi.