calm-article-62769
11/10/2025, 12:27 PMtall-airline-16756
11/10/2025, 12:27 PMtall-airline-16756
11/10/2025, 12:27 PMassume_role_arn field in your S3 upload settings. This lets LiveKit assume a specific role through the AssumeRole API. To add an extra layer of security, you can also include the assume_role_external_id parameter for verification.
Here’s a quick example of how your configuration might look:
storage:
s3:
assume_role_arn: "arn:aws:iam::123456789012:role/LiveKitEgressRole"
assume_role_external_id: "your-external-id" # optional, if required by your role
region: "" # leave empty to use IAM role
bucket: "your-bucket-name"
Just a heads-up: on LiveKit Cloud, IAM Role-based authentication is available only if this feature has been enabled for your account. If you’d like, I’m here to help you with this setup or answer any questions you might have!
Sources: livekit/livekit_egress.pb.go | pkg/config/base.gocalm-article-62769
11/10/2025, 12:29 PMtall-airline-16756
11/10/2025, 12:30 PMS3Upload section by adding the assume_role_arn field. This change lets LiveKit securely assume the specified IAM role for your S3 uploads.
Here’s a friendly example to guide you:
req = api.RoomCompositeEgressRequest(
room_name=ctx.room.name,
layout="speaker",
preset=api.EncodingOptionsPreset.H264_720P_30,
audio_only=False,
file_outputs=[
api.EncodedFileOutput(
file_type=api.EncodedFileType.MP4,
filepath="livekit-poc-data/recordings/recording-{room_name}-{time}.mp4",
s3=api.S3Upload(
access_key=os.getenv("AWS_ACCESS_KEY_ID"), # Key with sts:AssumeRole permission
secret=os.getenv("AWS_SECRET_ACCESS_KEY"), # Secret for the above key
assume_role_arn="arn:aws:iam::123456789012:role/LiveKitEgressRole", # IAM Role ARN
assume_role_external_id="your-external-id", # Optional, if required by the role
region=os.getenv("AWS_REGION"),
bucket=os.getenv("AWS_BUCKET_NAME"),
),
)
],
)
Just a quick note: please make sure the IAM role’s trust policy permits the credentials you provide to assume the role, and that the role has the right S3 permissions like s3:PutObject and s3:PutObjectAcl.
If you have any questions or want me to walk you through any part of this, feel free to ask—I’m here to help!
Sources: livekit/livekit_egress.pb.go | pkg/config/base.go