aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.51k stars 3.85k forks source link

aws-cdk-lib.aws_redshiftserverless module - Query History Empty in the AWS Console #26773

Open entest-hai opened 1 year ago

entest-hai commented 1 year ago

Describe the bug

When creating an Amazon Redshift Serverless namespace and workgroup, the Query History in the AWS console is empty. This is the Query History in the AWS Console. However, when creating Amazon Serverless manually, the Query History in the AWS console is fully detailed information.

I think that when creating Redshift Serverelss by CDK or CloudFormation (L1 Construct), it does not enable monitoring query history from the AWS Console

Expected Behavior

Query History should show historical queries

Current Behavior

Query History is empty from the AWS Console

Reproduction Steps

Just create a simple Amazon Redshift Serverless like below

export class RedshiftServerlessStack extends Stack {
  constructor(scope: Construct, id: string, props: RedshiftServerlessProps) {
    super(scope, id, props);

    // security block this
    const namespace = new aws_redshiftserverless.CfnNamespace(
      this,
      "RedshiftNameSpace",
      {
        namespaceName: "demo",
        adminUsername: "admin",
        adminUserPassword: "Admin2023",
        dbName: "demo",
        defaultIamRoleArn: props.defaultRole.roleArn,
        iamRoles: props.roles.map((role) => role.roleArn),
        logExports: ["userlog", "connectionlog", "useractivitylog"],
      }
    );

    const workgroup = new aws_redshiftserverless.CfnWorkgroup(
      this,
      "RedshiftWorkGroup",
      {
        workgroupName: "demo",
        baseCapacity: 32,
        namespaceName: "demo",
        subnetIds: props.vpc.publicSubnets.map((subnet) => subnet.subnetId),
        publiclyAccessible: false,
        securityGroupIds: [props.sg.securityGroupId],
      }
    );

    workgroup.addDependency(namespace);
  }
}

Possible Solution

No response

Additional Information/Context

I do not know

CDK CLI Version

2.87.0

Framework Version

typescript

Node.js Version

v18.16.1

OS

Amazon 2023

Language

Typescript

Language Version

TypeScript 5.1.3

Other information

No response

pahud commented 1 year ago

I checked the CFN doc for AWS::RedshiftServerless::Namespace and AWS::RedshiftServerless::Workgroup but I can't find any relevant property for this configuration.

We probably need to make sure cloudformation does support that before we are allowed to use CDK L1 construct to enable that.

I assume this feature is probably not supported by CFN yet.