Skip to content

Commit f5a4ca0

Browse files
committed
DOPS-101 Share packer ami between dops prod and sandbox
1 parent 2d6f473 commit f5a4ca0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

bin/validate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Set bash unofficial strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/
44
set -euo pipefail
5-
5+
66
# Set DEBUG to true for enhanced debugging: run prefixed with "DEBUG=true"
77
${DEBUG:-false} && set -vx
88
# Credit to https://stackoverflow.com/a/17805088
@@ -30,6 +30,7 @@ $DOCKER_PACKER validate app/packer/machines/web-server.json
3030
if [[ "${SKIP_TERRAFORM:-false}" == "false" ]]; then
3131
DOCKER_TERRAFORM=$(get_docker_terraform)
3232
fmt=$($DOCKER_TERRAFORM fmt)
33+
echo "Linting terraform files for formatting"
3334
if [[ -n "$fmt" ]]; then
3435
echo 'ERROR: these files are not formatted correctly. Run "terraform fmt"'
3536
echo "$fmt"
@@ -42,7 +43,6 @@ if [[ "${SKIP_TERRAFORM:-false}" == "false" ]]; then
4243
-var 'newrelic_license_key=ZZZZ' \
4344
-var 'newrelic_api_key=ZZZZ' \
4445
-var 'newrelic_alert_email=ferd.berferd@example.com' \
45-
echo "Linting terraform files for formatting"
4646
fi
4747

4848
echo "Linting shell scripts"

packer/machines/web-server.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"vpc_id": "{{user `aws_vpc_id`}}",
1919
"ssh_username": "centos",
2020
"ami_name": "devops-infra-demo-centos-7-{{timestamp}}",
21-
"ami_description": "DevOps Infrastructure Demo CentOS 7 - CIS hardened"
21+
"ami_description": "DevOps Infrastructure Demo CentOS 7 - CIS hardened",
22+
"ami_users": ["587267277416"] // Share with devops sandbox account
2223
}],
2324
"provisioners": [
2425
{

terraform/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ variable "google_project" {
4848
default = "example-media"
4949
}
5050

51+
# Use devops prod account as default. We bake and store AMIs using packer.
5152
variable "aws_account_id_for_ami" {
5253
description = "AWS Account ID where AMIs live, if not the default"
53-
default = ""
54+
default = "191447213457"
5455
}
5556

5657
variable "ami_pattern" {

0 commit comments

Comments
 (0)