https://pulumi.com logo
#aws
Title
# aws
n

nice-lamp-12786

12/02/2020, 4:45 AM
On a different note, it appears that AWS t4g instances are not supported? I'm getting this error when I try to launch an EC2 instance type of "t4g.nano":
Copy code
aws:ec2:Instance (webserver-www):
    error: 1 error occurred:
        * Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.
        status code: 400, request id: f97087d6-efc6-4893-8362-344c997733c0
b

billowy-army-68599

12/02/2020, 6:20 AM
i was launching those instances just today, can you share the rest of your code?
l

little-cartoon-10569

12/02/2020, 6:35 AM
Also may need to know the region?
T4g instances are available today in US East (N. Virginia, Ohio), US West (Oregon), Asia Pacific (Tokyo, Mumbai), Europe (Frankfurt, Ireland).
n

nice-lamp-12786

12/02/2020, 3:24 PM
Copy code
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import * as pulumi from "@pulumi/pulumi";

const ami = pulumi.output(aws.getAmi({
    mostRecent: true,
    filters: [
        { name: "name", values: ["ubuntu/images/hvm-ssd/ubuntu-groovy-20.10-amd64-server-*"], },
        { name: "virtualization-type", values: ["hvm"], },
    ],
    owners: ["099720109477"],
}));

const server2 = new aws.ec2.Instance("webserver-www2", {
    ami: ami.id,
    instanceType: "t4g.nano",
});
Copy code
cat ~/.aws/config
[default]
region = us-west-2
output = json
Copy code
Diagnostics:                                                                                                                                                                                                       
  aws:ec2:Instance (webserver-www2):                                                                                                                                                                               
    error: 1 error occurred:                                                                                                                                                                                       
        * Error launching source instance: Unsupported: The requested configuration is currently not supported. Please check the documentation for supported configurations.                                       
        status code: 400, request id: 3553326d-ce4a-46dd-b677-781f8afdfa96
changing
"t4g.nano"
to
"t3.nano"
works. Not sure why t4g isn't working.
b

billowy-army-68599

12/02/2020, 4:04 PM
@nice-lamp-12786 you’re trying to run an amd64 AMI on a graviton instance. The graviton instances need specific AMIs because they’re not compatible with the chipset
n

nice-lamp-12786

12/02/2020, 4:06 PM
Ah, thank you! I will start working on trying to find the right AMI.
For anyone reading this in the future, 1) Hello!, and 2) this is what worked for me:
Copy code
const size = "t4g.micro";
const ubuntu = pulumi.output(aws.getAmi({
    mostRecent: true,
    filters: [
        { name: "name", values: ["ubuntu/images/hvm-ssd/ubuntu-groovy-20.10-arm64-server-*"], },
        { name: "virtualization-type", values: ["hvm"], },
    ],
    owners: ["099720109477"],
}));
Notice the "arm64" in the string. @billowy-army-68599 THANK YOU!
b

billowy-army-68599

12/02/2020, 4:31 PM
Glad you got it sorted! The error returned from the AWS api isn’t super clear
n

nice-lamp-12786

12/03/2020, 12:05 AM
pulumi version = v2.14.0 New typescript problem: same code, but I'm getting this typescript error:
Copy code
Diagnostics:
  pulumi:pulumi:Stack (website-website):
    error: Running program '/home/user/code/pulumi/website' failed with an unhandled exception:
    TSError: ⨯ Unable to compile TypeScript:
    index.ts(222,3): error TS2322: Type '"t4g.micro"' is not assignable to type 'Input<"a1.2xlarge" | "a1.4xlarge" | "a1.large" | "a1.medium" | "a1.xlarge" | "c3.2xlarge" | "c3.4xlarge" | "c3.8xlarge" | "c3.large" | "c3.xlarge" | "c4.2xlarge" | "c4.4xlarge" | ... 154 more ... | "z1d.xlarge">'.
    
        at createTSError (/home/user/code/pulumi/website/node_modules/ts-node/src/index.ts:261:12)
        at getOutput (/home/user/code/pulumi/website/node_modules/ts-node/src/index.ts:367:40)
        at Object.compile (/home/user/code/pulumi/website/node_modules/ts-node/src/index.ts:558:11)
        at Module.m._compile (/home/user/code/pulumi/website/node_modules/ts-node/src/index.ts:439:43)
        at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
        at Object.require.extensions.<computed> [as .ts] (/home/user/code/pulumi/website/node_modules/ts-node/src/index.ts:442:12)
        at Module.load (internal/modules/cjs/loader.js:928:32)
        at Function.Module._load (internal/modules/cjs/loader.js:769:14)
        at Module.require (internal/modules/cjs/loader.js:952:19)
        at require (internal/modules/cjs/helpers.js:88:18)
I got around this before by hand editing the ts file in node_modules, but that seems like a bad approach (since I had to
npm install
again and it blew away my hacky changes). What's the better way to get around this?
Copy code
"devDependencies": {
        "@types/node": "^10.17.48"
    },
    "dependencies": {
        "@pulumi/aws": "^3.17.0",
        "@pulumi/awsx": "^0.22.0",
        "@pulumi/pulumi": "^2.15.0",
        "@types/ssh2": "^0.5.39",
        "@types/uuid": "^3.4.4",
        "scp2": "^0.5.0",
        "ssh2": "^0.8.5",
        "uuid": "^3.4.0"
    }