Skip to content

Commit

Permalink
Adds back sanitization for ELB and Service Discovery post-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSeptimus committed Feb 1, 2023
1 parent 7d4652f commit be91a47
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions pkg/infra/pulumi_aws/deploylib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1444,17 +1444,25 @@ export class CloudCCLib {

let nlb
if (needsLoadBalancer) {
nlb = new awsx.lb.NetworkLoadBalancer(`${execUnitName}-nlb`, {
external: false,
vpc: this.klothoVPC,
subnets: this.privateSubnetIds,
})
nlb = new awsx.lb.NetworkLoadBalancer(
sanitized(AwsSanitizer.ELB.loadBalancer.nameValidation())`${h(execUnitName)}-nlb`,
{
external: false,
vpc: this.klothoVPC,
subnets: this.privateSubnetIds,
}
)
this.execUnitToNlb.set(execUnitName, nlb)

const targetGroup: awsx.elasticloadbalancingv2.NetworkTargetGroup =
nlb.createTargetGroup(`${execUnitName}-tg`, {
port: 3000,
})
nlb.createTargetGroup(
sanitized(AwsSanitizer.ELB.targetGroup.nameValidation())`${h(
execUnitName
)})-tg`,
{
port: 3000,
}
)

const listener = targetGroup.createListener(`${execUnitName}-listener`, {
port: 80,
Expand Down Expand Up @@ -1483,8 +1491,11 @@ export class CloudCCLib {
additionalEnvVars.push({ name, value })
}

const discoveryService = new aws.servicediscovery.Service(execUnitName, {
name: execUnitName,
const serviceName = sanitized(AwsSanitizer.ServiceDiscovery.service.nameValidation())`${h(
execUnitName
)}`
const discoveryService = new aws.servicediscovery.Service(serviceName, {
name: serviceName,
dnsConfig: {
namespaceId: this.privateDnsNamespace.id,
dnsRecords: [
Expand Down

0 comments on commit be91a47

Please sign in to comment.