Open smnrd opened 1 year ago
You're right @smnrd, I can reproduce this. Thanks for the easily copy+pastable code!
Looking at the template, it's because it's trying to directly reference another resource as if it's in the same template. In other words, it's not making use of parameters which are how we handle cross-stack references.
"SourceMarkers": [
{
"<<marker:0xbaba:0>>": {
"Ref": "UserPool6BA7E5F2"
}
}
],
I believe the cause of this is due to this line of code where it makes the Stack.toJsonString()
call: https://github.com/aws/aws-cdk/blob/4c11af6067b35125781aa590bb33c7990078d1ed/packages/%40aws-cdk/aws-s3-deployment/lib/source.ts#L163
Hey! I wanted to check on this issue. I see the PR may be stalled out a bit. While waiting on that to resolve, is there a workaround that can be used? I attempted to use Fn.importValue and similar constructs, but wasn't having too much luck.
Thanks!
@cdanhowell see https://github.com/aws/aws-cdk/issues/19257#issuecomment-1102807097 for a workaround.
Multiple issues have been closed related to this issue, all of which reference this issue and to use the workaround. Is the root cause going to be addressed? this seems like a pretty common use case for Source.jsonData
...
I observed the same issue when adding source to BucketDeployment using the s3deploy.Source.data
directly. I'm trying to overwrite an env var in a js file for a react app based on api gateway api url. The api gateway is in a different stack. I also tried adding a temporary
output to the stack as part of which I want to deploy the file but using the output doesn't work either.
Describe the bug
I'm trying to use
S3Deployment
with aSource.jsonData
source to deploy a json configuration file with values resolved at deploy time (eg cognito userpool id). These values, properties of a construct from another nested stack passed as StackProp to the S3Deployment nested stack, doesn't get resolved properly.Expected Behavior
When I use values from another stack construct in a
Source.jsonData
source withS3Deployment
, they are properly resolved at deploy time.Current Behavior
A 'unresolved resource dependencies' error is thrown.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
1.180.0
Framework Version
No response
Node.js Version
14.19.0
OS
Debian GNU/Linux 10 (buster)
Language
Typescript
Language Version
4.4.2
Other information
No response