rds: missing aurora postgresql static property versions
Describe the bug
missing static property for rds aurorapostgresengine ver_11_16 in cdk v1
Expected Behavior
available static property to support upgraded postgres aurora cluster
Current Behavior
unable to deploy any cdk changes because of lack of support for existing postgres aurora versions
Reproduction Steps
upgrade postgres aurora cluster to v11.16 upgrade version property in cdk (fails) use ver_11_15 (fails on deployment)
Possible Solution
I know v1 is no longer supported but tbh v1 deprecation and lack of support has been miserable as soon as it was announced with no upgrade path for quite a few people.
Additional Information/Context
No response
CDK CLI Version
1.181.1
Framework Version
No response
Node.js Version
v16
OS
ubuntu 22.04
Language
Python
Language Version
3.10.6
Other information
No response
attempt to specify static property VER_11_16:
AttributeError: type object 'AuroraPostgresEngineVersion' has no attribute 'VER_11_16'. Did you mean: 'VER_10_16'?
attempt to bypass with static prop VER_11_15
Resource handler returned message: "Cannot upgrade aurora-postgresql from 11.16 to 11.15 (Service: Rds, Status Code: 400, Request ID: 0350d535-029d-47cc-8e45-eeb658fa6a4b)" (RequestToken: 489b5973-3048-21e7-1a0e-1f3bf1429e72, HandlerErrorCode: InvalidRequest)
this is foobar every way you look at it. now that our aurora cluster has been upgraded there is now no way to downgrade or upgrade to a cdk v1 supported version. how unbelievably stupid.
@ekeyser you should be able to specify the engine version like this.
new rds.DatabaseCluster(this, 'Cluster', {
engine: rds.DatabaseClusterEngine.auroraPostgres({
version: rds.AuroraPostgresEngineVersion.of('11.16', '11', { s3Import: true, s3Export: true }),
})
})
Yes, the above should be a suitable solution for v1. Thanks Cory!
Like you addressed in the main post @ekeyser, this is because v1 is in maintenance mode and no longer receiving updates. I'm curious to know more about why the path to upgrade to v2 is blocked and if there's anything we can do to help or if there's any feedback we should keep in mind for when we release a next major version. This may be better to address in a new issue, so please submit one if you feel inclined to continue that discussion. Thanks!
Our project relies on AWS CodePipeline which is defined using CDK CdkPipelines which is abandoned (yes, deprecated at some point in v1, but really just abandoned) in cdk v2. That wouldn't be a problem - just convert to CodePipelines, right? Unfortunately, the IAM policies generated by the cdk CodePipelines construct exceed the 10K policy length limitation. In fact it's been just about 1 year exactly from when I opened my original ticket regarding this issue - so, predating the sun-setting of cdk v1 by 6 months. As far as I'm aware this issue has never been resolved although every couple of months I perform a test to see if any progress has been made or to see if I can get around it. We have 160+ lambda function assets in our stack.
There should be a way, or is a way, to specify a custom IAM role thereby bypassing cdk generating its own policy document but I've never been able to implement it successfully and the exact details are eluding me right this second. IIRC it has something to do with being able to specify your own IAM policy or role in CodePipeline but not in CodePipelines (yes, the naming of these constructs in unfortunate) - something about the role not cascading down to the pipieline itself or perhaps the role is for generating the pipeline not executing it. If pressed I could look it up again.
Why was CdkPipelines able to successfully generate an AWS CodePipeline CI/CD but CodePipelines isn't able to? Couldn't tell you but I'd be lying if I didn't say that has always struck me as quite odd. It's also a bit odd that the cdk team can't produce a solution. There have been a number of tickets regarding this issue and a few attempts at solutions but as far as I know this is still a problem. One thought is to split up the IAM policy into multiple policy documents. I know there's a 100K limit (or something) so I know this is perhaps not a universal solution. I suspect that really there's a much better solution which is to simply wildcard some policy statements or somehow combine them. The last time I looked at the generated policy document it was generating a full policy statement block for each individual asset instead of say, combining resources under a single policy statement block (assuming there is similarity to do so which I believe there is). That would probably save 50-70% right there. Throw in a wildcard maybe you get 99% savings. Anyway I digress. Bottom line - disappointed. But like I said maybe some progress has been made - haven't exactly had a lot of free time to check but maybe I will again during our slow down.
Not that it matters too much but for backstory this project was originally created by AWS Proserve as a monorepo - basically kitchen sink serverless repo with all lambda assets, and other infrastructure combined into a single CodePipeline. This work predates my time where I work. It's not a terrible design but ultimately I think the only way out of this mess is to split off the lambdas into its own stack but that is going to require a fairly significant effort. The monorepo concept is flawed especially when you factor in CI/CD execution time. I sort of think the whole CodePipeline offering is being crushed under its own weight - meaning its so slow and inefficient that it's become a pain to deploy anything. But again I digress.
And if you're going to ask me to contribute I've already expressed my opinions to skinny (I think that's his handle) about contributing effort to a $1 trillion company's product. :wink: And the org I work for is also not keen on the idea. I know you folks are underresourced (I'm assuming you're an AWS employee) so I sympathize but on some level I sort of had better expectations.
Hope that helps.
@ekeyser you should be able to specify the engine version like this.
new rds.DatabaseCluster(this, 'Cluster', { engine: rds.DatabaseClusterEngine.auroraPostgres({ version: rds.AuroraPostgresEngineVersion.of('11.16', '11', { s3Import: true, s3Export: true }), }) })
Thanks - I'll give this a try if I need to in the near future. Ultimately I ended up tearing down the rds cluster and reinserting it back, upgrading to 11.15, then rolling up the change into cdk. Thankfully this wasn't in prod. Yes, I shoud've looked in cdk to see what versions were allowed before performing the manual upgrade but something like this didn't even cross my mind as a potential hiccup.
Unfortunately, the IAM policies generated by the cdk CodePipelines construct exceed the 10K policy length limitation.
We have 160+ lambda function assets in our stack.
Try setting @aws-cdk/aws-iam:minimizePolicies to true in cdk.json, and publishAssetsInParallel: false as property to the v2 CDK Pipeline. That should help you get over the IAM policy size hump (if that's all that's preventing you from moving to the modern CDK Pipelines API, and hence v2).
Unfortunately, the IAM policies generated by the cdk CodePipelines construct exceed the 10K policy length limitation.
We have 160+ lambda function assets in our stack.
Try setting @aws-cdk/aws-iam:minimizePolicies to
trueincdk.json, andpublishAssetsInParallel: falseas property to the v2 CDK Pipeline. That should help you get over the IAM policy size hump (if that's all that's preventing you from moving to the modern CDK Pipelines API, and hence v2).
minimizePolicies is already true. I'll try publishAssetsInParallel sometime this month. Does that impact policy size or is that for pipeline performance?
Confirmed that publish_assets_in_parallel=False resolves the policy size issue. Now I just have to test that nothing will break our or replace our pipeline in production. Once that is complete it looks like there is a path to cdk v2 for us.
If that's the case then hopefully switching to cdk v2 also won't negatively impact our existing production pipeline.
The conversation here has drifted from the initial post - the initial post being cleared up at this point. If you still have further questions regarding the discussion that's taken place, please open up a discussion that cites this issue. Thanks!
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.