Skip to content

Commit bf35dc3

Browse files
committed
chore: wip
1 parent 205ab20 commit bf35dc3

File tree

5 files changed

+20
-16
lines changed

5 files changed

+20
-16
lines changed

.stacks/core/buddy/src/commands/cloud.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ export function cloud(buddy: CLI) {
159159
// and consequently the buckets will be deleted
160160
// the reason we are using 7 as the number of times to run the command is because it's the most amount of times I have had to run it to get it to delete everything
161161
try {
162-
log.info('Finalizing the removal of your cloud resources...')
162+
log.info('Finalizing the removal of your cloud resources.')
163+
log.info('This will take a few moments...')
163164
loop(7, () => {
164165
runCommandSync('buddy cloud:cleanup', {
165166
...options,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import {
55
CfnOutput as Output,
66
aws_cloudfront as cloudfront,
77
aws_cloudfront_origins as origins,
8+
aws_route53 as route53,
89
aws_secretsmanager as secretsmanager,
910
aws_ssm as ssm,
11+
aws_route53_targets as targets,
1012
} from 'aws-cdk-lib'
1113
import type { Construct } from 'constructs'
1214
import { config } from '@stacksjs/config'
@@ -21,6 +23,7 @@ export interface CdnStackProps extends NestedCloudProps {
2123
publicBucket: s3.Bucket
2224
firewall: wafv2.CfnWebACL
2325
originRequestFunction: lambda.Function
26+
zone: route53.IHostedZone
2427
}
2528

2629
// export class CdnStack extends NestedStack {
@@ -109,6 +112,12 @@ export class CdnStack {
109112
],
110113
})
111114

115+
new route53.ARecord(scope, 'AliasRecord', {
116+
recordName: props.domain,
117+
zone: props.zone,
118+
target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(this.distribution)),
119+
})
120+
112121
new Output(scope, 'DistributionId', {
113122
value: this.distribution.distributionId,
114123
})

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { RemovalPolicy, aws_route53 as route53, aws_s3 as s3, aws_route53_target
33
import type { Construct } from 'constructs'
44
import type { NestedCloudProps } from '../types'
55

6-
// export class DnsStack extends NestedStack {
76
export class DnsStack {
87
zone: route53.IHostedZone
98

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
/* eslint-disable no-new */
2-
import type {
3-
CfnResource,
4-
} from 'aws-cdk-lib'
5-
import {
6-
AssetHashType,
7-
CfnOutput as Output,
8-
RemovalPolicy,
9-
aws_lambda as lambda,
10-
} from 'aws-cdk-lib'
2+
import type { CfnResource } from 'aws-cdk-lib'
3+
import { AssetHashType, CfnOutput as Output, RemovalPolicy, aws_lambda as lambda } from 'aws-cdk-lib'
114
import type { Construct } from 'constructs'
125
import { config } from '@stacksjs/config'
136
import { path as p } from '@stacksjs/path'
@@ -22,7 +15,6 @@ export class DocsStack {
2215
originRequestFunction: lambda.Function
2316

2417
constructor(scope: Construct, props: DocsStackProps) {
25-
// super(scope, 'Docs', props)
2618
// if docsPrefix is not set, then we know we are in docsMode and the documentation lives at the root of the domain
2719
const docsPrefix = config.app.docMode ? '' : config.docs.base
2820

@@ -50,9 +42,11 @@ export class DocsStack {
5042
const cfnOriginRequestFunction = this.originRequestFunction.node.defaultChild as CfnResource
5143
cfnOriginRequestFunction.applyRemovalPolicy(RemovalPolicy.RETAIN)
5244

53-
new Output(scope, 'DocsUrl', {
54-
value: `https://${props.domain}/${docsPrefix}`,
55-
description: 'The URL of the deployed documentation',
56-
})
45+
if (!config.app.docMode) {
46+
new Output(scope, 'DocsUrl', {
47+
value: `https://${props.domain}/${docsPrefix}`,
48+
description: 'The URL of the deployed documentation',
49+
})
50+
}
5751
}
5852
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export class Cloud extends Stack {
3535
certificate: security.certificate,
3636
firewall: security.firewall,
3737
originRequestFunction: docs.originRequestFunction,
38+
zone: dns.zone,
3839
})
3940

4041
new DeploymentStack(this, {

0 commit comments

Comments
 (0)