

Aviso de fin del soporte: el 15 de diciembre de 2025, AWS finalizará el soporte para AWS IoT Analytics. Después del 15 de diciembre de 2025, ya no podrás acceder a la AWS IoT Analytics consola ni a AWS IoT Analytics los recursos. Para obtener más información, consulta [AWS IoT Analytics el fin del soporte](https://docs.aws.amazon.com/iotanalytics/latest/userguide/iotanalytics-end-of-support.html).

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.

# DeviceShadowEnrich actividad
<a name="pipeline-activities-deviceshadowenrich"></a>

Una `deviceShadowEnrich` actividad agrega información del servicio AWS IoT Device Shadow a un mensaje. Por ejemplo, dado el mensaje:

```
{
    "temp": 50,
    "hum": 40,
    "device": { "thingName": "my-thing" }
}
```

y la actividad `deviceShadowEnrich` siguiente:

```
{
    "deviceShadowEnrich": {
        "name": "MyDeviceShadowEnrichActivity",
        "attribute": "shadow",
        "thingName": "device.thingName",
        "roleArn": "arn:aws:iam::<your-account-number>:role:MyEnrichRole",
        "next": "MyDatastoreActivity"
    }
}
```

El resultado es un mensaje con el aspecto del siguiente ejemplo.

```
{
    "temp": 50,
    "hum": 40,
    "device": {
        "thingName": "my-thing"
    },
    "shadow": {
        "state": {
            "desired": {
                "attributeX": valueX, ...
            },
            "reported": {
                "attributeX": valueX, ...
            },
            "delta": {
                "attributeX": valueX, ...
            }
        },
        "metadata": {
            "desired": {
                "attribute1": {
                    "timestamp": timestamp
                }, ...
            },
            "reported": ": {
                "attribute1": {
                    "timestamp": timestamp
                }, ...
            }
        },
        "timestamp": timestamp,
        "clientToken": "token",
        "version": version
    }
}
```

Debe especificar un rol en el campo `roleArn` de la definición de actividad que tenga asociados los permisos pertinentes. El rol debe tener una política de permisos parecida a la siguiente.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "iot:GetThingShadow"
            ],
            "Resource": [
            "arn:aws:iot:{{us-east-1}}:{{123456789012}}:thing/{{your-thingName}}"
            ]
        }
    ]
}
```

------

y una política de confianza parecida a esta:

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Principal": {
                "Service": "iotanalytics.amazonaws.com"
            },
            "Action": [
                "sts:AssumeRole"
            ]
        }
    ]
}
```

------