Seth Geoghegan
10/21/2021, 9:27 PMsst remove
is failing to remove my stack with the message "construct does not have an associated node. All constructs must extend the "Construct" base class"Seth Geoghegan
10/21/2021, 9:28 PMSeth Geoghegan
10/21/2021, 9:28 PMError: construct does not have an associated node. All constructs must extend the "Construct" base class
at Function.of (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/constructs/src/construct.ts:21:13)
at _lookup (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/@aws-cdk/core/lib/stack.ts:91:27)
at Function.of (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/@aws-cdk/core/lib/stack.ts:76:21)
at Function.getValue (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/@aws-cdk/core/lib/context-provider.ts:60:25)
at Function.valueFromLookup (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/@aws-cdk/aws-ssm/lib/parameter.ts:212:35)
at Object.main (/Users/sgeoghegan/dev/knock-attribution-service/stacks/index.js:10:89)
at Object.<anonymous> (/Users/sgeoghegan/dev/knock-attribution-service/.build/run.js:93:16)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
There was an error synthesizing your app.
Seth Geoghegan
10/21/2021, 9:30 PM// index.js
import { StringParameter } from "@aws-cdk/aws-ssm";
export default function main(app) {
const ATTRIBUTION_DB: process.env.IS_LOCAL ? process.env.ATTRIBUTION_DB : StringParameter.valueFromLookup(this,process.env.ATTRIBUTION_DB)
// other stuff...
}
Ömer Toraman
10/21/2021, 9:37 PMÖmer Toraman
10/21/2021, 9:38 PMÖmer Toraman
10/21/2021, 9:39 PMthis
does not refer to the Construct in the function main, it is either undefined or the global objectÖmer Toraman
10/21/2021, 9:39 PMÖmer Toraman
10/21/2021, 9:39 PMStringParameter.valueFromLookup(app, process.env.ATTRIBUTION_DB)
Seth Geoghegan
10/21/2021, 10:46 PMSeth Geoghegan
10/21/2021, 10:46 PMÖmer Toraman
10/21/2021, 11:18 PMSeth Geoghegan
10/22/2021, 1:00 AMError: App at '' should be created in the scope of a Stack, but no Stack found
at _lookup (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/@aws-cdk/core/lib/stack.ts:93:15)
at Function.of (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/@aws-cdk/core/lib/stack.ts:76:21)
at Function.getValue (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/@aws-cdk/core/lib/context-provider.ts:60:25)
at Function.valueFromLookup (/Users/sgeoghegan/dev/knock-attribution-service/node_modules/@aws-cdk/aws-ssm/lib/parameter.ts:212:35)
at Object.main (/Users/sgeoghegan/dev/knock-attribution-service/stacks/index.js:9:89)
at Object.<anonymous> (/Users/sgeoghegan/dev/knock-attribution-service/.build/run.js:93:16)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
Seth Geoghegan
10/22/2021, 1:14 AM// Set default runtime for all functions
app.setDefaultFunctionProps((stack) =>({
runtime: "python3.8",
srcPath: "functions",
environment:{
ATTRIBUTION_DB: process.env.IS_LOCAL ? process.env.ATTRIBUTION_DB : StringParameter.valueFromLookup(stack,process.env.ATTRIBUTION_DB)
}
}));
Ömer Toraman
10/22/2021, 1:04 PMSeth Geoghegan
10/22/2021, 1:05 PMthis
parameter I was passing was not correct