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
version: "3.8" | |
services: | |
web: | |
image: httpd:2.4.55 | |
ports: | |
- 80:80 | |
networks: | |
- frontend | |
deploy: |
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
FROM python:3.9-alpine3.17 | |
#update, install curl, git, zip/unzip | |
RUN apk update \ | |
&& apk add bash \ | |
&& apk add curl zip git unzip iputils | |
#install aws cli | |
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ | |
&& unzip awscliv2.zip \ |
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 | |
#resource | |
s3 = boto3.resource(s3, region_name='us-east-1') | |
#create bucket | |
s3.create_bucket(Bucket=bucket_name) |
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 | |
import json | |
ec2 = boto3.resource('ec2', region_name='us-east-1') | |
def lambda_handler(event, context): | |
filteredInstances = [] | |
successMessage = f"Successfully stopped {len(filteredInstances)} instances." |
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 os | |
import datetime | |
import json | |
# convert time to human readable format | |
def convertDate(timestamp): | |
d = datetime.datetime.utcfromtimestamp(timestamp) | |
formatedDate = d.strftime('%b %d, %Y') | |
return formatedDate |
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
{ | |
"BoxOffice2022": [ | |
{ | |
"PutRequest": { | |
"Item":{ | |
"title":{ | |
"S": "Top Gun: Maverick" | |
}, | |
"release_date":{ | |
"S": "11-12-2022" |
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
mport * as React from "react" | |
import { Frame, useCycle, addPropertyControls, ControlType } from "framer" | |
// Open Preview (CMD + P) | |
// API Reference: https://www.framer.com/api | |
interface Props { | |
iconName: string | |
tint: string | |
} |
NewerOlder