Skip to content
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

(opensearch): Response object is too long from cloudformation when adding enough access policies despite the update succeeding. #29093

Open
wordlesstruth opened this issue Feb 13, 2024 · 3 comments
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package bug This issue is a bug. effort/medium Medium work item – several days of effort p3

Comments

@wordlesstruth
Copy link

Describe the bug

If you add enough access policies the response data from lambda is problematic.

The code is even aware of this limitation. However, clearly this is not sufficient.

We should be able to add policies that succeed in being updated on the domain by simply suppressing this data output.

    "Status": "SUCCESS",
    "Reason": "OK",
    "PhysicalResourceId": "blahAccessPolicy",
    "StackId": "arn:aws:cloudformation:us-west-2:blah:stack/blah-us-west-2/blah",
    "RequestId": "blah",
    "LogicalResourceId": "blahPolicy",
    "NoEcho": false,
    "Data": {
        "DomainConfig.AccessPolicies.Options": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":[\"blah.blah.blah.blah.blah.blah\",\"us-west-2.blah.blah.blah.blah.blah\"]},\"Action\":\"es:ESHttp*\",\"Resource\":[\"arn:aws:es:us-west-2:blah:domain/blah/\",\"arn:aws:es:us-west-2:blah:domain/blah/*\"],\"Condition\":{\"ArnEquals\":{\"aws:PrincipalArn\":\"arn:aws:iam::*:role/blah\"}}} <TRUNCATED FOR BREVITY>",
        "DomainConfig.AccessPolicies.Status.PendingDeletion": false,
        "DomainConfig.AccessPolicies.Status.State": "Processing",
        "DomainConfig.AccessPolicies.Status.UpdateVersion": 45
    }

Expected Behavior

Ability to add access policies up to opensearch limit, not cloudformation limits imposed by this custom resource.

Current Behavior

Failed cloudformation deployments.

UPDATE_FAILED | Response object is too long.

Reproduction Steps

Add enough access policies to an opensearch domain and try to deploy it via cdk.

Possible Solution

  • Ability to add a NoEcho to custom resource
  • Ability to disable output DomainConfig.AccessPolicies.Options

Additional Information/Context

No response

CDK CLI Version

2.126.0 (build fb74c41)

Framework Version

No response

Node.js Version

18

OS

AL2

Language

TypeScript

Language Version

No response

Other information

No response

@wordlesstruth wordlesstruth added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 13, 2024
@github-actions github-actions bot added the @aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package label Feb 13, 2024
@wordlesstruth
Copy link
Author

wordlesstruth commented Feb 14, 2024

I think I was able to workaround this by cloning this code and doing this myself: outputPaths: ['DomainConfig.AccessPolicies.Status'], note the deeper key of Status

@pahud
Copy link
Contributor

pahud commented Feb 14, 2024

Yes we can always workdaround this by outputPaths.

The code is aware of that but the payload is from custom resource and I believe CDK actually can't see and validate that in synth time.

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 14, 2024
@wordlesstruth
Copy link
Author

wordlesstruth commented Feb 14, 2024

Right, but I had to clone-and-own my own version to make this work - I'm wondering if it would be sufficient to merge in a change where you do go deeper one Key in the outputPaths ['DomainConfig.AccessPolicies.Status'] rather than ['DomainConfig.AccessPolicies'], or if anybody for some reason needs that Options key.. just give us the option to do something ourselves here.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 15, 2024
@pahud pahud added p3 and removed p2 labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package bug This issue is a bug. effort/medium Medium work item – several days of effort p3
Projects
None yet
Development

No branches or pull requests

2 participants