New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic token exports can not be arrays #5897
Comments
Hi @nunezro2, thanks for submitting an issue. In order to have a better understanding of what the problem is we need a bit more information. Could you edit the original post and fill out the template as much as possible. Thanks! |
Looks like the bug report is that Closing until we get a repro. |
I can report the same issue with InterfaceVpcEndpoint in one stack I have:
Then the output of that stack is: "Outputs": {
"ExportsOutputFnGetAttsapgatewayvpcendpoint99C0B197DnsEntriesC7F2A387": {
"Value": {
"Fn::GetAtt": [
"sapgatewayvpcendpoint99C0B197",
"DnsEntries"
]
},
"Export": {
"Name": "SAPGatewayProxyEndpointClient:ExportsOutputFnGetAttsapgatewayvpcendpoint99C0B197DnsEntriesC7F2A387"
}
}
} And then Fn::Split happens at the "consumption" stack {
"Name":"HOST",
"Value":{
"Fn::Join":[
"",
[
{
"Fn::Select":[
0,
{
"Fn::ImportValue":"SAPGatewayProxyEndpointClient:ExportsOutputFnGetAttsapgatewayvpcendpoint99C0B197DnsEntriesC7F2A387"
}
]
},
"}:443"
]
]
}
},` |
I have experience the same issue had had to create my own way around it (not ideal :P) @SomayaB and @rix0rrr you asked about example code, here it is (https://github.com/timpur/aws-cdk-issue-5897/blob/master/cdk.out/Stack1.template.json#L18). Very basic stack but produces the issue. Seems the select happens in the consumer which is fine bout the generated output doesnt account for refs that are arrays of strings .... I imagine is something to do with this line (https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/core/lib/private/refs.ts#L183) Thanks. Hopes this helps |
Oh yes I see what's going on now. You do the select in the other stack. Overlooked it the first time around, sorry. Not even sure if we have enough information at runtime to properly encode this, but we can see. The solution will have to look like:
Question is, do we have enough information to detect the token type when this link is being established? |
I've just found this same error when passing a VPC object as parameter between two stacks: if an InterfaceEndpoint is defined in the VPC one output (with DnsEntries) is created and the failure appears. |
I also have found the same error. In my case I am passing ICluster interface between stack, the CDK magic then create the following output:
eksMasterSubnetIds is a CfnParameter which type is CommaDelimitedList. |
@diegofd Were you able to fix this, I faced the exact same issue. |
I worked around this by manually exporting it my self correctly and importing it .... sad |
@diegofd @timpur I found this: https://stackoverflow.com/a/57803822 |
@timpur Any chance you (or someone) could share a code snippet that demonstrates what you mean by this? Still struggling with this issue... |
@soynog you can try something like this, manual export and import with a little bit of magic. |
This worked for me! Thanks so much for the help @eugensclifos |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Would be ideal if the manual workaround wasn't needed. |
Fixed by #22873. |
|
Reproduction Steps
Add the following to your stack:
Fn.select(0, vpcEndpoint.vpcEndpointDnsEntries)
It generates the following which is incorrect since DnsEntries are a string
Error Log
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: