Skip to content

Commit

Permalink
Fix hostname2
Browse files Browse the repository at this point in the history
  • Loading branch information
cybermaggedon committed Oct 5, 2024
1 parent 706033f commit 6191b4f
Showing 1 changed file with 0 additions and 130 deletions.
130 changes: 0 additions & 130 deletions pulumi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const repo = get("artifact-repo");
const artifactRepoRegion = get("artifact-repo-region");
const artifactName = get("artifact-name");
const hostname = get("hostname");
const hostname2 = get("hostname2");
const hostname3 = get("hostname3");
const managedZone = get("managed-zone");
const project = get("gcp-project");
const region = get("gcp-region");
Expand Down Expand Up @@ -211,40 +209,6 @@ const domainMapping = new gcp.cloudrun.DomainMapping(
}
);
const domainMapping2 = new gcp.cloudrun.DomainMapping(
"domain-mapping-2",
{
name: hostname2,
location: cloudRunRegion,
metadata: {
namespace: project,
},
spec: {
routeName: service.name,
}
},
{
provider: provider
}
);
const domainMapping3 = new gcp.cloudrun.DomainMapping(
"domain-mapping-3",
{
name: hostname3,
location: cloudRunRegion,
metadata: {
namespace: project,
},
spec: {
routeName: service.name,
}
},
{
provider: provider
}
);
const zone = gcp.dns.getManagedZoneOutput(
{
name: managedZone,
Expand Down Expand Up @@ -303,100 +267,6 @@ domainMapping.statuses.apply(
}
);
domainMapping2.statuses.apply(
ss => ss[0].resourceRecords
).apply(
rrs => {
if (rrs) {
let mapping : { [k : string] : string[] } = {};
for(var i = 0; i < rrs.length; i++) {
if (rrs[i].rrdata) {
const rr = rrs[i].rrdata;
const tp = rrs[i].type;
if (!rr || !tp) continue;
if (mapping[tp])
mapping[tp].push(rr);
else
mapping[tp] = [rr];
}
}
for (let tp in mapping) {
const recordSet = new gcp.dns.RecordSet(
"resource-record-2-" + tp,
{
name: hostname2 + ".",
managedZone: zone.name,
type: tp,
ttl: 300,
rrdatas: mapping[tp],
},
{
provider: provider,
}
);
}
}
}
);
domainMapping3.statuses.apply(
ss => ss[0].resourceRecords
).apply(
rrs => {
if (rrs) {
let mapping : { [k : string] : string[] } = {};
for(var i = 0; i < rrs.length; i++) {
if (rrs[i].rrdata) {
const rr = rrs[i].rrdata;
const tp = rrs[i].type;
if (!rr || !tp) continue;
if (mapping[tp])
mapping[tp].push(rr);
else
mapping[tp] = [rr];
}
}
for (let tp in mapping) {
const recordSet = new gcp.dns.RecordSet(
"resource-record-3-" + tp,
{
name: hostname3 + ".",
managedZone: zone.name,
type: tp,
ttl: 300,
rrdatas: mapping[tp],
},
{
provider: provider,
}
);
}
}
}
);
////////////////////////////////////////////////////////////////////////////
const serviceMon = new gcp.monitoring.GenericService(
Expand Down

0 comments on commit 6191b4f

Please sign in to comment.