This file contains hidden or 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
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 |
This file contains hidden or 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
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" {} |
This file contains hidden or 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
terraform { | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 4.0" | |
} | |
} | |
} | |
# Configure the AWS Provider | |
provider "aws" { |
This file contains hidden or 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 json | |
import sys | |
import boto3 | |
import os | |
from botocore.exceptions import ClientError | |
ec2 = boto3.client('ec2') |
This file contains hidden or 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 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): |
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: deployment2 | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: nginx | |
template: |
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: deployment1 | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: nginx | |
template: |
This file contains hidden or 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 json | |
import sys | |
import boto3 | |
import os | |
from botocore.exceptions import ClientError | |
ec2 = boto3.client('ec2') |
This file contains hidden or 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
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 && \ |
This file contains hidden or 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
#!/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 |
NewerOlder