UNPKG

@stacksjs/cloud

Version:

The Stacks cloud/serverless integration & implementation.

34 lines (29 loc) 1.04 kB
import type { Construct } from 'constructs'; import type { NestedCloudProps } from '../types'; export declare class DnsStack { zone: route53.IHostedZone constructor(scope: Construct, props: NestedCloudProps) { this.zone = route53.PublicHostedZone.fromLookup(scope, 'AppUrlHostedZone', { domainName: props.domain, }) const wwwBucket = new s3.Bucket(scope, 'WwwBucket', { bucketName: `www.${props.domain}`, websiteRedirect: { hostName: props.domain, protocol: s3.RedirectProtocol.HTTPS, }, removalPolicy: RemovalPolicy.DESTROY, autoDeleteObjects: true, }) new route53.ARecord(scope, 'WwwAliasRecord', { recordName: `www.${props.domain}`, zone: this.zone, target: route53.RecordTarget.fromAlias(new targets.BucketWebsiteTarget(wwwBucket)), }) new route53.ARecord(scope, 'StoreAliasRecord', { recordName: `store.${props.domain}`, zone: this.zone, target: route53.RecordTarget.fromIpAddresses('137.66.37.136'), }) } }