-
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
Response limit of 4k for CloudFormation Custom Resources #2825
Response limit of 4k for CloudFormation Custom Resources #2825
Comments
Can you detail your use case ? |
I ran into the 4k Custom Resource response limit when creating ECS services. Namely, updates to ECS services return an events key that contains potentially quite a bit of data. I had to go back to my own Lambda to prune out the data before responding to CloudFormation. Some way to automatically resolve that issue, or specify only what data I want to return to CloudFormation would help here. |
…esource Specifying `outputPath` allows to restrict the data returned by the custom resource to a specific path in the API response. This can be used to limit the data returned by the custom resource if working with API calls that could potentially result in custom respone objects exceeding the hard limit of 4096 bytes. Closes aws#2825
…esource (#2859) Specifying `outputPath` allows to restrict the data returned by the custom resource to a specific path in the API response. This can be used to limit the data returned by the custom resource if working with API calls that could potentially result in custom respone objects exceeding the hard limit of 4096 bytes. Closes #2825
The AWS CLI provides a --query parameter for doing this - might be of use: Example in EC2 Describe Instances Note: i'm suffering from the same issue. |
Can the implementation be extended to support several output paths - currently it is startsWith check as far as I can see in the commit, which is quite limiting. Example describeDBInstances, where one needs to get several parameters. At the moment DBInstances.0 is already too long :-( |
Would |
yes, this will perfectly suit me |
…of paths It was already possible to restrict to a single path. Add option to restrict to multiple paths and deprecate the single path option. Also document this option. See aws#2825 (comment)
FYI, I ran into a similar error message but it was due to an error in my helm chart where the resulting error message was too big for Lambda to return. Looking at the Lambda logs showed the specific error message. |
…of paths (#14041) It was already possible to restrict to a single path. Add option to restrict to multiple paths and deprecate the single path option. Also document this option in the README. See #2825 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…of paths (aws#14041) It was already possible to restrict to a single path. Add option to restrict to multiple paths and deprecate the single path option. Also document this option in the README. See aws#2825 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This shamefully took me 11 attempts to get right so here's a working example to save others that come across this const cr = new AwsCustomResource(this, "EC2InstancePrivateIPv6", {
onCreate: {
service: "EC2",
action: "describeInstances",
physicalResourceId: PhysicalResourceId.of(`${db.instanceId}-ipv6`),
parameters: {
InstanceIds: [db.instanceId],
},
outputPaths: ["Reservations.0.Instances.0.NetworkInterfaces.0.Ipv6Addresses.0.Ipv6Address"],
},
policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE }),
});
const ipv6Address = cr.getResponseField("Reservations.0.Instances.0.NetworkInterfaces.0.Ipv6Addresses.0.Ipv6Address");
new AaaaRecord(this, "IPv6Record", {
zone: privateZone,
recordName: "pg",
target: RecordTarget.fromIpAddresses(ipv6Address),
}); It turned out I was assuming the response would be return like an API call |
I'm facing this right now with |
I am getting the issue too when trying to deploy...
|
Can someone explain the solution differently? I don't see where the fix is... how do you see the response size? How do you know what to enter for outputPaths value?
|
I'm in same boat here. Took me an evening of debugging as there is no easy way to |
Using the
AwsCustomResource
construct to easily pass in SDK calls is very useful. Some service calls however have a large response body and lead toResponse object is too long.
in their CloudFormation response.It would be nice to have a conditional to check for that and truncate, or more ideally, have a property to control what output goes into the response body, similar to how
physicalResourceIdPath
works.The text was updated successfully, but these errors were encountered: