要在China EC2实例中部署USA AWS beanstalk环境,我使用以下shell命令:
[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
结束了。
然后我在中文区域使用aws访问密钥获取china aws beanstalk指定环境的平台信息:
[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.
我该如何解决上述问题?
答案 0 :(得分:1)
问题是arn:aws:elasticbeanstalk:us-west-1::platform/Tomcat 8 with Java 8 running on 64bit Amazon Linux/2.7.7
中cn-north-1
不有效。
打开.elasticbeanstalk/config.yml
并将default_platform
更改为cn-north-1
区域中的同等平台ARN。您可以通过执行以下内容在cn-north-1
区域中找到等效平台ARN:
aws elasticbeanstalk list-platform-versions --region cn-north-1 --filters "Type=PlatformName,Operator='contains',Values='Tomcat 8'" | grep "PlatformArn"