Search code examples
amazon-web-servicesamazon-ec2amazon-ecsaws-cloud9

AWS ec2 instance issues with adding awscli to instance


After I ssh into my EC2 instance I've been trying to add AWS cli to my instance so I can send images to ECR.

My ec2 instance produces this after I enter this::

[ec2-user@ip-10-10-2-237 ~]$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

to terminal .

Return

curl: (7) Failed to connect to s3.amazonaws.com port 443: Connection timed out

I believe its something with my networking but im fairly new to aws and networking, so im a bit lost in this scenario.

Below is all my networking rule/settings, if anyone could provide some insight into this that would be a live saver. Thanks in advance for any help!

After this step I would grab images from my docker and send to was ECR. So this is my final step

Networking

ACL Outbounds ACL inbound


Solution

  • Network ACLs (NACLs) should generally not be modified from their default "Allow All" settings. While they represent traditional routers, they can be difficult to configure.

    Instead, it is recommended to use Security Groups, which have several advantages over NACLs:

    • They apply to each instance individually
    • They can refer to other Security Groups, enabling rules that only apply between specific pairs of resources
    • They are stateful, meaning that a permitted incoming connection can be sent a response without needing an Outbound rule to be defined

    NACLs are only required if there is a specific security need, such as defining a DMZ or very tightly locking-down access. Since NACLs are stateful, rules must be defined in both directions. This makes them harder to configure and more likely to cause problems.

    Therefore, I'd recommend keeping the NACLs at their default "Allow All" settings, and use the Security Groups to control the access.