high-hamburger-69207
03/08/2023, 8:02 PMimport * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import express ...
app.get(/make-ec2, (req,res)=> {
const ubuntu = aws.ec2.getAmi({
mostRecent: true,
filters: [
{
name: "name",
values: ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"],
},
{
name: "virtualization-type",
values: ["hvm"],
},
],
owners: ["099720109477"],
});
const web = new aws.ec2.Instance("web", {
ami: ubuntu.then(ubuntu => ubuntu.id),
instanceType: "t3.micro",
tags: {
Name: "HelloWorld",
}
});
res.send(web)
})
I am already doing this with AWS SDK, just wanted to know if I can do this by pulumi?creamy-agency-52831
03/08/2023, 8:03 PMhigh-hamburger-69207
03/08/2023, 8:05 PM