Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. $ aws sts assume-role --role-arn arn:aws:iam::012345678901:role/accountb-role --role-session-name test
  2.  
  3. $ aws ec2 describe-instances --profile AccountB
  4.  
  5. 'aws_access_key_id'
  6.  
  7. [default]
  8. region = us-east-1
  9.  
  10. [profile AccountB]
  11. role_arn = arn:aws:iam::012345678901:role/accountb-role
  12.  
  13. {
  14. "Version": "2012-10-17",
  15. "Statement": [
  16. {
  17. "Effect": "Allow",
  18. "Principal": {
  19. "Service": "lambda.amazonaws.com"
  20. },
  21. "Action": "sts:AssumeRole"
  22. },
  23. {
  24. "Effect": "Allow",
  25. "Principal": {
  26. "AWS": "arn:aws:iam::012345678900:role/accounta-role"
  27. },
  28. "Action": "sts:AssumeRole"
  29. }
  30. ]
  31. }
  32.  
  33. {
  34. "Version": "2012-10-17",
  35. "Statement": [
  36. {
  37. "Sid": "Stmt1490625590000",
  38. "Effect": "Allow",
  39. "Action": [
  40. "sts:AssumeRole"
  41. ],
  42. "Resource": [
  43. "arn:aws:iam::012345678901:role/accountb-role"
  44. ]
  45. }
  46. ]
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement