-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
247 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Record, RecordConfig } from "@cdktf/provider-cloudflare/lib/record" | ||
import { Zone } from "@cdktf/provider-cloudflare/lib/zone" | ||
import { Construct } from "constructs" | ||
|
||
export type GitHubPagesCloudflareDomainConstructProperties = { | ||
organization: string | ||
repository: string | ||
subdomain: string | ||
zone: Zone | ||
cdk?: { | ||
record?: RecordConfig | ||
} | ||
} | ||
|
||
export class GitHubPagesCloudflareDomainConstruct extends Construct { | ||
public readonly record: Record | ||
|
||
public constructor( | ||
scope: Construct, | ||
id: string, | ||
props: GitHubPagesCloudflareDomainConstructProperties, | ||
) { | ||
super(scope, id) | ||
|
||
const { cdk, organization, repository, subdomain, zone } = props | ||
|
||
this.record = new Record(this, "record", { | ||
comment: `GitHub pages domain for https://github.com/${organization}/${repository}`, | ||
name: subdomain, | ||
type: "CNAME", | ||
value: `${organization}.github.io`, | ||
zoneId: zone.id, | ||
...cdk?.record, | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Zone } from "@cdktf/provider-cloudflare/lib/zone" | ||
import { Record } from "@cdktf/provider-cloudflare/lib/record" | ||
import { Construct } from "constructs" | ||
|
||
export type GitHubVerifiedCloudflareDomainConstructProperties = { | ||
subdomain: string | ||
txtValue: string | ||
zone: Zone | ||
} | ||
|
||
export class GitHubVerifiedCloudflareDomainConstruct extends Construct { | ||
public constructor( | ||
scope: Construct, | ||
id: string, | ||
props: GitHubVerifiedCloudflareDomainConstructProperties, | ||
) { | ||
super(scope, id) | ||
|
||
const { zone, subdomain, txtValue } = props | ||
|
||
new Record(this, "txt", { | ||
comment: "GitHub verification", | ||
name: subdomain, | ||
proxied: false, | ||
type: "TXT", | ||
value: txtValue, | ||
zoneId: zone.id, | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Construct } from "constructs" | ||
|
||
import { | ||
BaseTerraformStack, | ||
BaseTerraformStackProperties, | ||
} from "./BaseTerraformStack" | ||
import { CloudflareZonesStack } from "./CloudflareZoneStack" | ||
import { GitHubVerifiedCloudflareDomainConstruct } from "../constructs/GitHubVerifiedCloudflareDomainConstruct" | ||
|
||
export type LShayCcStackProperties = BaseTerraformStackProperties & { | ||
zones: CloudflareZonesStack["zones"] | ||
} | ||
|
||
export class LShayCcStack extends BaseTerraformStack { | ||
public constructor( | ||
scope: Construct, | ||
id: string, | ||
props: LShayCcStackProperties, | ||
) { | ||
super(scope, id, props) | ||
|
||
new GitHubVerifiedCloudflareDomainConstruct( | ||
this, | ||
"lshayCcGitHubVerifiedCloudflareDomain", | ||
{ | ||
subdomain: "_github-pages-challenge-lukeshay", | ||
txtValue: "e4df395dccaeff1ba602db6ea481d5", | ||
zone: props.zones.lshayCc.zone, | ||
}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Construct } from "constructs" | ||
|
||
import { | ||
BaseTerraformStack, | ||
BaseTerraformStackProperties, | ||
} from "./BaseTerraformStack" | ||
import { CloudflareZonesStack } from "./CloudflareZoneStack" | ||
import { GitHubVerifiedCloudflareDomainConstruct } from "../constructs/GitHubVerifiedCloudflareDomainConstruct" | ||
import { GitHubPagesCloudflareDomainConstruct } from "../constructs/GitHubPagesCloudflareDomainConstruct" | ||
|
||
export type LShayLandStackProperties = BaseTerraformStackProperties & { | ||
zones: CloudflareZonesStack["zones"] | ||
} | ||
|
||
export class LShayLandStack extends BaseTerraformStack { | ||
public constructor( | ||
scope: Construct, | ||
id: string, | ||
props: LShayLandStackProperties, | ||
) { | ||
super(scope, id, props) | ||
|
||
new GitHubVerifiedCloudflareDomainConstruct( | ||
this, | ||
"lshayLandGitHubVerifiedCloudflareDomain", | ||
{ | ||
subdomain: "_github-pages-challenge-lukeshay", | ||
txtValue: "07f7961032705bd6c179eb1abbbecf", | ||
zone: props.zones.lshayLand.zone, | ||
}, | ||
) | ||
|
||
new GitHubPagesCloudflareDomainConstruct( | ||
this, | ||
"lshayLandUIGitHubPagesCloudflareDomain", | ||
{ | ||
organization: "lukeshay", | ||
repository: "ui", | ||
subdomain: "ui", | ||
zone: props.zones.lshayLand.zone, | ||
}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Construct } from "constructs" | ||
|
||
import { | ||
BaseTerraformStack, | ||
BaseTerraformStackProperties, | ||
} from "./BaseTerraformStack" | ||
import { CloudflareZonesStack } from "./CloudflareZoneStack" | ||
import { GitHubVerifiedCloudflareDomainConstruct } from "../constructs/GitHubVerifiedCloudflareDomainConstruct" | ||
|
||
export type LShayOrgStackProperties = BaseTerraformStackProperties & { | ||
zones: CloudflareZonesStack["zones"] | ||
} | ||
|
||
export class LShayOrgStack extends BaseTerraformStack { | ||
public constructor( | ||
scope: Construct, | ||
id: string, | ||
props: LShayOrgStackProperties, | ||
) { | ||
super(scope, id, props) | ||
|
||
new GitHubVerifiedCloudflareDomainConstruct( | ||
this, | ||
"lshayOrgGitHubVerifiedCloudflareDomain", | ||
{ | ||
subdomain: "_github-pages-challenge-lukeshay", | ||
txtValue: "e89dedeff94eca2e3572f64d039707", | ||
zone: props.zones.lshayOrg.zone, | ||
}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Construct } from "constructs" | ||
|
||
import { | ||
BaseTerraformStack, | ||
BaseTerraformStackProperties, | ||
} from "./BaseTerraformStack" | ||
import { CloudflareZonesStack } from "./CloudflareZoneStack" | ||
import { GitHubVerifiedCloudflareDomainConstruct } from "../constructs/GitHubVerifiedCloudflareDomainConstruct" | ||
|
||
export type LShayXyzStackProperties = BaseTerraformStackProperties & { | ||
zones: CloudflareZonesStack["zones"] | ||
} | ||
|
||
export class LShayXyzStack extends BaseTerraformStack { | ||
public constructor( | ||
scope: Construct, | ||
id: string, | ||
props: LShayXyzStackProperties, | ||
) { | ||
super(scope, id, props) | ||
|
||
new GitHubVerifiedCloudflareDomainConstruct( | ||
this, | ||
"lshayXyzGitHubVerifiedCloudflareDomain", | ||
{ | ||
subdomain: "_github-pages-challenge-lukeshay", | ||
txtValue: "258c4ef472de401805fd184a306e2c", | ||
zone: props.zones.lshayXyz.zone, | ||
}, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters