How to Create Static IP for AWS IoT Core

Aayush Shrut
3 min readSep 21, 2022

--

AWS IoT core is a bunch of software suit that can help you integrate your IoT devices into AWS IoT-based solutions. If your devices can connect to AWS IoT, AWS IoT can connect them to the cloud services that AWS provides.

Source: https://northbaysolutions.com/blog/aws-iot-core/

This opens a plethora of options, as your devices can leverage full power of AWS. The AWS IoT Message Broker is the central point to securely transmit messages to and from all your devices and applications using the HTTPS and MQTT protocols. Devices connect to IoT Core using something called IoT Core endpoints, which allows control plane and data plane access to IoT Core.

The key focal point in IoT Core is always security. Each connected device or client must have a credential to interact with AWS IoT endpoint. All traffic to and from AWS IoT is sent securely over Transport Layer Security (TLS). AWS cloud security mechanisms protect data as it moves between AWS IoT and other AWS services.

While the TLS mechanism is very good in protecting unintended intrusions, more sophisticated industrial grade systems use a lot of firewalls to allow traffic from certain devices and block unintended ones. In that regard, it would be helpful to know static IP addresses of IoT Core endpoints to prevent unintended access to your devices.

Unfortunately, AWS IoT endpoints resolves to dynamic IP Address. This is because, serverless services like AWS IoT is designed to be able to handle different network load situations. To provide resilience and scale, this single FDQN resolves to a different set of IP addresses over time to handle the load which makes it unable to expose single static IP address to communicate. Hence, there would not exist any single IP address from AWS side which could be used for whitelisting.

This is why AWS has come up with three different workarounds to provide static IP address to IoT Core systems. While discussing the entire workaround would make this article exponentially large, I am sharing the relevant links and a short explanation below:

1) IoT static endpoints:

This solution establishes a secure virtual private network (VPN) connection with IoT devices without compromising your network security posture. This secure connection occurs over a set of static IP addresses using a single port number, allowing IoT device traffic destined for multiple AWS service endpoints to be tunneled through those IP addresses. This solution uses OpenVPN as the VPN system to create a secure client-to-server connection in a routed configuration mode.

2) Bridge using MQTT broker:

This solution helps you to use Mosquitto MQTT broker which acts as a proxy server that connects your device to AWS IoT. MQTT broker is launched on EC2 instances and therefore you could use the static IP address of EC2 instances as endpoints. Do note that you would need to implement custom security to authenticate your IoT devices with MQTT broker.

3) Whitelist all IP Address:

This workaround is to whitelist all the possible IP address on the firewall that AWS IoT endpoint could use. However, due to the lengthy list of IP address range and the dynamic nature of address changes, it is difficult to continuously whitelist on the Firewall server and therefore not a recommended approach. That being said, as a brute force method, this method could be adopted as you can always subscribe to SNS topics to listen to IP address changes.

Hope this article helps in exploring ways to assign static IPs to IoT Core. Clap for fun :).

--

--

Aayush Shrut

Telco Professional Turned DevOps Enthusiast | Prolific writer with related to tech industry | Reach out on my LinkedIn for free career counselling.