Type : cloudfront.ICachePolicy, defaults to created using lambdaCachePolicyPropsĬloudFront cache policy for NextjsSiteCdkDistributionProps Type : cloudfront.ICachePolicy, defaults to created using imageCachePolicyPropsĬloudFront cache policy for images. Type : cloudfront.ICachePolicy, defaults to created using staticCachePolicyPropsĬloudFront cache policy for static pages. NextjsSiteCachePolicyProps staticCachePolicy? permissions? Īttaches the given list of permissions to the function. The amount of memory in MB allocated to this Lambda function. Lambda function execution timeout in seconds. Set this option if the domain is not hosted on Amazon Route 53. Set this option if you have an existing certificate in the us-east-1 region in AWS Certificate Manager you want to use. Virginia) region as required by AWS CloudFront. The certificate will be created in the us-east-1(N. By default, SST will create a certificate with the domain name from the domainName option. Set this option if SST cannot find the hosted zone in Route 53. By default, SST will look for a hosted zone matching the domainName that's passed in. Takes the name of the hosted zone as a string or the hosted zone construct. The hosted zone in Route 53 that contains the domain. Type : string |, defaults to the domain name Visitors to the alias will be redirected to the main domain. Type : string, defaults to no alias configuredĪn alternative domain to be assigned to the website URL. Supports domains that are hosted either on Route 53 or externally. The domain to be assigned to the website URL (ie. This is to ensure that the site content remains unchanged, and subsequent sst start can start up quickly. When running sst start, a placeholder site is deployed. That'll skip waiting for the cache to invalidate and speed up the deploy process. For non-prod environments it might make sense to pass in false. However, this process can sometimes take more than 5 mins. This ensures that the new content will be served once the deploy command finishes. While deploying, SST waits for the CloudFront cache invalidation process to finish. The default function props to be applied to all the Lambda Functions created by this construct. Type: NextjsSiteFunctionProps, defaults to Pass in a value to override the default settings this construct uses to create the CDK Queue internally. Pass in a NextjsSiteCachePolicyProps value to override the default CloudFront cache policies created internally. Pass in a NextjsSiteCdkDistributionProps value to override the default settings this construct uses to create the CDK Distribution internally. Pass in a value to override the default settings this construct uses to create the CDK Bucket internally. Methods Īn instance of NextjsSite contains the following methods. The internally created CDK Queue instance. The AWS Certificate Manager certificate for the custom domain. The Route 53 hosted zone for the custom domain. The internally created CDK Distribution instance. The internally created CDK Bucket instance. The domain name of the internally created CDK Distribution instance. The ID of the internally created CDK Distribution instance. The name of the internally created CDK Bucket instance. The ARN of the internally created CDK Bucket instance. If the custom domain is enabled, this is the URL of the website with the custom domain. The default CloudFront cache policy properties for url The default CloudFront cache policy properties for images. The default CloudFront cache policy properties for static pages. lambdaCachePolicyProps ) ,Īn instance of NextjsSite contains the following properties. CachePolicy ( this, "LambdaCache", NextjsSite. CachePolicy ( this, "ImageCache", NextjsSite. CachePolicy ( this, "StaticCache", NextjsSite. Import * as cloudfront from "aws-cdk-lib/aws-cloudfront"