Skip to content

Commit b9d7f55

Browse files
committed
chore: wip
1 parent ae50fbb commit b9d7f55

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.stacks/core/cloud/src/cloud.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,16 @@ export class StacksCloud extends Stack {
286286

287287
// for each redirect, create a bucket & redirect it to the APP_URL
288288
config.dns.redirects?.forEach((redirect) => {
289+
const slug = redirect.split('.').map((part, index) => index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1)).join('') // creates a CamelCase slug from the redirect
289290
const hostedZone = route53.HostedZone.fromLookup(this, 'HostedZone', { domainName: redirect })
290-
const redirectBucket = new s3.Bucket(this, `RedirectBucket-${redirect}`, {
291+
const redirectBucket = new s3.Bucket(this, `RedirectBucket${slug}`, {
291292
bucketName: `${redirect}-redirect`,
292293
websiteRedirect: {
293294
hostName: this.domain,
294295
protocol: s3.RedirectProtocol.HTTPS,
295296
},
296297
})
297-
new route53.CnameRecord(this, 'RedirectRecord', {
298+
new route53.CnameRecord(this, `RedirectRecord${slug}`, {
298299
zone: hostedZone,
299300
recordName: 'redirect',
300301
domainName: redirectBucket.bucketWebsiteDomainName,

0 commit comments

Comments
 (0)