https://pulumi.com logo
#getting-started
Title
# getting-started
b

bland-painting-33593

01/26/2024, 6:28 PM
So, it looks like I have two options for pulling in existing AWS resources: pulumi import from the command line, or typescript like this: let group = new aws.ec2.SecurityGroup("my-sg", { name: "my-sg-62a569b", ingress: [{ protocol: "tcp", fromPort: 80, toPort: 80, cidrBlocks: ["0.0.0.0/0"] }], }, { import: "sg-04aeda9a214730248" }); What are the pros/cons of the two methods?
c

clever-sunset-76585

01/27/2024, 5:41 AM
The import command gives you the code snippet that you have to add to your app vs. if you already know the exact inputs of the resource you are importing, you can declare it yourself. Note that the important thing is the inputs have to exactly match the resource as it exists in your cloud provider. If you had a more complex resource to import, starting with the command might be easier as it'll give you the code snippet you have to add.