Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify region in aws cloud formation command line tool for windows

I submit this on command line (i'm omitting all the other params that i know to work)

aws cloudformation create-stack ... --parameters ParameterKey=Region,ParameterValue=us-east-1

It yields:

Unable to construct an endpoint for cloudformation in regionNone

If i submit the same exact params using the https://console.aws.amazon.com/cloudformation web ui, it works.

How do i specify region using the aws.exe for windows ? The .json file i use as a template even has it as the default, but it still does not take it if i omit region from the command line

"Region": { "Type": "String", "Description": "Which Region to launch in", "Default": "us-east-1", "AllowedValues": [ "us-east-1", "us-west-1", "us-west-2", "eu-west-1", "ap-northeast-1" ] }

in debug mode i get...

File "awscli\clidriver.pyc", line 206, in main
File "awscli\clidriver.pyc", line 354, in __call__
File "awscli\clidriver.pyc", line 461, in __call__
File "awscli\clidriver.pyc", line 555, in invoke
File "botocore\service.pyc", line 161, in get_endpoint
File "botocore\endpoint.pyc", line 265, in create_endpoint
File "botocore\regions.pyc", line 67, in construct_endpoint
UnknownEndpointError: Unable to construct an endpoint for cloudformation in region None
2014-10-27 22:52:38,631 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255
like image 660
Mike Avatar asked Oct 28 '14 02:10

Mike


People also ask

How do you specify a region in CloudFormation?

You can select the AMI ID that your stack uses by using an input parameter ( EnvironmentType ). To determine the region, use the AWS::Region pseudo parameter, which gets the AWS Region in which you create the stack.

How do I specify a region in AWS?

Sign in to the AWS Management Console . Choose a service to go to that service's console. In the navigation bar, choose the name of the currently displayed Region. Then choose the Region to which you want to switch.

How do I find my default region in AWS CLI?

aws configure get region will get you the current region at that point in your script. If you are using a profile, then type aws configure get region --profile $PROFILE_NAME . This will return the region of the configuration, not the region that your aws cli invocation was performed from.

Is CloudFormation region specific?

AWS CloudFormation Supports Multiple Account and Region Provisioning with StackSet. AWS CloudFormation has launched a new feature called StackSet that lets you provision a common set of AWS resources across multiple accounts and regions with a single CloudFormation template.


2 Answers

The region is an argument of the aws command :

aws --region eu-west-1 cloudformation create-stack --stack-name ...

like image 107
huelbois Avatar answered Dec 09 '22 06:12

huelbois


You can also configure it using aws configure or if already executed you can identify it in ~/.aws/config. Example:

[default]
region=us-east-1

The regions are as follows. See second column.

$ ec2-describe-regions
REGION  eu-central-1    ec2.eu-central-1.amazonaws.com
REGION  sa-east-1   ec2.sa-east-1.amazonaws.com
REGION  ap-northeast-1  ec2.ap-northeast-1.amazonaws.com
REGION  eu-west-1   ec2.eu-west-1.amazonaws.com
REGION  us-east-1   ec2.us-east-1.amazonaws.com
REGION  us-west-1   ec2.us-west-1.amazonaws.com
REGION  us-west-2   ec2.us-west-2.amazonaws.com
REGION  ap-southeast-2  ec2.ap-southeast-2.amazonaws.com
REGION  ap-southeast-1  ec2.ap-southeast-1.amazonaws.com
like image 22
f01 Avatar answered Dec 09 '22 06:12

f01