Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

redshift: CfnCluster CreateCluster : Debug message #30619

Open
wtromano-aws opened this issue Jun 21, 2024 · 4 comments
Open

redshift: CfnCluster CreateCluster : Debug message #30619

wtromano-aws opened this issue Jun 21, 2024 · 4 comments
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources bug This issue is a bug. effort/small Small work item – less than a day of effort p3

Comments

@wtromano-aws
Copy link

wtromano-aws commented Jun 21, 2024

Describe the bug

Redshift cluster would not deploy, and the error message was "Error Message: Not Found Resource of type '%s' with identifier '%s' was not found". This led to a trial-and-error debug session that took some time. This issue asks to update this error messaging.

Expected Behavior

The condition should give a more descriptive error, such as:

ManageMasterPassword is false/not set and MasterUserPassword is not provided.

Current Behavior

HelloCdkStack | 0/3 | 12:50:14 PM | UPDATE_FAILED | AWS::Redshift::Cluster | DemoCfnCluster Resource handler returned message: "Cluster democlusterid5 Not Found Resource of type '%s' with identifier '%s' was not found." (RequestToken: ec18d1c3-6003-09e1-f260-5f747d4619c1, HandlerErrorCode: NotFound)

Reproduction Steps

CreateCluster

  • Do not provide MasterUserPassword
  • Do not provide ManageMasterPassword

Possible Solution

The condition should give a more descriptive error, such as:

ManageMasterPassword is false/not set and MasterUserPassword is not provided.

Additional Information/Context

N.A.

CDK CLI Version

2.142.1

Framework Version

2.142.1

Node.js Version

10.9.2

OS

MacOS

Language

TypeScript

Language Version

5.3.3

Other information

HelloCdkStack | 0/3 | 12:50:14 PM | UPDATE_FAILED | AWS::Redshift::Cluster | DemoCfnCluster Resource handler returned message: "Cluster democlusterid5 Not Found Resource of type '%s' with identifier '%s' was not found." (RequestToken: ec18d1c3-6003-09e1-f260-5f747d4619c1, HandlerErrorCode: NotFound)

"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "20.12.7",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"aws-cdk": "2.141.0",
"ts-node": "^10.9.2",
"typescript": "~5.4.5"
},
"dependencies": {
"aws-cdk-lib": "2.141.0",
"constructs": "^10.0.0",
"source-map-support": "^0.5.21"
}

@wtromano-aws wtromano-aws added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 21, 2024
@github-actions github-actions bot added the @aws-cdk/custom-resources Related to AWS CDK Custom Resources label Jun 21, 2024
@khushail khushail added needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 21, 2024
@khushail khushail self-assigned this Jun 21, 2024
@amcginn
Copy link

amcginn commented Jun 21, 2024

Here's a minimal Stack that produces this error. Uncommenting the manageMasterPassword prop successfully deploys the stack. Note, the VPC ID was removed here but should refer to an existing VPC.

import * as cdk from 'aws-cdk-lib';
import * as redshift from 'aws-cdk-lib/aws-redshift'
import { Construct } from 'constructs';
import * as ec2 from "aws-cdk-lib/aws-ec2";

export class HelloCdkStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const vpc = ec2.Vpc.fromLookup(this, `demo-vpc-lookup`, {
      vpcId: 'vpc-xxxx' // look up existing account VPC
    })

    const privateSubnetIds = vpc.privateSubnets.map((subnet) => subnet.subnetId)

    const subnetGroup = new redshift.CfnClusterSubnetGroup(this, `demosubnetgroup`, {
      description: 'Private subnets for the current environment\'s VPC',
      subnetIds: privateSubnetIds
    })

    new redshift.CfnCluster(this, 'DemoCfnCluster', {
      clusterType: 'single-node',
      dbName: 'demodbname',
      masterUsername: 'master-demo-username',
      nodeType: 'dc2.large',

      // the properties below are optional
      clusterSubnetGroupName: subnetGroup.attrClusterSubnetGroupName, // required to create cluster in VPC
      // manageMasterPassword: true, // must be set, since MasterUserPassword is not set
    });
  }
}

@pahud pahud changed the title CfnCluster:CreateCluster : Debug message redshift" CfnCluster CreateCluster : Debug message Jun 21, 2024
@pahud pahud changed the title redshift" CfnCluster CreateCluster : Debug message redshift: CfnCluster CreateCluster : Debug message Jun 21, 2024
@pahud
Copy link
Contributor

pahud commented Jun 21, 2024

redshift.CfnCluster is L1 construct which essentially synthesize AWS::Redshift::Cluster. The error message is from cloudformation, not CDK. I am afraid this is not something CDK can do.

Please help report this issue to https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues to help the cloudformation team prioritize. Thank you.

@pahud pahud added effort/small Small work item – less than a day of effort p3 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jun 21, 2024
@pahud
Copy link
Contributor

pahud commented Jun 21, 2024

internal tracking V1426176880

@pahud pahud removed the needs-reproduction This issue needs reproduction. label Jun 21, 2024
@amcginn
Copy link

amcginn commented Jun 21, 2024

If it's applicable, the L2 aws-redshift-alpha workflow produces the same error. It could be evaluated for defaulting the manageMasterPassword to true when the password itself isn't given.

@khushail khushail removed their assignment Jun 21, 2024
@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 22, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources bug This issue is a bug. effort/small Small work item – less than a day of effort p3
Projects
None yet
Development

No branches or pull requests

4 participants