AWS CLI Behaviour: Lambda Service

You thought it will be some kind of tech-heavy post about one of relatively new service on AWS? Nope. This is my silly experience with AWS CLI for listing Lambda function. Please don’t judge me.

I remember sentence somewhere on the net, “Problem solving should start from the simplest thing you can imagine”. Apparently, Lambda service is not yet available on my default CLI region (ap-southeast-1 in this case). So when I call this:

aws lambda list-functions

will return an error message:

Could not connect to the endpoint URL: “https://lambda.ap-southeast-1.amazonaws.com/2015–03–31/functions/”

The solution is dead simple. I just check my AWS management console and list the available regions for my Lambda service:

AWS Lambda availability as November 24th, 2015

Then I configure my AWS CLI default region to ap-northeast-1, which is the nearest region from my country (drum roll please), Republic of Indonesia. Here’s the command:

aws configure
AWS Access Key ID [**************
WQ]:
AWS Secret Access Key [**************j4ob]:
Default region name [ap-southeast-1]: ap-northeast-1
Default output format [json]:

Then if I call list-functions command, it will result:

aws lambda list-functions
{ “Functions”: []
}

Tadaaaaaa ….