Andrew8460958
Andrew8460958

Reputation: 167

How to deploy AWS beanstalk instances in the U.S. region on AWS beanstalk instances in the Chinese region

Two services of a system exist in the AWS China region and the AWS US region.

According to this link:

Deploy AWS Elastic beanstalk to an environment in different region

I tried to deploy an instance of AWS beanstalk in USA on an instance of AWS beanstalk in China.

I know the aws_access_key_id and aws_secret_access_key of China is different from the aws_access_key_id and aws_secret_access_key of USA.

So I modify the two files : /root/.aws/config and /root/.aws/credentials

aws_access_key_id = (USA)

aws_secret_access_key = (USA)

Then I use this command:

[root@ip-10-0-0-111 .aws]# eb init --region us-west-1

ERROR: InvalidParameterValueError - Platform 'arn:aws-cn:elasticbeanstalk:cn-north-1::platform/Tomcat 8 with Java 8 running on 64bit Amazon Linux/2.7.7' is in a different region.

How can I slove this question ?

Upvotes: 2

Views: 488

Answers (1)

Vaisakh PS
Vaisakh PS

Reputation: 1201

In the error itself it's clearly showing that you are trying to deploy application using invalid platform value.By default eb init will take the current region platform unless you explicitly specify it. So it's using the China region platform to deploy in US region, this will fail.

If you compare the arns in the error and one which i below mentioned both have different substitutions. In AWS China region is in a different partition. For all other regions its aws and for China its aws-cn.

use something like this.

eb init --region us-west-1 --platform "arn:aws:elasticbeanstalk:us-west-1::platform/Tomcat 8 with Java 8 running on 64bit Amazon Linux/2.7.7"

For more details and eb parameter options refer the below documentation

Upvotes: 2

Related Questions