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.63k stars 3.91k forks source link

aws-cdk-lib: MSK Connectors update fails due to Invalid Request #28128

Closed AleX77NP closed 10 months ago

AleX77NP commented 11 months ago

Describe the bug

We are deploying MSK Connectors via AWS CDK Typescript library. Everything was working perfectly until 2 days ago. Suddenly, we started getting the following error:

"responseElements": { "Access-Control-Expose-Headers": "x-amzn-errortype,x-amzn-requestid,x-amzn-errormessage,x-amzn-trace-id,x-amz-apigw-id,date", "message": "Invalid parameter autoScaling: The specified parameter value is identical to the current value for the connector. Specify a different value, then try again." },

We were not changing anything related to autoScaling configuration, we were only updating some other properties, like: debezium table list.

Expected Behavior

cdk deploy is successful with updated MSK Connectors.

Current Behavior

cdk deploy fails due to mentioned error

Reproduction Steps

private createKafkaConnector(
        vpc: ec2.IVpc,
        config: Config,
        key: string,
        plugin: string,
        pluginRevision: number,
        roleArn: string,
        logGroup: string,
        connectorConfig: {
            [key: string]: string
        },
        cluster: string,
        version?: string
    ) {
        return {
            connectorDescription: `MSK ${key} connector for cluster ${cluster}`,
            capacity: {
                autoScaling: {
                    mcuCount: config.mskConnectorsConfig.mcuCount,
                    minWorkerCount: config.mskConnectorsConfig.workerCount,
                    maxWorkerCount: config.mskConnectorsConfig.workerCount + 1,
                    scaleInPolicy: {
                        cpuUtilizationPercentage: 20
                    },
                    scaleOutPolicy: {
                        cpuUtilizationPercentage: 80
                    }
                }
            },
            connectorConfiguration: connectorConfig,
            connectorName: `fdp-etb-${key}-connector-${version ? version : config.mskConnectorsConfig.connectorVersion}`,
            kafkaCluster: {
                apacheKafkaCluster: {
                    bootstrapServers: config.mskConnectorsConfig.kafkaBrokers,
                    vpc: {
                        securityGroups: config.mskConnectorsConfig.securityGroups,
                        subnets: vpc.privateSubnets.map(subnet => subnet.subnetId),
                    },
                },
            },
            kafkaClusterClientAuthentication: {
                authenticationType: 'IAM',
            },
            kafkaClusterEncryptionInTransit: {
                encryptionType: 'TLS',
            },
            kafkaConnectVersion: config.mskConnectorsConfig.kafkaConnectVersion,
            plugins: [{
                customPlugin: {
                    customPluginArn: plugin,
                    revision: pluginRevision ? pluginRevision : 1,
                },
            }],
            serviceExecutionRoleArn: roleArn,

            logDelivery: {
                workerLogDelivery: {
                    cloudWatchLogs: {
                        enabled: true,
                        // the properties below are optional
                        logGroup: logGroup,
                    },
                },
            },
        }
    }

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.110.0

Framework Version

v18.13.0

Node.js Version

v18.13.0

OS

Windows/Linux/MacOS

Language

TypeScript

Language Version

No response

Other information

Update works fine if we toggle autoScaling config, but this should not be required to update other properties.

pahud commented 11 months ago

Are you able to provide a full minimal reproducible code snippet we can deploy in our account? Looks like the provided code is just a private method and we will need a full deployable code before we can diagnose. Thank you.

github-actions[bot] commented 11 months ago

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.