-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws-s3-deployment: Source.jsonData
fails for certain types of deploy-time values
#25504
Comments
Thanks for your report. Can you share your content of |
And you are right. The addMarker() seems only support |
Thank you for the quick response! I'm not sure what you mean about the contents of If you want what Example CloudFormation JSON rejected by `Source.jsonData`
I added |
Also seeing this issue:
|
This comes from the following: let tg: ApplicationTargetGroup // Assume this is defined
const str = tg.firstLoadBalancerFullName + '/' + tg.targetGroupFullName Followed by then utilizing that |
Played around w/ my local copy of
to this:
and...it worked beautifully. The rendered value in the S3 object itself is 100% correct. Why have this condition at all? Perhaps either removing it, or adding |
Closes #25504 The reason for this change is to support more complex Cloudformation references used within `Source.data` in `aws-s3-deployment`. The objects today only support `Ref` or `Fn::GetAtt` Cfn references, which is limiting when it comes to attempting to manipulate Cfn references at deploy-time, such as via `Fn::Split` or `Fn::Select`. Many AWS CDK functions return tokens that must be evaluated using these complex Cfn functions (see [ApplicationTargetGroup's firstLoadBalancerFullName attribute](https://github.com/aws/aws-cdk/blob/3edd2400bc0c8a86366a29d3a7eef1ef4fa5e016/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts#L438)), but they are incompatible with `renderData`! This is a blocking issue for CDK projects which rely on generating S3 objects using `BucketDeployment`, wherein the rendered data is generated from native functions which utilize Cfn functions under-the-hood to dynamically construct values at deploy-time. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
Some types of deploy-time values cause
Source.jsonData
(and presumably the other deploy-time static methods forSource
) to fail since these deploy-time values contain CloudFormation functions other thanRef
orFn::Get
.For example, the
secretName
field on aSecret
becomes anFn::Join
function call which gets rejected bySource.jsonData
(seeReproduction Steps
for example code).Expected Behavior
For the rendered JSON file containing the secret ID to be deployed to the S3 bucket.
Current Behavior
For the code for reproducing the issue, I get this error:
Reproduction Steps
Possible Solution
No response
Additional Information/Context
Seems to be rejected by this code:
aws-cdk/packages/aws-cdk-lib/aws-s3-deployment/lib/render-data.ts
Lines 61 to 73 in dde8a4a
CDK CLI Version
2.75.0 (build 37c53d6)
Framework Version
No response
Node.js Version
18
OS
macOS
Language
Typescript
Language Version
TypeScript (4.9.5)
Other information
No response
The text was updated successfully, but these errors were encountered: