Q:

Fail to create ElasticBeanstalk custom platform with "Unmatched region"

I'm trying to create a custom platform for region ap-northeast-1 following aws documentation.
ebp create ends with failure, and ebp events shows an error indicating that the created AMI is in different region from the service region.
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'.

I used this sample custom platform provided in aws document and modified only custom_platform.json for builders.region and builders.source_ami to match with the region of my Custom Platform Builder.
.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"
      ]
    }
  ]
}

It seems my modification to custom_platform.json does not take effect.

A:

What I missed was committing the changes...
Though EB and Packer documentation do not refer to anything about vcs or git, it seems packer uses git to create an archive of the custom platform files and thus the changes I made was not included in it because I did not commit them.
I noticed that ebp create was giving me this warning...
mac.local:NodePlatform_Ubuntu% ebp create
WARNING: You have uncommitted changes.

