This repository was archived by the owner on Jan 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/serverless-components/domain Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -408,19 +408,23 @@ const addDomainToCloudfrontDistribution = async (
408
408
params . Id = subdomain . distributionId ;
409
409
410
410
// 5. then make our changes
411
- params . DistributionConfig . Aliases . Items . push ( subdomain . domain ) ;
411
+ params . DistributionConfig . Aliases = {
412
+ Items : [ subdomain . domain ]
413
+ } ;
414
+
412
415
if ( subdomain . domain . startsWith ( "www." ) ) {
413
416
if ( domainType === "apex" ) {
414
- params . DistributionConfig . Aliases . Items [
415
- params . DistributionConfig . Aliases . Items . length - 1
416
- ] = ` ${ subdomain . domain . replace ( "www." , "" ) } ` ;
417
+ params . DistributionConfig . Aliases . Items = [
418
+ ` ${ subdomain . domain . replace ( "www." , "" ) } `
419
+ ] ;
417
420
} else if ( domainType !== "www" ) {
418
421
params . DistributionConfig . Aliases . Items . push (
419
422
`${ subdomain . domain . replace ( "www." , "" ) } `
420
423
) ;
421
424
}
422
425
}
423
426
427
+ // Update aliases quantity to reflect actual number of items
424
428
params . DistributionConfig . Aliases . Quantity =
425
429
params . DistributionConfig . Aliases . Items . length ;
426
430
You can’t perform that action at this time.
0 commit comments