View a markdown version of this page

Paso 1: Crea el AWS IoT policy - AWS IoT Core

Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.

Paso 1: Crea el AWS IoT policy

Cree una AWS IoT política que permita a su Raspberry Pi conectarse y enviar mensajes a AWS IoT.

  1. En la consola de AWS IoT, si aparece un botón Empezar, elíjalo. De lo contrario, en el panel de navegación, expanda Seguridad y, a continuación, elija Políticas.

  2. Si aparece el cuadro de diálogo Aún no tiene ninguna política, elija Crear una política. De lo contrario, seleccione Crear.

  3. Ingresa un nombre para la AWS IoT política (por ejemplo,MoistureSensorPolicy).

  4. En la sección Añadir instrucciones, sustituya la política existente por el siguiente JSON. Sustituya region y account por su Cuenta de AWS número Región de AWS y.

    { "Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iot:Connect", "Resource": "arn:aws:iot:us-east-1:123456789012:client/RaspberryPi" }, { "Effect": "Allow", "Action": "iot:Publish", "Resource": [ "arn:aws:iot:us-east-1:123456789012:topic/$aws/things/RaspberryPi/shadow/update", "arn:aws:iot:us-east-1:123456789012:topic/$aws/things/RaspberryPi/shadow/delete", "arn:aws:iot:us-east-1:123456789012:topic/$aws/things/RaspberryPi/shadow/get" ] }, { "Effect": "Allow", "Action": "iot:Receive", "Resource": [ "arn:aws:iot:us-east-1:123456789012:topic/$aws/things/RaspberryPi/shadow/update/accepted", "arn:aws:iot:us-east-1:123456789012:topic/$aws/things/RaspberryPi/shadow/delete/accepted", "arn:aws:iot:us-east-1:123456789012:topic/$aws/things/RaspberryPi/shadow/get/accepted", "arn:aws:iot:us-east-1:123456789012:topic/$aws/things/RaspberryPi/shadow/update/rejected", "arn:aws:iot:us-east-1:123456789012:topic/$aws/things/RaspberryPi/shadow/delete/rejected" ] }, { "Effect": "Allow", "Action": "iot:Subscribe", "Resource": [ "arn:aws:iot:us-east-1:123456789012:topicfilter/$aws/things/RaspberryPi/shadow/update/accepted", "arn:aws:iot:us-east-1:123456789012:topicfilter/$aws/things/RaspberryPi/shadow/delete/accepted", "arn:aws:iot:us-east-1:123456789012:topicfilter/$aws/things/RaspberryPi/shadow/get/accepted", "arn:aws:iot:us-east-1:123456789012:topicfilter/$aws/things/RaspberryPi/shadow/update/rejected", "arn:aws:iot:us-east-1:123456789012:topicfilter/$aws/things/RaspberryPi/shadow/delete/rejected" ] }, { "Effect": "Allow", "Action": [ "iot:GetThingShadow", "iot:UpdateThingShadow", "iot:DeleteThingShadow" ], "Resource": "arn:aws:iot:us-east-1:123456789012:thing/RaspberryPi" } ] }
  5. Seleccione Crear.