UUID v4, v7, ULID y NanoID — 100% client-side, ningún ID se almacena
122 bits aleatorios — uso general
External ID generado
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::ACCOUNT_ID:root"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": ""
}
}
}
]
}import boto3
sts = boto3.client('sts')
response = sts.assume_role(
RoleArn='arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME',
RoleSessionName='my-session',
ExternalId='',
)
credentials = response['Credentials']El External ID protege contra el confused deputy problem. Generá uno único por cliente/integración y almacenalo en Secrets Manager o Parameter Store.
UUID v4
122 bits aleatorios — uso general
UUID v7
Timestamp + random — ideal para DB keys
ULID
Lexicográficamente ordenable, Crockford Base32
NanoID
URL-safe, compacto, 126 bits efectivos