If you're looking to launch it, here are a few steps you can take:
#1. Opt for a t3.micro over a t2.micro as t3 instances are more cost-effective, offer greater memory and CPU capacity, and higher network bandwidth. You can compare the differences here: . This means you can eliminate the need for creditSpecification
#2. The AMI with ID ami-020ae06fdda6a0f66
is only available in us-east-2 (Ohio). This particular AMI, named
aws-elasticbeanstalk-amzn-2018.03.0.x86_64-tomcat8.5java8-hvm-201906160916
, appears to be referenced in the following
AWS documentation, specifically launching it in us-east-2(Ohio). Therefore, switch to that region to proceed with the launch. If not, select an alternative AMI available in us-west-2.
#3. The provided code snippet functions correctly in us-east-2 with the previously mentioned AMI.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const myVpc = new aws.ec2.Vpc("demo-myVpc", {
cidrBlock: "172.16.0.0/16",
tags: {
Name: "Darshan",
},
});
const mySubnet = new aws.ec2.Subnet("demo-mySubnet", {
vpcId: myVpc.id,
cidrBlock: "172.16.10.0/24",
availabilityZone: "us-east-2a",
tags: {
Name: "Darshan",
},
});
const Instance = new aws.ec2.Instance("demo-Instance", {
ami: "ami-020ae06fdda6a0f66",
instanceType: "t3.micro",
subnetId: mySubnet.id,
});
export const my_vpc = myVpc.id;
export const my_vpc_cidr_block = myVpc.cidrBlock;
export const my_vpc_cidr_tags = myVpc.tags;
export const my_subnet = mySubnet.id;
export const my_subnet_cidr_block = mySubnet.cidrBlock;
export const my_subnet_tags = mySubnet.tags;
export const my_instance_ami = Instance.ami;
export const my_instance_id = Instance.id;
To access the outputs, run: pulumi stack output
Current stack outputs (8):
OUTPUT VALUE
my_instance_ami ami-020ae06fdda6a0f66
my_instance_id i-02310475c052c8097
my_subnet subnet-0e8141c37b149ea77
my_subnet_cidr_block 172.16.10.0/24
my_subnet_tags {"Name":"Darshan"}
my_vpc vpc-00eab339e95459c27
my_vpc_cidr_block 172.16.0.0/16
my_vpc_cidr_tags {"Name":"Darshan"}