thankful-gpu-3329
11/01/2022, 9:05 PMpulumi up
using TS from the docs as well:
https://joeysharesthings.com/wHmxRMimport * as pulumi from '@pulumi/pulumi'
import * as aws from '@pulumi/aws'
import * as awsx from '@pulumi/awsx'
const vpc = new awsx.ec2.Vpc('umbrel-research-vpc', {})
// Allocate a security group and then a series of rules:
const sg = new aws.ec2.SecurityGroup('umbrel-research-sg', {
vpcId: vpc.vpc.id,
ingress: [
{
description: 'allow SSH access from 203.0.113.25',
fromPort: 22,
toPort: 22,
protocol: 'tcp',
cidrBlocks: ['74.110.213.26/32'],
},
{
description: 'allow HTTPS access from anywhere',
fromPort: 443,
toPort: 443,
protocol: 'tcp',
cidrBlocks: ['0.0.0.0'],
},
{
description: 'allow HTTP access from anywhere',
fromPort: 80,
toPort: 80,
protocol: 'tcp',
cidrBlocks: ['0.0.0.0'],
},
],
egress: [
{
fromPort: 0,
toPort: 0,
protocol: '-1',
cidrBlocks: ['0.0.0.0/0'],
},
],
})
// Get the most recent Amazon linux ami:
const ami = aws.ec2.getAmiOutput({
filters: [
{
name: 'name',
values: ['amzn-ami-hvm-*'],
},
],
owners: ['137112412989'], // This owner ID is Amazon
mostRecent: true,
})
const server = new aws.ec2.Instance('umbrel-research-server', {
instanceType: 't2.micro',
vpcSecurityGroupIds: [sg.id], // reference the security group resource above
ami: ami.id,
})
export const vpcId = vpc.vpc.id
export const privateSubnetIds = vpc.privateSubnetIds
export const publicSubnetIds = vpc.publicSubnetIds
export const serverArn = server.arn
little-cartoon-10569
11/01/2022, 11:17 PMthankful-gpu-3329
11/02/2022, 8:41 PM