AWS Robomaker 错误:(AccessDeniedException)用户:arn:aws:iam...无权执行:robomaker:CreateSimulationJob

AWS Robomaker 错误:(AccessDeniedException)用户:arn:aws:iam...无权执行:robomaker:CreateSimulationJob

meta.stackexchange.com#141944建议可以在这里询问像我这样的“AWS + 个人使用”的问题,所以希望我在正确的网站上。

按照教程AWS Robomaker(aws.amazon.com)在“在 AWS RoboMaker 中使用容器创建并运行机器人和模拟应用程序”部分步骤 6 中,运行以下命令失败并出现错误(凭据已替换)。

我遗漏了什么/错了什么?我基本上是重新创建了这个 AWS 帐户,因此没有进行太多配置。

$ aws robomaker create-simulation-job --cli-input-json file://create_simulation_job.json

An error occurred (AccessDeniedException) when calling the CreateSimulationJob operation: User: arn:aws:iam::292945459999:user/fname.lname is not authorized to perform: robomaker:CreateSimulationJob on resource: arn:aws:robomaker:us-east-1:292945459999:simulation-application/robomaker-helloworld-sim-app/1675482941456
create_simulation_job.json 的内容

(由于教程中没有明确说明,我猜测从 Robomaker 上的 robomaker-helloworld-sim-app 模拟应用程序中获取“应用程序”的 ARN)

    "maxJobDurationInSeconds": 3600,
    "iamRole": "arn:aws:iam::292945459999:role/RoboMaker-HelloWorld-Role",
    "robotApplications": [
        {
            "application": "arn:aws:robomaker:us-east-1:292945459999:simulation-application/robomaker-helloworld-sim-app/1675482941456",
            "applicationVersion": "$LATEST",
            "launchConfig": {
                "environmentVariables": {
                    "ROS_IP": "ROBOMAKER_ROBOT_APP_IP",
                    "ROS_MASTER_URI": "http://ROBOMAKER_ROBOT_APP_IP:11311",
                    "GAZEBO_MASTER_URI": "http://ROBOMAKER_SIM_APP_IP:11345"
                },
                "streamUI": false,
                "command": [
                    "roslaunch", "hello_world_robot", "rotate.launch"
                ]
            },
            "tools": [
                {
                    "streamUI": true,
                    "name": "robot-terminal",
                    "command": "/entrypoint.sh && xfce4-terminal",
                    "streamOutputToCloudWatch": true,
                    "exitBehavior": "RESTART"
                }
            ]
        }
    ],
    "simulationApplications": [
        {
            "application": "arn:aws:robomaker:us-east-1:292945459999:simulation-application/robomaker-helloworld-sim-app/1675482941456",
            "launchConfig": {
                "environmentVariables": {
                  "ROS_IP": "ROBOMAKER_SIM_APP_IP",
                  "ROS_MASTER_URI": "http://ROBOMAKER_ROBOT_APP_IP:11311",
                  "GAZEBO_MASTER_URI": "http://ROBOMAKER_SIM_APP_IP:11345",
                  "TURTLEBOT3_MODEL":"waffle_pi"
                },
                "streamUI": true,
                "command": [
                    "roslaunch", "hello_world_simulation", "empty_world.launch"
                ]
            },
            "tools": [
                {
                    "streamUI": true,
                    "name": "gzclient",
                    "command": "/entrypoint.sh && gzclient",
                    "streamOutputToCloudWatch": true,
                    "exitBehavior": "RESTART"
                }
            ]
        }
    ]
}

IAM用户拥有以下权限:AdministratorAccess, AWSDeepRacerRoboMakerAccessPolicy, AWSRoboMaker_FullAccess

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:        20.04
Codename:       focal

$ aws --version
aws-cli/1.27.64 Python/3.8.10 Linux/5.4.0-137-generic botocore/1.29.64

答案1

自己解决了。

思考我忘了aws robomaker create-robot-application教程 (aws.amazon.com),因为我在“Robomaker -> 开发 -> 机器人应用程序”中没有看到机器人应用程序。所以我首先(重新)运行:

aws robomaker create-robot-application \
--name $robotapp \
--robot-software-suite name=General \
--environment uri=$ecruri/$robotapp:latest

然后create_simulation_job.json用 create-robot-application 刚刚返回的 ARN 替换文件中的 ARN,运行aws robomaker create-simulation-job命令并且这次通过了,我看到“Robomaker -> 模拟运行 -> 模拟作业”上的模拟作业,正如预期的那样。

在 OP 中的 create_simulation_job.json 中,有一件事明显是错误的:我传递了“sim app”的 ARN,而预期的是“robot app”(尽管错误消息没有清楚地说明这一点)。

    "robotApplications": [
        {
            "application": "arn:aws:robomaker:us-east-1:292945459999:simulation-application/robomaker-helloworld-sim-app/1675482941456",
    :

相关内容