🐾How to troubleshoot connection errors🐾
🤓 Have you ever created resource in AWS cloud and got an error while trying to run some code and connecting to other resources? I would say it’s a pretty common situation. Let me share with you a set of steps I use to troubleshoot such problems.
Check 1: CloudTrail errors
In case you are trying to connect to AWS APIs and your requests are failing, it’s a good idea to check CloudTrail logs and check which errors you get. For input parameter error — check your code to validate if you are passing all required parameters in the appropriate format. For access denied error — proceed to the next check.
Check 2: IAM and SCP
In case you have access denied error — the first thing to check is actions allowed in policies attached to IAM role used by your resource. If it has all needed rights, the next step is to check SCP applied to the account.
Check 3: Target availability
Verify that your target resource is healthy and capable of accepting requests. Sometimes problem is related to the resource you are trying to reach, not your code or network connection between them.
Check 4: Security groups and NACLs
Check security groups attached to source and target resources, as well as NACLs attached to subnets where they are located. Both of them can block your requests, so you need to check carefully that all required ports are whitelisted. Also, don’t forget that security groups are stateful and while allowing an inbound request, it automatically allows the corresponding outbound response, and vice versa.. NACLs on the other hand requires you to allow inbound and outbound traffic explicitly.
Check 5: Routing tables
Check that routes in routing tables attached to subnets allows traffic to target. Usually, it can be the case if you are trying to connect to resources in the other VPC or access the internet.
Check 6: Firewall rules
Check that firewall rules allow traffic to the target resource.
Thank you for reading, let’s chat 💬
💬 Do you have any other troubleshooting tips?
💬 Should I make more detailed posts how to troubleshoot such issues?
💬 Anything else you would like me to tell about?
I love hearing from readers 🫶🏻 Please feel free to drop comments, questions, and opinions below👇🏻