$ aws s3 rb s3://niikawa-2024
remove_bucket failed: s3://niikawa-2024 An error occurred (AccessDenied) when calling the DeleteBucket operation: Access Denied
$ aws s3 rb s3://niikawa-2024 --force
delete: s3://niikawa-2024/TESTDATA
remove_bucket failed: s3://niikawa-2024 An error occurred (AccessDenied) when calling the DeleteBucket operation: Access Denied
もちろん、s3 以外の権限もありません。想定通りの動作を確認しました。
$ aws iam list-users
An error occurred (AccessDenied) when calling the ListUsers operation: User: arn:aws:sts::111111111111:assumed-role/niikawa-test-role-ec2/i-0ab1234567890cdef is not authorized to perform: iam:ListUsers on resource: arn:aws:iam::111111111111:user/ because no identity-based policy allows the iam:ListUsers action
$ aws ec2 describe-instances --region ap-northeast-1
An error occurred (UnauthorizedOperation) when calling the DescribeInstances operation: You are not authorized to perform this operation. User: arn:aws:sts::111111111111:assumed-role/niikawa-test-role-ec2/i-0ab1234567890cdef is not authorized to perform: ec2:DescribeInstances because no identity-based policy allows the ec2:DescribeInstances action