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

EngineLifecycleSupport when scanning AWS::RDS #31787

Open
1 task
Paul-J-Barrett opened this issue Oct 16, 2024 · 2 comments
Open
1 task

EngineLifecycleSupport when scanning AWS::RDS #31787

Paul-J-Barrett opened this issue Oct 16, 2024 · 2 comments
Labels
bug This issue is a bug. effort/medium Medium work item – several days of effort p1 toolkit/migrate Related to cdk migrate

Comments

@Paul-J-Barrett
Copy link

Describe the bug

When I run the following command I get an error about EngineLifecycleSupport
cdk migrate --language python --from-scan --stack-name cdkMigrateFromScan --filter resource-type-prefix="AWS::RDS::" --ignore-errors --debug --trace --verbose

Returns the following error

[14:48:14] CDK toolkit version: 2.162.1 (build 10aa526)
[14:48:14] Command line arguments: {
  _: [ 'migrate' ],
  language: 'python',
  l: 'python',
  'from-scan': '',
  fromScan: '',
  'stack-name': 'cdkMigrateFromScan',
  n: 'cdkMigrateFromScan',
  stackName: 'cdkMigrateFromScan',
  filter: [ 'resource-type-prefix=AWS::RDS::' ],
  'ignore-errors': true,
  ignoreErrors: true,
  debug: true,
  trace: true,
  verbose: 1,
  v: 1,
  lookups: true,
  json: false,
  j: false,
  ec2creds: undefined,
  i: undefined,
  'version-reporting': undefined,
  versionReporting: undefined,
  'path-metadata': undefined,
  pathMetadata: undefined,
  'asset-metadata': undefined,
  assetMetadata: undefined,
  'role-arn': undefined,
  r: undefined,
  roleArn: undefined,
  staging: true,
  'no-color': false,
  noColor: false,
  ci: false,
  '$0': '..\\..\\..\\AppData\\Roaming\\npm\\node_modules\\aws-cdk\\bin\\cdk'
}
[14:48:14] merged settings: {
  versionReporting: true,
  assetMetadata: true,
  pathMetadata: true,
  output: 'cdk.out',
  context: {},
  debug: true,
  language: 'python',
  toolkitBucket: {},
  staging: true,
  bundlingStacks: [],
  lookups: true
}
[14:48:15] Notices refreshed
[14:48:15] [trace] SdkProvider#withAwsCliCompatibleDefaults()
[14:48:15] Determining if we're on an EC2 instance.
[14:48:15] Does not look like an EC2 instance.
[14:48:15] Toolkit stack: CDKToolkit
This command is an experimental feature.
[14:48:15] [trace] SdkProvider#forEnvironment()
[14:48:15] [trace]   SdkProvider#resolveEnvironment()
[14:48:15] [trace]     SdkProvider#defaultAccount()
[14:48:15] [trace]       SdkProvider#defaultCredentials()
[14:48:15] Resolving default credentials
[14:48:15] [trace]       SDK#currentAccount()
[14:48:15] [trace]         SDK#forceCredentialRetrieval()
[14:48:15] Retrieved account ID 475716527515 from disk cache
[14:48:15] [trace]   SdkProvider#obtainBaseCredentials()
[14:48:15] [trace]     SdkProvider#defaultAccount()
[14:48:15] [trace]     SdkProvider#defaultCredentials()
[14:48:15] [trace]   SDK#validateCredentials()
[14:48:18] [trace] SDK#cloudFormation()
Using the latest successful scan which is 0 days, 1 hours, and 0 minutes old.
Applying filters to resource scan.
finding related resources.
Found 48 resources.
Generating CFN template from scanned resources.
Please wait, template creation in progress. This may take a couple minutes.
[CREATE_IN_PROGRESS] Template Creation in Progress
Template successfully generated!
 ❌  Migrate failed for `cdkMigrateFromScan`: CdkMigrateFromScanStack could not be generated because EngineLifecycleSupport is not a valid property for resource RDSDBInstance00||||REDACTED|||| of type AWS::RDS::DBInstance
[14:48:48] [trace] SdkProvider#forEnvironment()
[14:48:48] [trace]   SdkProvider#resolveEnvironment()
[14:48:48] [trace]     SdkProvider#defaultAccount()
[14:48:48] [trace]   SdkProvider#obtainBaseCredentials()
[14:48:48] [trace]     SdkProvider#defaultAccount()
[14:48:48] [trace]     SdkProvider#defaultCredentials()
[14:48:48] [trace]   SDK#validateCredentials()
[14:48:48] [trace] SDK#cloudFormation()
[14:48:48] [trace]   SDK#wrapServiceErrorHandling()
[14:48:48] Reading cached notices from ||||PATH REDACTED||||\.cdk\cache\notices.json
CdkMigrateFromScanStack could not be generated because EngineLifecycleSupport is not a valid property for resource RDSDBInstance00||||REDACTED|||| of type AWS::RDS::DBInstance
[14:48:48] Error: CdkMigrateFromScanStack could not be generated because EngineLifecycleSupport is not a valid property for resource RDSDBInstance00||||REDACTED|||| of type AWS::RDS::DBInstance
    at generateStack (||||PATH REDACTED||||\AppData\Roaming\npm\node_modules\aws-cdk\lib\commands\migrate.ts:89:11)
    at CdkToolkit.migrate (||||PATH REDACTED||||\AppData\Roaming\npm\node_modules\aws-cdk\lib\cdk-toolkit.ts:869:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at exec4 (||||PATH REDACTED||||\AppData\Roaming\npm\node_modules\aws-cdk\lib\cli.ts:454:12)

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

Create a migrated CDK project of an RDS Database.

Current Behavior

Fails with Error see above.

Reproduction Steps

Have an rds database with the option then try to create a migration with the command above.

Possible Solution

Do not fail on that property. I looked for it and can not find it in the Web Console so I can not remove it.

Additional Information/Context

No response

CDK CLI Version

2.162.1 (build 10aa526)

Framework Version

No response

Node.js Version

v20.18.0

OS

WIndows 11

Language

Python

Language Version

3.12.6

Other information

No response

@Paul-J-Barrett Paul-J-Barrett added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 16, 2024
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Oct 16, 2024
@xazhao xazhao assigned xazhao and unassigned xazhao Oct 16, 2024
@ashishdhingra ashishdhingra self-assigned this Oct 17, 2024
@ashishdhingra ashishdhingra added p1 needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 17, 2024
@ashishdhingra
Copy link
Contributor

Per CreateDBInstance, EngineLifecycleSupport:

This setting applies only to RDS for MySQL and RDS for PostgreSQL. For Amazon Aurora DB instances, the life cycle type is managed by the DB cluster.

You can use this setting to enroll your DB instance into Amazon RDS Extended Support. With RDS Extended Support, you can run the selected major engine version on your DB instance past the end of standard support for that engine version.

To reproduce the issue,

  • Create a new RDS instance for MySQL with Enable RDS Extended Support setting enabled.

  • Run cdk migrate --language python --from-scan new --stack-name cdkMigrateFromScan --filter resource-type-prefix="AWS::RDS::" --ignore-errors --debug --trace --verbose. This gives the below error:

    Starting new scan for account unknown-account in region unknown-region
    Resource scan in progress. Please wait, this can take 10 minutes or longer.
    [████████████████████████████] (100%)
    ✅ Scan Complete!
    Using the latest successful scan which is 0 days, 0 hours, and 4 minutes old.
    Applying filters to resource scan.
    finding related resources.
    Found 18 resources.
    Generating CFN template from scanned resources.
    Please wait, template creation in progress. This may take a couple minutes.
    [CREATE_IN_PROGRESS] Template Creation in Progress
    Template successfully generated!
     ❌  Migrate failed for `cdkMigrateFromScan`: CdkMigrateFromScanStack could not be generated because 
    EngineLifecycleSupport is not a valid property for resource RDSDBInstance00database100RdQZg of type AWS::RDS::DBInstance
    [11:26:34] [trace] SdkProvider#forEnvironment()
    [11:26:34] [trace]   SdkProvider#resolveEnvironment()
    [11:26:34] [trace]     SdkProvider#defaultAccount()
    [11:26:34] [trace]   SdkProvider#obtainBaseCredentials()
    [11:26:34] [trace]     SdkProvider#defaultAccount()
    [11:26:34] [trace]     SdkProvider#defaultCredentials()
    [11:26:34] [trace]   SDK#validateCredentials()
    [11:26:35] [trace] SDK#cloudFormation()
    [11:26:35] [trace]   SDK#wrapServiceErrorHandling()
    [11:26:35] Reading cached notices from /Users/ashdhin/.cdk/cache/notices.json
    CdkMigrateFromScanStack could not be generated because EngineLifecycleSupport is not a valid property for resource RDSDBInstance00database100RdQZg of type AWS::RDS::DBInstance
    [11:26:35] Error: CdkMigrateFromScanStack could not be generated because EngineLifecycleSupport is not a valid property for resource RDSDBInstance00database100RdQZg of type AWS::RDS::DBInstance
        at generateStack (/opt/homebrew/lib/node_modules/aws-cdk/lib/commands/migrate.ts:89:11)
        at CdkToolkit.migrate (/opt/homebrew/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:869:21)
        at processTicksAndRejections (node:internal/process/task_queues:105:5)
        at exec4 (/opt/homebrew/lib/node_modules/aws-cdk/lib/cli.ts:454:12)
    

It appears that error is thrown here during stack creation. generateStack() invokes cdk_from_cfn.transmute from cdklabs/cdk-from-cfn package.

@ashishdhingra ashishdhingra added effort/medium Medium work item – several days of effort toolkit/migrate Related to cdk migrate and removed needs-reproduction This issue needs reproduction. labels Oct 17, 2024
@ashishdhingra ashishdhingra removed their assignment Oct 17, 2024
@moelasmar moelasmar removed the @aws-cdk/aws-rds Related to Amazon Relational Database label Oct 18, 2024
@mattiuusitalo
Copy link

Same thing can be replicated on Ubuntu with CDK version 2.173.3, trying to generate typescript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/medium Medium work item – several days of effort p1 toolkit/migrate Related to cdk migrate
Projects
None yet
Development

No branches or pull requests

5 participants