NodejsFunction is not available in custom resource. #10286
Labels
duplicate
If marked with duplicate, issue will be closed & original will be added for traceability
extensibility
Issues related to expand or customize current configuration
feature-request
Request a new feature
functions
Issues tied to the functions category
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Not applicable
Amplify Categories
Not applicable
Environment information
System:
OS: Linux 5.13 Zorin OS 16.1
CPU: (16) x64 AMD Ryzen 9 5900HS with Radeon Graphics
Memory: 2.43 GB / 15.04 GB
Container: Yes
Shell: 3.4.1 - /usr/bin/fish
Binaries:
Node: 16.6.1 - ~/.asdf/installs/nodejs/16.6.1/bin/node
Yarn: 1.22.17 - ~/.asdf/installs/nodejs/16.6.1/.npm/bin/yarn
npm: 7.20.3 - ~/.asdf/plugins/nodejs/shims/npm
Browsers:
Chrome: 100.0.4896.127
Firefox: 99.0
npmPackages:
@ampproject/toolbox-optimizer: undefined ()
@babel/core: undefined ()
@babel/runtime: 7.15.4
@hapi/accept: undefined ()
@napi-rs/triples: undefined ()
@next/bundle-analyzer: ^12.1.4 => 12.1.5
@next/react-dev-overlay: undefined ()
@next/react-refresh-utils: 12.1.5
@peculiar/webcrypto: undefined ()
@types/node: ^17.0.23 => 17.0.25
@types/react: ^17.0.44 => 17.0.44
@typescript-eslint/eslint-plugin: ^5.18.0 => 5.20.0
@typescript-eslint/parser: ^5.18.0 => 5.20.0 (5.10.1)
@vercel/nft: undefined ()
abort-controller: undefined ()
acorn: undefined ()
amphtml-validator: undefined ()
arg: undefined ()
assert: undefined ()
async-retry: undefined ()
async-sema: undefined ()
autoprefixer: ^10.4.4 => 10.4.4
babel-packages: undefined ()
browserify-zlib: undefined ()
browserslist: undefined ()
buffer: undefined ()
bytes: undefined ()
chalk: undefined ()
ci-info: undefined ()
cli-select: undefined ()
comment-json: undefined ()
compression: undefined ()
conf: undefined ()
constants-browserify: undefined ()
content-disposition: undefined ()
content-type: undefined ()
cookie: undefined ()
cross-env: ^7.0.3 => 7.0.3
cross-spawn: undefined ()
crypto-browserify: undefined ()
cssnano: ^5.1.7 => 5.1.7
cssnano-simple: undefined ()
debug: undefined ()
devalue: undefined ()
domain-browser: undefined ()
eslint: ^8.13.0 => 8.14.0
eslint-config-airbnb-base: ^15.0.0 => 15.0.0
eslint-config-airbnb-typescript: ^17.0.0 => 17.0.0
eslint-config-next: ^12.1.4 => 12.1.5
eslint-config-prettier: ^8.5.0 => 8.5.0
eslint-plugin-import: ^2.26.0 => 2.26.0 (2.25.2)
eslint-plugin-jsx-a11y: ^6.5.1 => 6.5.1
eslint-plugin-prettier: ^4.0.0 => 4.0.0
eslint-plugin-react: ^7.29.4 => 7.29.4 (7.29.1)
eslint-plugin-react-hooks: ^4.4.0 => 4.4.0 (4.3.0)
eslint-plugin-simple-import-sort: ^7.0.0 => 7.0.0
eslint-plugin-tailwindcss: ^3.5.0 => 3.5.0
eslint-plugin-unused-imports: ^2.0.0 => 2.0.0
etag: undefined ()
events: undefined ()
find-cache-dir: undefined ()
find-up: undefined ()
formdata-node: undefined ()
fresh: undefined ()
get-orientation: undefined ()
glob: undefined ()
gzip-size: undefined ()
http-proxy: undefined ()
https-browserify: undefined ()
husky: ^7.0.4 => 7.0.4
icss-utils: undefined ()
ignore-loader: undefined ()
image-size: undefined ()
is-animated: undefined ()
is-docker: undefined ()
is-wsl: undefined ()
jest-worker: undefined ()
json5: undefined ()
jsonwebtoken: undefined ()
lint-staged: ^12.3.7 => 12.4.0
loader-utils: undefined ()
lodash.curry: undefined ()
lru-cache: undefined ()
micromatch: undefined ()
mini-css-extract-plugin: undefined ()
nanoid: undefined ()
native-url: undefined ()
neo-async: undefined ()
next: ^12.1.4 => 12.1.5
next-seo: ^5.4.0 => 5.4.0
node-fetch: undefined ()
node-html-parser: undefined ()
npm-run-all: ^4.1.5 => 4.1.5
ora: undefined ()
os-browserify: undefined ()
p-limit: undefined ()
path-browserify: undefined ()
postcss: ^8.4.12 => 8.4.12 (8.4.5)
postcss-flexbugs-fixes: undefined ()
postcss-modules-extract-imports: undefined ()
postcss-modules-local-by-default: undefined ()
postcss-modules-scope: undefined ()
postcss-modules-values: undefined ()
postcss-preset-env: undefined ()
postcss-safe-parser: undefined ()
postcss-scss: undefined ()
postcss-value-parser: undefined ()
prettier: ^2.6.2 => 2.6.2
process: undefined ()
punycode: undefined ()
querystring-es3: undefined ()
raw-body: undefined ()
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-is: 17.0.2
react-refresh: 0.12.0
react-server-dom-webpack: undefined ()
regenerator-runtime: 0.13.4
rimraf: ^3.0.2 => 3.0.2
sass-loader: undefined ()
schema-utils: undefined ()
semver: undefined ()
send: undefined ()
setimmediate: undefined ()
source-map: undefined ()
stream-browserify: undefined ()
stream-http: undefined ()
string-hash: undefined ()
string_decoder: undefined ()
strip-ansi: undefined ()
tailwindcss: ^3.0.23 => 3.0.24
terser: undefined ()
text-table: undefined ()
timers-browserify: undefined ()
tty-browserify: undefined ()
typescript: ^4.6.3 => 4.6.3
ua-parser-js: undefined ()
unistore: undefined ()
use-subscription: undefined ()
util: undefined ()
uuid: undefined ()
vm-browserify: undefined ()
watchpack: undefined ()
web-streams-polyfill: undefined ()
web-vitals: undefined ()
webpack: undefined ()
webpack-sources: undefined ()
ws: undefined ()
npmGlobalPackages:
@ansible/ansible-language-server: 0.4.0-alpha.6
@aws-amplify/cli: 8.0.0
@interplay/cli-plugin-react: 2.0.8
@interplay/cli: 2.0.8
dynamodb-admin: 4.1.0
graphql-language-service-cli: 3.2.14
graphql: 16.3.0
intelephense: 1.8.2
terminalizer: 0.7.2
typescript: 4.6.2
Describe the bug
I want to create a Lambda with NodejsFunction in amplify's custom resource (CDK). But I can't complete it due to the following error
The following error is from cdk v2, but the same problem occurs with cdk v1
I got the same error when using Lambda and Asset.
I know I can do the same thing with amplify add function, but I want to use NodejsFunction for reusability and extensibility.
Expected behavior
Lambda is created correctly
Reproduction steps
Code Snippet
cdk-stack.ts
package.json
resource/lambda/src/index.js
resource/lambda/package.json
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: