Skip to content

Commit

Permalink
adding ami_users option to ami builder
Browse files Browse the repository at this point in the history
adding an option of ami_users that getting a list of account IDs and adding
permissions to AMI during packer build
  • Loading branch information
Annamikhlin committed Jul 2, 2023
1 parent 5fdb798 commit a45fef1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packer/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ print_usage() {
echo " [--scylla-build-sha-id] Scylla build SHA id form metadata file"
echo " [--branch] Set the release branch for GCE label. Default: master"
echo " [--ami-regions] Set regions to copy the AMI when done building it (including permissions and tags)"
echo " [--ami-users] A list of account IDs that have access to launch the AMI"
echo " [--build-tag] Jenkins Build tag"
echo " --download-no-server Download all deb needed excluding scylla from repo-for-install"
echo " [--build-mode] Choose which build mode to use for Scylla installation. Default: release. Valid options: release|debug"
Expand Down Expand Up @@ -98,6 +99,11 @@ while [ $# -gt 0 ]; do
echo "--ami-regions prameter: AMI_REGIONS |$AMI_REGIONS|"
shift 2
;;
"--ami-users"):
AMI_USERS=$2
echo "--ami-users parameter: AMI_USERS |$AMI_USERS|"
shift 2
;;
"--log-file")
PACKER_LOG_PATH=$2
echo "--log-file parameter: PACKER_LOG_PATH |$PACKER_LOG_PATH|"
Expand Down Expand Up @@ -345,6 +351,7 @@ set -x
-var operating_system="$OPERATING_SYSTEM" \
-var branch="$BRANCH" \
-var ami_regions="$AMI_REGIONS" \
-var ami_users="$AMI_USERS" \
-var arch="$ARCH" \
-var product="$PRODUCT" \
-var build_mode="$BUILD_MODE" \
Expand Down
1 change: 1 addition & 0 deletions packer/scylla.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"build_mode": "{{user `build_mode`| clean_resource_name}}"
},
"ami_regions": "{{user `ami_regions`}}",
"ami_users": "{{user `ami_users`}}",
"aws_polling": {
"delay_seconds": "30",
"max_attempts": "100"
Expand Down

0 comments on commit a45fef1

Please sign in to comment.