Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Govcloud support #6

Open
elerch opened this issue Jan 9, 2017 · 0 comments
Open

Govcloud support #6

elerch opened this issue Jan 9, 2017 · 0 comments

Comments

@elerch
Copy link

elerch commented Jan 9, 2017

There is a small change needed to support AWS Govcloud (and possibly Montreal region?). According to http://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-ec2.html the bundles need a different cert to work successfully with ec2-bundle-image.

I got the script to work fine by adding --ec2cert $EC2_AMITOOL_HOME/etc/ec2/amitools/cert-ec2-gov.pem to the ec2-bundle-image command (note that $EC2_AMITOOL_HOME by default is not set, so the cert path is /etc/ec2/amitools/cert-ec2-gov.pem). Patch is below. It would be cool if the script detected govcloud and added the required ec2cert parameter. Given that my /etc/ec2/amitools/ directory also includes a cert for cn-north-1 this might be required for Montreal region as well, but I don't see documentation to that effect.

diff --git a/centos7-ami-builder.sh b/centos7-ami-builder.sh
index 57d025c..31238b4 100755
--- a/centos7-ami-builder.sh
+++ b/centos7-ami-builder.sh
@@ -420,7 +420,7 @@ undefine_hvm_dev() {
 bundle_ami() {
 	output "Bundling AMI for upload..."
 	RUBYLIB=/usr/lib/ruby/site_ruby/ ec2-bundle-image --privatekey $AWS_PRIVATE_KEY --cert $AWS_CERT \
-		--user $AWS_USER --image $AMI_IMG --prefix $AMI_NAME --destination $AMI_OUT --arch x86_64 || \
+		--user $AWS_USER --image $AMI_IMG --prefix $AMI_NAME --destination $AMI_OUT --arch x86_64 --ec2cert $EC2_AMITOOL_HOME/etc/ec2/amitools/cert-ec2-gov.pem || \
 		fatal "Failed to bundle image!"
 	AMI_MANIFEST=$AMI_OUT/$AMI_NAME.manifest.xml
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant