Skip to content

Added the new account #10

Merged
merged 4 commits into from Feb 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -85,7 +85,6 @@ This template only is tested against 64 bit systems. With the following sizing r
The final VM appliance formats will be uploaded into AWS infrastructure. The two compressed tarballs to S3 buckets and AMI to EC2.

- Compressed ova / ovf format
- Compressed Vagrant format
- Imported AWS AMI


Expand Down
6 changes: 5 additions & 1 deletion bin/perms.sh
@@ -1,6 +1,8 @@
#!/bin/bash

aws_acct_id="823003027569"
aws_acct_id_plus="886593122405"

bucket="internet2-tier-appliance-us-west-1"

ova_key=$(aws s3api list-objects --bucket $bucket --query 'reverse(sort_by(Contents[?contains(Key, `ova`)], &LastModified))[0].[Key]' --output text | tr -d '\n' )
Expand All @@ -13,10 +15,12 @@ echo "(https://s3-us-west-1.amazonaws.com/$bucket/$ova_key)"
echo $(md5sum builds/$ova_key)

ami_id=$(aws ec2 describe-images --owners $aws_acct_id --query 'reverse(sort_by(Images[?starts_with(Name, `import-ami`)], &CreationDate))[0].[ImageId]' --output text | tr -d '\n' )
echo "Publishing $ami_id to $aws_acct_id"

echo "Publishing $ami_id to all accounts"

ami_image_description=$(aws ec2 describe-images --image-ids $ami_id --query 'Images[0].{Description:Tags[0].Value}')
echo $ami_image_description

aws ec2 modify-image-attribute --image-id $ami_id --launch-permission "{\"Add\":[{\"UserId\":\"$aws_acct_id\"}]}"
aws ec2 modify-image-attribute --image-id $ami_id --launch-permission "{\"Add\":[{\"UserId\":\"$aws_acct_id_plus\"}]}"