If the vmimport role is not present, you will receive this error from the light stemcell builder:
Error publishing AMIs to us-east-1: creating snapshot: creating import snapshot task: InvalidParameter: The sevice role does not exist or does not have sufficient permissions for the service to continue
status code: 400, request id:
Light Stemcell Builder for AWS
This tool takes a raw machine image and a configuration file and creates a collection of AMIs. Any AWS region including China is supported.
AWS Setup for Publishing
Create an S3 bucket for intermediate artifacts (e.g.
light-stemcells-for-project-XXX)Create an AWS IAM policy based on the JSON contained in
builder-policy.jsonReplace the bucket placeholder in your policy with the bucket created in step 1
Note: The arn for AWS GovCloud region is
aws-us-gov. It looks like this:"arn:aws-us-gov:s3:::<disk-image-file-bucket>"Create an AWS IAM user and attach the policy created in steps 2, 3.
Create the
vmimportAWS role as detailed here, specifying the previously created bucket in place of<disk-image-file-bucket>; see example IAM policy.Replicate these steps in a separate AWS China account if publishing to China.
IAM User Setup for Integration Testing
integration-test-policy.jsonTesting
Unit testing:
Example Usage
Example config:
Non-standard AWS partitions (custom endpoint domain)
Some AWS partitions use a different endpoint domain than the default
amazonaws.com. For example, the AWS EU Sovereign Cloud (EUSC) usesamazonaws.eu.Set
endpoint_baseon the region entry to override the endpoint domain for all services (EC2, S3, KMS):Service endpoints are constructed as
https://<service>.<region>.<endpoint_base>, e.g.https://ec2.eusc-de-east-1.amazonaws.eu.Usage:
Example Output:
Troubleshooting
If the
vmimportrole is not present, you will receive this error from the light stemcell builder: