Skip to content

Instantly share code, notes, and snippets.

resource "aws_s3_bucket" "s3_bucket" {
bucket = var.bucket_name
tags = var.tags
}
resource "aws_s3_bucket_public_access_block" "s3_bucket_public_access_block"{
bucket = aws_s3_bucket.s3_bucket.id
block_public_acls = false
provider "aws" {
region = "us-east-1"
}
data "aws_vpc" "default" {
default = true
}
#Retrieve the list of AZs in the current AWS region
data "aws_availability_zones" "available" {}
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
# Configure the AWS Provider
provider "aws" {
import json
import sys
import boto3
import os
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
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):
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment2
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment1
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
import json
import sys
import boto3
import os
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
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 && \
#!/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