Skip to content

Instantly share code, notes, and snippets.

{
"family": "Web-App-Task",
"taskDefinitionArn": "arn:aws:ecs:<region>:1234567:task-definition/Web-App-Task:1",
"networkMode": "bridge",
"revision": 1,
"volumes": [
{
"name": "php-code",
"dockerVolumeConfiguration": {
"scope": "task",
FROM nginx:alpine
RUN apk update && apk add bash
COPY nginx.conf /etc/nginx/nginx.conf
FROM php:7-fpm
WORKDIR /var/www/html
COPY ./index.php .
EXPOSE 9000
<?php
phpinfo();
@5sfayas
5sfayas / find-ip-by-tag-aws.py
Created July 13, 2020 13:59
Find IP address of aws Instances using tag
!#/bin/python
import boto3
import jason
def find-ip(client,tagkey,tagvalue):
response = client.describe_instances(
Filters=[{
'Name': 'instance-state-name',
'Values': [
@5sfayas
5sfayas / buckets.tf
Created May 24, 2020 15:35 — forked from nagelflorian/buckets.tf
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@5sfayas
5sfayas / buckets.tf
Created May 24, 2020 15:35 — forked from nagelflorian/buckets.tf
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@5sfayas
5sfayas / lambda_handler.py
Created May 21, 2020 18:02 — forked from djg07/lambda_handler.py
DynamoDB Streams Lambda Handler
import json
print('Loading function')
def lambda_handler(event, context):
print('------------------------')
print(event)
#1. Iterate over each record
try:
for record in event['Records']: