Experimental pulumi
This commit is contained in:
parent
5aa4ebe3e6
commit
028a667d19
2
pulumi/.gitignore
vendored
Normal file
2
pulumi/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/bin/
|
||||||
|
/node_modules/
|
6
pulumi/Pulumi.infra.yaml
Normal file
6
pulumi/Pulumi.infra.yaml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
encryptionsalt: v1:v/2Egaf4eCE=:v1:2Vc2k1lWnahiE1Ce:83nVXz3moeXDWxGg/gjobA9cHw8zYg==
|
||||||
|
config:
|
||||||
|
aws:region: eu-west-2
|
||||||
|
tailscale:apiKey:
|
||||||
|
secure: v1:4IfYF+gWnunbS4mK:HyJkqNAOvflbV3SZYTh/0F/is4fVMYGJLaYPhOA3xqrFu1CCzy38k2ADhvvpYIbK0PxHdibN6iW9VtCKHeTXhE8rWpv97dEb
|
||||||
|
tailscale:tailnet: gmem.ca
|
3
pulumi/Pulumi.yaml
Normal file
3
pulumi/Pulumi.yaml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
name: gmem-pulumi
|
||||||
|
runtime: nodejs
|
||||||
|
description: gmem's AWS Infra
|
47
pulumi/index.ts
Normal file
47
pulumi/index.ts
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
import * as pulumi from "@pulumi/pulumi";
|
||||||
|
import * as aws from "@pulumi/aws";
|
||||||
|
import * as tailscale from "@pulumi/tailscale";
|
||||||
|
|
||||||
|
const r53_domains: { [key: string]: any } = {"gmem.ca": "", "gabrielsimmer.com": ""};
|
||||||
|
|
||||||
|
export = async () => {
|
||||||
|
for (const domain in r53_domains) {
|
||||||
|
r53_domains[domain] = new aws.route53.Zone(domain, {
|
||||||
|
comment: "Managed by Pulumi",
|
||||||
|
name: domain,
|
||||||
|
}, {
|
||||||
|
protect: true,
|
||||||
|
}).id;
|
||||||
|
}
|
||||||
|
|
||||||
|
const vancouver_ts = await tailscale.getDevice({ name: "vancouver.scorpion-ghost.ts.net" });
|
||||||
|
new aws.route53.Record("vancouver", {
|
||||||
|
zoneId: r53_domains["gmem.ca"],
|
||||||
|
name: "vancouver.gmem.ca",
|
||||||
|
type: "A",
|
||||||
|
ttl: 300,
|
||||||
|
records: [vancouver_ts.addresses[0]]
|
||||||
|
});
|
||||||
|
new aws.route53.Record("galleon", {
|
||||||
|
zoneId: r53_domains["gmem.ca"],
|
||||||
|
name: "galleon.gmem.ca",
|
||||||
|
type: "A",
|
||||||
|
ttl: 300,
|
||||||
|
records: [vancouver_ts.addresses[0]]
|
||||||
|
});
|
||||||
|
new aws.route53.Record("gabrielsimmercom", {
|
||||||
|
zoneId: r53_domains["gabrielsimmer.com"],
|
||||||
|
name: "gabrielsimmer.com",
|
||||||
|
type: "A",
|
||||||
|
ttl: 3600,
|
||||||
|
records: ["66.241.124.117"]
|
||||||
|
});
|
||||||
|
new aws.route53.Record("gabrielsimmercom-aaaa", {
|
||||||
|
zoneId: r53_domains["gabrielsimmer.com"],
|
||||||
|
name: "gabrielsimmer.com",
|
||||||
|
type: "AAAA",
|
||||||
|
ttl: 3600,
|
||||||
|
records: ["2a09:8280:1::4e:42fd"]
|
||||||
|
});
|
||||||
|
return { "vancouver ts ip": vancouver_ts.addresses[0] };
|
||||||
|
}
|
2404
pulumi/package-lock.json
generated
Normal file
2404
pulumi/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
13
pulumi/package.json
Normal file
13
pulumi/package.json
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"name": "gmem-pulumi",
|
||||||
|
"main": "index.ts",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^16"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@pulumi/aws": "^5.0.0",
|
||||||
|
"@pulumi/awsx": "^1.0.0",
|
||||||
|
"@pulumi/pulumi": "^3.0.0",
|
||||||
|
"@pulumi/tailscale": "^0.12.2"
|
||||||
|
}
|
||||||
|
}
|
18
pulumi/tsconfig.json
Normal file
18
pulumi/tsconfig.json
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"strict": true,
|
||||||
|
"outDir": "bin",
|
||||||
|
"target": "es2016",
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"sourceMap": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"pretty": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"forceConsistentCasingInFileNames": true
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.ts"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue