Using AWS CLI from EC2 instance without internet access

amazon-ec2, amazon-web-services, aws-cli

Solution

Not possible. The CLI has to access the API endpoints for all the services you mentioned. For that the CLI needs internet access. Only service it can access without internet is the internal metadata server.

AWS Regions and Endpoints

Problem

Is there a way to use AWS CLI to call different services such as SQS, EC2, SNS from EC2 linux instance? The EC2 instance from where the AWS CLI command are invoked does not have access to internet. It is in private subnet. It is not using internet gateway or NAT. Thanks,

Original source