{"record":{"id":"bb1fc1240bbbf496","repo":"cube-js/cube","slug":"cubejs-db-redshift-cluster-identifier-is-required","errorCode":null,"errorMessage":"CUBEJS_DB_REDSHIFT_CLUSTER_IDENTIFIER is required for IAM authentication","messagePattern":"CUBEJS_DB_REDSHIFT_CLUSTER_IDENTIFIER is required for IAM authentication","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-redshift-driver/src/RedshiftIAMCredentialsProvider.ts","lineNumber":41,"sourceCode":"  protected readonly region: string;\n\n  protected readonly clusterIdentifier: string;\n\n  protected readonly dbName: string;\n\n  protected readonly awsCredentials?: ReturnType<typeof fromTemporaryCredentials>;\n\n  protected cached: CachedCredentials | null = null;\n\n  protected inflightRefresh: Promise<CachedCredentials> | null = null;\n\n  public constructor(options: RedshiftIAMCredentialProviderOptions) {\n    if (!options.region) {\n      throw new Error('CUBEJS_DB_REDSHIFT_AWS_REGION is required for IAM authentication');\n    }\n\n    if (!options.clusterIdentifier) {\n      throw new Error(\n        'CUBEJS_DB_REDSHIFT_CLUSTER_IDENTIFIER is required for IAM authentication'\n      );\n    }\n\n    if (!options.dbName) {\n      throw new Error(\n        'CUBEJS_DB_NAME is required for IAM authentication'\n      );\n    }\n\n    this.region = options.region;\n    this.clusterIdentifier = options.clusterIdentifier;\n    this.dbName = options.dbName;\n\n    if (options.assumeRoleArn) {\n      this.awsCredentials = fromTemporaryCredentials({\n        params: {\n          RoleArn: options.assumeRoleArn,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-redshift-driver/src/RedshiftIAMCredentialsProvider.ts#L23-L59","documentation":"AWS GetClusterCredentials needs the cluster identifier of the target Redshift cluster to mint temporary DB credentials. The provider throws this at construction time when options.clusterIdentifier is missing.","triggerScenarios":"new RedshiftIAMCredentialsProvider({...}) with region set but clusterIdentifier undefined — typically CUBEJS_DB_REDSHIFT_CLUSTER_IDENTIFIER unset while IAM auth is enabled.","commonSituations":"Switching from password auth to IAM auth without adding cluster identifier env; multiple dataSources where only one has the env var configured.","solutions":["Set CUBEJS_DB_REDSHIFT_CLUSTER_IDENTIFIER to the Redshift cluster id","Pass clusterIdentifier explicitly in RedshiftIAMCredentialProviderOptions","Confirm the cluster id matches the actual AWS Redshift cluster name"],"exampleFix":"// before\nCUBEJS_DB_REDSHIFT_AWS_REGION=us-east-1\n// after\nCUBEJS_DB_REDSHIFT_AWS_REGION=us-east-1\nCUBEJS_DB_REDSHIFT_CLUSTER_IDENTIFIER=my-redshift-cluster","handlingStrategy":"validation","validationCode":"if (!process.env.CUBEJS_DB_REDSHIFT_CLUSTER_IDENTIFIER) {\n  throw new Error('CUBEJS_DB_REDSHIFT_CLUSTER_IDENTIFIER must be set for IAM auth');\n}","typeGuard":"function hasClusterId(o: { clusterIdentifier?: string }): o is { clusterIdentifier: string } {\n  return typeof o.clusterIdentifier === 'string' && o.clusterIdentifier.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Keep a single checklist of IAM-auth env vars: region, cluster identifier, db name","Validate cluster identifier against the actual AWS console value","Check per-dataSource env overrides resolve for every environment"],"tags":["redshift","iam","configuration","missing-env-var"],"backgroundTag":"missing-env-var","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}