This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python | |
# AI-generated code. Review and use carefully | |
import os | |
import json | |
import requests | |
import subprocess | |
from datetime import datetime | |
# Define the log file with a timestamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define the log file with a timestamp | |
logfile="/tmp/install_terraform-$(date +%Y%m%d%H%M%S).log" | |
# Check if jq is installed | |
if ! command -v jq &> /dev/null | |
then | |
echo "jq could not be found" | tee -a $logfile | |
echo "Installing jq..." | tee -a $logfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from botocore.config import Config | |
def list_instances_in_all_regions(check_state=None): | |
def available_regions(service): | |
regions = [] | |
client = boto3.client(service) | |
response = client.describe_regions() | |
for item in response["Regions"]: |