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

Reduce the number of times we run apply #233

Merged
merged 1 commit into from
Jun 30, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions ai-ml/emr-spark-rapids/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ targets=(
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -auto-approve
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -32,9 +31,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -auto-approve
apply_output=$(terraform apply -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
5 changes: 2 additions & 3 deletions ai-ml/ray/terraform/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ terraform init || echo "\"terraform init\" failed"


echo "Applying ..."
terraform apply -auto-approve
apply_output=$(terraform apply -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply completed successfully"
else
echo "FAILED: Terraform apply failed"
Expand Down
10 changes: 4 additions & 6 deletions analytics/terraform/datahub-on-eks/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ targets=(
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -auto-approve
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -36,9 +35,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -auto-approve
apply_output=$(terraform apply -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
10 changes: 4 additions & 6 deletions analytics/terraform/emr-eks-ack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ targets=(
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -var="region=$region" -auto-approve
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -33,9 +32,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -var="region=$region" -auto-approve
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
10 changes: 4 additions & 6 deletions analytics/terraform/emr-eks-fargate/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ targets=(
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -var="region=$region" -auto-approve
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -28,9 +27,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -var="region=$region" -auto-approve
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
10 changes: 4 additions & 6 deletions analytics/terraform/emr-eks-karpenter/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ targets=(
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -auto-approve
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -33,9 +32,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -auto-approve
apply_output=$(terraform apply -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
10 changes: 4 additions & 6 deletions analytics/terraform/spark-k8s-operator/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ terraform init --upgrade
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -var="region=$region" -auto-approve
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -33,9 +32,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -var="region=$region" -auto-approve
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
10 changes: 4 additions & 6 deletions distributed-databases/cloudnative-postgres/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ targets=(
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -var="region=$region" -auto-approve
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -33,9 +32,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -var="region=$region" -auto-approve
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
10 changes: 4 additions & 6 deletions streaming/flink/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ terraform init --upgrade
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -var="region=$region" -auto-approve
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -32,9 +31,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -var="region=$region" -auto-approve
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -var="region=$region" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
10 changes: 4 additions & 6 deletions streaming/kafka/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ targets=(
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -auto-approve
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -27,9 +26,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -auto-approve
apply_output=$(terraform apply -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down
10 changes: 4 additions & 6 deletions workshop/emr-eks/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ targets=(
for target in "${targets[@]}"
do
echo "Applying module $target..."
terraform apply -target="$target" -auto-approve
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -target="$target" -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of $target completed successfully"
else
echo "FAILED: Terraform apply of $target failed"
Expand All @@ -27,9 +26,8 @@ done

# Final apply to catch any remaining resources
echo "Applying remaining resources..."
terraform apply -auto-approve
apply_output=$(terraform apply -auto-approve 2>&1)
if [[ $? -eq 0 && $apply_output == *"Apply complete"* ]]; then
apply_output=$(terraform apply -auto-approve 2>&1 | tee /dev/tty)
if [[ ${PIPESTATUS[0]} -eq 0 && $apply_output == *"Apply complete"* ]]; then
echo "SUCCESS: Terraform apply of all modules completed successfully"
else
echo "FAILED: Terraform apply of all modules failed"
Expand Down