无法创建具有"Unmatched region"的 ElasticBeanstalk 自定义平台



我正在尝试按照 aws 文档为区域 ap-northeast-1 创建一个自定义平台。

ebp create以失败结束,ebp events显示错误,指示创建的 AMI 与服务区域位于不同的区域。

2018-04-28 00:49:18    INFO    Initiated platform version creation for 'NodePlatform_Ubuntu/1.0.0'.
2018-04-28 00:49:22    INFO    Creating Packer builder environment 'eb-custom-platform-builder-packer'.
2018-04-28 00:52:39    INFO    Starting Packer building task.
2018-04-28 00:52:44    INFO    Creating CloudWatch log group '/aws/elasticbeanstalk/platform/NodePlatform_Ubuntu'.
2018-04-28 01:03:48    INFO    Successfully built AMI(s): 'ami-5f2f4527' for 'arn:aws:elasticbeanstalk:ap-northeast-1:392559473945:platform/NodePlatform_Ubuntu/1.0.0'
2018-04-28 01:04:03    ERROR   Unmatched region for created AMI 'ami-5f2f4527': 'us-west-2' (service region: 'ap-northeast-1').
2018-04-28 01:04:03    INFO    Failed to create platform version 'NodePlatform_Ubuntu/1.0.0'.

我使用了 aws 文档中提供的此示例自定义平台,并且仅修改了 custom_platform.json 以进行builders.regionbuilders.source_ami,以匹配我的自定义平台构建器的区域。

.elasticbeanstalk/config.yml

global:
application_name: Custom Platform Builder
branch: null
default_ec2_keyname: null
default_platform: null
default_region: ap-northeast-1
instance_profile: null
platform_name: NodePlatform_Ubuntu
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Platform

custom_platform.json

{
"variables": {
"platform_name": "{{env `AWS_EB_PLATFORM_NAME`}}",
"platform_version": "{{env `AWS_EB_PLATFORM_VERSION`}}",
"platform_arn": "{{env `AWS_EB_PLATFORM_ARN`}}"
},
"builders": [
{
"type": "amazon-ebs",
"name": "HVM AMI builder",
"region": "ap-northeast-1",
"source_ami": "ami-60a4b21c",
"instance_type": "m3.medium",
"ssh_username": "ubuntu",
"ssh_pty": "true",
"ami_name": "NodeJs running on Ubuntu Server 16.04 LTS (built on {{isotime "20060102150405"}})",
"tags": {
"eb_platform_name": "{{user `platform_name`}}",
"eb_platform_version": "{{user `platform_version`}}",
"eb_platform_arn": "{{user `platform_arn`}}"
}
}
],
"provisioners": [
{
"type": "file",
"source": "builder",
"destination": "/tmp/"
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo {{ .Path }}",
"scripts": [
"builder/builder.sh"
]
}
]
}

看来我对 custom_platform.json 的修改没有生效。

我错过的是提交更改...

尽管EB和Packer文档没有提及有关vcs或git的任何内容,但似乎Packer使用git来创建自定义平台文件的存档,因此我所做的更改不包括在其中,因为我没有提交它们。

我注意到ebp create给了我这个警告......

mac.local:NodePlatform_Ubuntu% ebp create
WARNING: You have uncommitted changes.

相关内容

  • 没有找到相关文章

最新更新