diff --git a/pulumi/Pulumi.dev.yaml b/pulumi/Pulumi.dev.yaml new file mode 100644 index 0000000..c7f7aa6 --- /dev/null +++ b/pulumi/Pulumi.dev.yaml @@ -0,0 +1,6 @@ +config: + aws:region: eu-south-1 + photos:ghVerificationHostname: + secure: AAABAK4RBLkQScF98pRH/igUwsn9CEq+WEt6XgXEksJQ1GRx3k4pUwNn51Vk5evY4BY9hoW3kgd5rQjdi6rw1GrVMYbgFmVuS68s7T3BZC8Dbh4m0b0= + photos:ghVerificationValue: + secure: AAABAPrBerjeJAZroYO5rbn8YUTNsOy67pKggiYN2cxb3on9gCBg3ba19/ywaZAa/bz2T1TI4/rh02gPVnc= diff --git a/pulumi/index.ts b/pulumi/index.ts index cf3b392..c49966c 100644 --- a/pulumi/index.ts +++ b/pulumi/index.ts @@ -1,8 +1,37 @@ import { BucketV2 } from "@pulumi/aws/s3"; - +import {getZone, Record, RecordType} from "@pulumi/aws/route53"; +import { Config } from "@pulumi/pulumi"; +const config = new Config('photos') // create photo repositories // flickr const flickrRepo = new BucketV2("my-flickr-repo"); +const lysz210Zone = getZone({ + name: "lysz210.name" +}) + +const ghPagesVerificationRecord = new Record("ghPagesVerificationRecord", { + zoneId: lysz210Zone.then(zone => zone.zoneId), + type: RecordType.TXT, + name: config.requireSecret("ghVerificationHostname"), + records: [config.requireSecret("ghVerificationValue")], + ttl: 300 +}); + +const ghPagesPointerRecord = new Record("ghPagesPointerRecord", { + zoneId: lysz210Zone.then(zone => zone.zoneId), + type: RecordType.A, + name: 'photos.gh.lysz210.name', + records: [ + '185.199.108.153', + '185.199.109.153', + '185.199.110.153', + '185.199.111.153', + ], + ttl: 300 +}) + // Export the name of the bucket export const flickrRepoId = flickrRepo.id; +export const ghPagesVerification = ghPagesVerificationRecord.name +export const ghPagesPointer = ghPagesPointerRecord.name \ No newline at end of file