#!/bin/bash
cd /tmp
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
sudo systemctl enable amazon-ssm-agent
sudo systemctl start amazon-ssm-agent
| #!/usr/bin/env python3 | |
| """ | |
| Simple image generator using AWS Bedrock | |
| """ | |
| import argparse | |
| import base64 | |
| import io | |
| import json | |
| import os |
| import boto3 | |
| import cv2 | |
| import os | |
| import sys | |
| from datetime import datetime | |
| # Get the directory where the script is located | |
| script_dir = os.path.dirname(os.path.abspath(__file__)) | |
| # Create data directory if it doesn't exist |
| import json | |
| import boto3 | |
| import logging | |
| import pyaudio | |
| from botocore.exceptions import ClientError | |
| from mypy_boto3_bedrock_runtime.client import BedrockRuntimeClient as BedrockClient | |
| from typing import cast | |
| from pydub import AudioSegment | |
| from io import BytesIO |
| import openpyxl | |
| import csv | |
| workbook = openpyxl.load_workbook("workbook.xlsx") | |
| sheet = workbook.active | |
| with open("workbook.csv", "w", newline="") as csv_file: | |
| csv_writer = csv.writer(csv_file, delimiter=",") | |
| for row in sheet.iter_rows(): | |
| csv_writer.writerow([cell.value for cell in row]) |
| import boto3 | |
| def delete_all_objects(bucket_name): | |
| s3 = boto3.resource('s3') | |
| bucket = s3.Bucket(bucket_name) | |
| bucket.objects.all().delete() | |
| if __name__ == "__main__": | |
| import sys | |
| bucket_name = sys.argv[1] # pass the bucket name as an argument to the script |
| """ | |
| Purpose: Get instance types for a given region and availability zone | |
| Usage: | |
| - python3 get_instance_types.py --region us-east-1 --availability_zone us-east-1a --instance_type t2.micro | |
| - python3 get_instance_types.py --region us-east-1 --availability_zone us-east-1a --instance_type "t2.*" | |
| - python3 get_instance_types.py --region us-east-1 --availability_zone "*" --instance_type g3.4xlarge | |
| """ | |
| import argparse | |
| import boto3 |
| #!/bin/bash | |
| # Specify the desired volume size in GiB as a command line argument. If not specified, default to 20 GiB. | |
| SIZE=${1:-20} | |
| # Get the ID of the environment host Amazon EC2 instance. | |
| INSTANCEID=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
| # Get the ID of the Amazon EBS volume associated with the instance. | |
| VOLUMEID=$(aws ec2 describe-instances \ |
| version: 0.2 | |
| env: | |
| variables: | |
| CACHE_CONTROL: "86400" | |
| S3_BUCKET: {-INSERT BUCKET NAME FOR STATIC WEBSITE HERE-} | |
| BUILD_FOLDER: {-INSERT THE NAME OF THE BUILD FOLDER HERE-} | |
| BUILD_ENV: "prod" | |
| phases: | |
| install: |
| version: 0.1 | |
| phases: | |
| install: | |
| commands: | |
| - printenv | |
| - npm install | |
| build: | |
| commands: | |
| - npm run build |