It looks like SST’s `.addOutputs` method publishes...
# sst
c
It looks like SST’s
.addOutputs
method publishes outputs without an
export name
value set – making the value inaccessible to
cdk.Fn.importValue
. Is there are way to add an export name to a SST created output or should you duplicate these via
cdk.CfnOutput
? I’m finding myself creating outputs via
.addOuputs
for consumption by other SST stacks within the same service and by
cdk.CfnOutput
for consumption by other Services’ stacks in the same account – which leads to duplicate outputs. Not a huge issue, but would be nice remove the duplication in the code and console if possible.
t
I've actually never fully understood outputs and export names
export names have to be globally unique?
but the key only has to be stack unique?
f
Yup, output is stack unique, export is globally unique within the same region
@Clayton you can give the output an export name like this https://docs.serverless-stack.com/constructs/Stack#adding-stack-exports
c
Yep - but it looks like output has to have an ‘export name’ value to be accessible to CDK import
Ah, cool - I’ll try that. Thanks @Frank