To deploy the USA AWS beanstalk environment in China EC2 instance, I use the following shell command:
[root@ip-10-0-0-1 ~]#echo -e "[profile eb-cli]\naws_access_key_id = 123\naws_secret_access_key = 234" > /root/.aws/config
[root@ip-10-0-0-1 ~]#echo -e "[profile eb-cli]\naws_access_key_id = 123\naws_secret_access_key = 234" > /root/.aws/credentials
[root@ip-10-0-0-1 ~]#eb init worldcup --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"
[root@ip-10-0-0-1 ~]#eb deploy "worldcup-dev" --version 6ad83ed9f599a8c9c967ef2f7168127f8dee2123-675
It's finished.
Then I use aws access key in Chinese region to get the platform information of china aws beanstalk specified environment:
[root@ip-10-0-0-1 ~]#echo -e "[profile eb-cli]\naws_access_key_id = 456\naws_secret_access_key = 789" > /root/.aws/config
[root@ip-10-0-0-1 ~]#echo -e "[profile eb-cli]\naws_access_key_id = 456\naws_secret_access_key = 789" > /root/.aws/credentials
[root@ip-10-0-0-1 ~]#eb use chinacup-dev --region cn-north-1
[root@ip-10-0-0-1 ~]#eb platform show --region cn-north-1
ERROR: InvalidParameterValueError - Platform 'arn:aws:elasticbeanstalk:us-west-1::platform/Tomcat 8 with Java 8 running on 64bit Amazon Linux/2.7.7' is in a different region.
How should I solve the above problem ?