Skip to content

branch-4.1: [feature](RoutineLoad) Support RoutineLoad IAM auth #61324 - #62245

Merged
yiguolei merged 1 commit into
branch-4.1from
auto-pick-61324-branch-4.1
Apr 9, 2026
Merged

branch-4.1: [feature](RoutineLoad) Support RoutineLoad IAM auth #61324#62245
yiguolei merged 1 commit into
branch-4.1from
auto-pick-61324-branch-4.1

Conversation

@github-actions

@github-actions github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Cherry-picked from #61324

### What problem does this PR solve?
**_Overview_**:
This PR adds AWS MSK IAM authentication for Kafka Routine Load in Apache
Doris. You can connect to Amazon MSK using IAM credentials (including
Assume Role and cross-account) with SASL_SSL and OAUTHBEARER.

**_What It Solves_**:
1. Consume AWS MSK data from Doris via Routine Load.
2. Support three credential modes: explicit AK/SK, same-account Instance
Profile Assume Role, and cross-account AK/SK Assume Role.
3. Align with AWS MSK IAM (SigV4-signed OAUTHBEARER tokens).

**_SQL Examples_**
1. MSK IAM with explicit Access Key and Secret Key (same account)
```
CREATE ROUTINE LOAD my_msk_load ON my_db.my_table
COLUMNS (id, name, dt)
PROPERTIES (
    "desired_concurrent_number" = "2",
    "max_error_number" = "1000"
)
FROM KAFKA
(
    "kafka_broker_list" = "b-1.xxx.kafka.us-east-1.amazonaws.com:9098,b-2.xxx.kafka.us-east-1.amazonaws.com:9098",
    "kafka_topic" = "my-topic",
    "property.security.protocol" = "SASL_SSL",
    "property.sasl.mechanism" = "OAUTHBEARER",
    "aws.region" = "us-east-1",
    "aws.access_key" = "XXX",
    "aws.secret_key" = "XXX"
);
```

2. MSK IAM with Assume Role (e.g. EC2 Instance Profile, same account)
```
CREATE ROUTINE LOAD my_msk_load ON my_db.my_table
COLUMNS (id, name, dt)
PROPERTIES (
    "desired_concurrent_number" = "2"
)
FROM KAFKA
(
    "kafka_broker_list" = "b-1.xxx.kafka.us-east-1.amazonaws.com:9098",
    "kafka_topic" = "my-topic",
    "property.security.protocol" = "SASL_SSL",
    "property.sasl.mechanism" = "OAUTHBEARER",
    "aws.region" = "us-east-1",
    "aws.credentials_provider" = "xxx",
    "aws.role_arn" = "arn:aws:iam::123456789012:role/MyMSKConsumerRole"
);
```

3. MSK IAM with cross-account Assume Role (AK/SK of account B to assume
role in account A)
```
CREATE ROUTINE LOAD my_msk_load ON my_db.my_table
COLUMNS (id, name, dt)
PROPERTIES (
    "desired_concurrent_number" = "2"
)
FROM KAFKA
(
    "kafka_broker_list" = "b-1.xxx.kafka.us-east-1.amazonaws.com:9098",
    "kafka_topic" = "my-topic",
    "property.security.protocol" = "SASL_SSL",
    "property.sasl.mechanism" = "OAUTHBEARER",

    "aws.region" = "us-east-1",
    "aws.role_arn" = "arn:aws:iam::111111111111:role/CrossAccountMSKRole",
    "aws.access_key" = "XXX",
    "aws.secret_key" = "XXX"
);
```

Validation rules (FE): When any aws.* property is set, aws.region is
required, and property.security.protocol must be SASL_SSL and
property.sasl.mechanism must be OAUTHBEARER. If you use explicit
credentials, both aws.access.key and aws.secret.key must be set
together.

doc pr:apache/doris-website#3520
@github-actions
github-actions Bot requested a review from yiguolei as a code owner April 8, 2026 12:26
@Thearas

Thearas commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring closed this Apr 8, 2026
@dataroaring dataroaring reopened this Apr 8, 2026
@Thearas

Thearas commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 36.34% (129/355) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.00% (19853/37460)
Line Coverage 36.50% (186794/511758)
Region Coverage 32.83% (145079/441896)
Branch Coverage 33.95% (63566/187210)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 36.90% (131/355) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.42% (26189/36668)
Line Coverage 54.27% (276813/510061)
Region Coverage 51.45% (229385/445860)
Branch Coverage 52.94% (99390/187740)

@yiguolei
yiguolei merged commit 4fc6733 into branch-4.1 Apr 9, 2026
25 of 29 checks passed
@morningman
morningman deleted the auto-pick-61324-branch-4.1 branch July 8, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants