Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3.11
"""
Empty List initially to be filled with some of the AWS services
i.e. S3, DynamoDB, EC2, CloudFront, SAM, etc.
"""
ListServices = []
"""
Manually fill our list of services using the .append method followed by print
#!/usr/bin/env python3.11
# list all files, directories and subdirectories's files in a given directory source of help for this
# from stackoverflow: https://stackoverflow.com/questions/2909975/python-list-directory-subdirectory-and-files
# this function will not print out with formatted keys and values instead the keys are the path of the file
# and the values are the name of the file
def list_files_recursive(directory, files, recursive_dictionary):
#!/usr/bin/ env python3.11
import boto3
import random
import string
from datetime import datetime
from botocore.exceptions import ClientError
import logging
# create a sqs connection
#!/usr/bin/ env python3.11
# This script will send messages to an SQS queue
import boto3
import json
import random
from datetime import datetime
from botocore.exceptions import ClientError
import string
#!/usr/bin/ env python3.11
# import a function from another module will be used to generate a name at random
import boto3
import os
import sys
from botocore.exceptions import ClientError
sys.path.append("sqs")
from create_sqs import create_service_name
FROM debian:latest
# Install Git
RUN apt-get update && apt-get install -y git
# Clone GitHub repository and configure Git
ARG GITHUB_TOKEN
RUN git clone https://github.com/AngelChaidez/AWS_Python_Workshop.git && \
cd AWS_Python_Workshop && \
git config --global credential.helper store && \
import json
import sys
import boto3
import os
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment1
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment2
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
import json
#!/usr/bin/env python3.11
# this script will start ec2 instances based off of tags
import boto3
import sys
import os
def lambda_handler(event, context):