Dan Van Brunt
10/12/2021, 3:15 PMthdxr
10/12/2021, 3:15 PMsst-env
more genericDan Van Brunt
10/12/2021, 3:16 PMDan Van Brunt
10/12/2021, 3:17 PMDan Van Brunt
10/12/2021, 3:19 PMthdxr
10/12/2021, 3:20 PMthdxr
10/12/2021, 3:20 PM.build
folder as jsonDan Van Brunt
10/12/2021, 3:20 PMDan Van Brunt
10/12/2021, 3:20 PMDan Van Brunt
10/12/2021, 3:21 PMDan Van Brunt
10/12/2021, 3:21 PMthdxr
10/12/2021, 3:22 PMthdxr
10/12/2021, 3:22 PMDan Van Brunt
10/12/2021, 3:24 PMDan Van Brunt
10/12/2021, 3:25 PM.build
thdxr
10/12/2021, 3:25 PM--outputs-file
thdxr
10/12/2021, 3:26 PMDan Van Brunt
10/12/2021, 3:30 PMDan Van Brunt
10/12/2021, 3:41 PMCamilo Bravo
10/12/2021, 3:45 PMDan Van Brunt
10/12/2021, 3:47 PMDan Van Brunt
10/12/2021, 3:56 PMthis.addOutputs()
from within my custom construct…. so I tried copying the source from sst.Stack
Dan Van Brunt
10/12/2021, 3:56 PMprivate addOutputs(outputs: { [key: string]: string | cdk.CfnOutputProps }): void {
Object.keys(outputs).forEach((key) => {
const value = outputs[key]
if (value === undefined) {
throw new Error(`The stack output "${key}" is undefined`)
} else if (typeof value === 'string') {
new cdk.CfnOutput(this, key, { value })
} else {
new cdk.CfnOutput(this, key, value)
}
})
}
Dan Van Brunt
10/12/2021, 3:57 PMconst stack = cdk.Stack.of(scope)
stack.addOutputs({
SERVICE: service,
STAGE: stage,
GIT_REPO,
GIT_BRANCH: stage,
SITE_URL: settings.siteUrl,
})
}
Dan Van Brunt
10/12/2021, 3:57 PMaddOutputs
is not part of stackDan Van Brunt
10/12/2021, 3:58 PM*cdk*.Stack
and not a *sst*.Stack
?thdxr
10/12/2021, 3:58 PMsst.Stack
which should workFrank
addOutputs
, those outputs won’t have hashes. The ones created by CDK automatically (values shared across stacks) have hashes.