AWS Assume Role is a secure identity transfer mechanism that allows a trusted entity (such as an IAM user, EC2 instance, or external account) to temporarily obtain the permissions of a target role through STS (Security Token Service). The process is as follows:
Permission Policy Check
Trust Relationship Verification
Temporary Credential Generation
If the trust relationship verification passes, STS generates three-factor temporary credentials
{ "AccessKeyId": "***", "SecretAccessKey": "***", "SessionToken": "***" // Valid for 15 minutes to 12 hours }
Target Role Permission Verification
After configuration is complete, the Doris FE/BE processes automatically obtain the EC2 instance profile and perform the Assume Role operation to access the bucket. During capacity expansion, the BE node will automatically detect whether the new EC2 instance is successfully bound to the IAM role to prevent mismatches;
Doris's S3 Load, TVF, Export, Resource, Repository, Storage Vault, and other functions support the AWS Assume Role method in versions 3.0.6 and above. Connectivity checks will be performed when executing SQL-related functions:
CREATE REPOSITORY `s3_repo` WITH S3 ON LOCATION "s3://bucket/path/" PROPERTIES ( "s3.role_arn" = "arn:aws:iam::1234567890:role/doris-s3-role", "s3.external_id" = "doris-external-id", "timeout" = "3600" );
Where “s3.role_arn” corresponds to the IAM ID in AWS IAM Account2 In the ARN value for role2, “s3.external_id” corresponds to the externalId value configured in the Trust Relationships Policies (optional). For more detailed SQL statements, see: AWS authentication and authorization.