Excited about this project! #12
coltenkrauter
started this conversation in
General
Replies: 1 comment 1 reply
-
Let me also say... I am impressed that this worked so well. I added this to my CDK app, import type { StackProps } from 'aws-cdk-lib'
import type { Construct } from 'constructs'
import { Stack } from 'aws-cdk-lib'
import { NextjsGlobalFunctions } from 'cdk-nextjs'
import { fileURLToPath } from 'node:url'
import type { Config } from '../../defaults.js'
interface WebStackProps extends StackProps {
config: Config
}
export class WebStack extends Stack {
constructor(scope: Construct, id: string, props: WebStackProps) {
super(scope, id, props)
const { config } = props
const { prefix } = config
const nextConstruct = new NextjsGlobalFunctions(this, prefix('Nextjs'), {
buildContext: fileURLToPath(new URL('../../../../next', import.meta.url)),
healthCheckPath: '/api/health',
})
nextConstruct.nextjsFunctions.function.addEnvironment('NEXT_TELEMETRY_DISABLED', '1')
}
} And it just worked. The only minor thing I ran into was that the repository that holds my NextJs app did not have a public directory, and that caused issues during the docker build. After I added a public dir, the entire thing was successfully deployed. Bravo 👏🏻 👏🏻 👏🏻 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've come darn close to making a similar package. Over the last 4 years, it has been challenging to find a solid NextJs implementation for AWS that is built using CDK.
Great work on this. I'm certainly gonna try it out.
Beta Was this translation helpful? Give feedback.
All reactions