AWS Service Configuration
This sample shows how to access services of the cloud provider Amazon Web Services (AWS) from the PLC using a GET request (required TwinCAT version: 3.1.4024.12). The REST API provides all the functionality that a user would have in the AWS management console. For example, virtual machines can be instantiated or configured using the AWS EC2 service.
The chapter AWS Signature Version 4 briefly outlines the background of the AWS signing function. For all other features please refer to the AWS documentation.
As already described in the chapter URL redirects, the IoT driver does not evaluate URL redirection and forwarding. Therefore, when accessing the local endpoint of an AWS data center, the exact address must always be specified. Again referring to the EC2 services sample, this means that a user cannot connect from TwinCAT to ec2.amazonaws.com but must directly provide the region in the link: ec2.eu-central-1.amazonaws.com.
A possible approach would be: fetch all available regions via a location-independent AWS REST API function and extract the region endpoint for the desired region from it. This would have the advantage over static programming of the endpoint that changes in the endpoint URL of a region would not result in changes in the program code.
![]() | Alphabetical sorting required The request URL must be sorted alphabetically, ditto the signed header. In the case of the signed header, this is handled by the IoT driver; in the case of the request URL, it is the responsibility of the user, otherwise an error message will be issued by the HTTP server. |