Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

322
Vistas
AWS cli: not authorized to perform: sts:AssumeRole on resource

I have an AWS account in which I am assuming a role named A(role-A), from that role I have created another role named B(role-B) through the web console and attached the administrator policy to that role

Here is cli configuration

[default]
aws_access_key_id = <>
aws_secret_access_key = <>
region = eu-central-1

[role-B]
role_arn = arn:aws:iam::<id>:role/ics-role
mfa_serial = arn:aws:iam::<id>:mfa/<name>
external_id = <name>
source_profile = default

role-B which I have created from role-A

When i try to get the role details

aws --profile role-B sts get-caller-identity

I am getting the following error

An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:iam::<>:user/<> is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::<>:role/ics-role

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You'll need to check the trust relationship policy document of the iam role to confirm that your user is in it.

Additionally make sure that the iam user has explicit permissions allowing them to assume that role.

The trust relationship should look something like this:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": [
          "arn:aws:iam::1234567890:user/person"
        ]
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
over 4 years ago · Santiago Trujillo Denunciar

0

My issue was I had a condition set in the policy json.

{
    "Version": "2012-10-17",
    "Statement": [{
        "Effect": "Allow",
        "Principal": {
            "AWS": "arn:aws:iam::000000000:dave"
        },
        "Action": "sts:AssumeRole",
        "Condition": {
           // Condition set here
        }
    }]
}

I removed the condition and it works now no issues.

{
    "Version": "2012-10-17",
    "Statement": [{
        "Effect": "Allow",
        "Principal": {
            "AWS": "arn:aws:iam::000000000:dave"
        },
        "Action": "sts:AssumeRole"
    }]
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda