Skip to content

Instantly share code, notes, and snippets.

View uurtech's full-sized avatar
✈️
Works

Ugur KAZDAL uurtech

✈️
Works
View GitHub Profile
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCloudFrontOACAccessToAllObjects",
"Effect": "Allow",
"Principal": {
"Service": "cloudfront.amazonaws.com"
},
"Action": "s3:GetObject",
@uurtech
uurtech / gist:198f56c337dc9159c2df1f5873076d9a
Created April 29, 2025 12:53
scan ACL for buckets in the region
#!/bin/bash
# Set the AWS region
REGION="us-west-2"
echo "Listing S3 buckets in region $REGION and their permissions..."
# Get buckets only in the specified region
echo "Finding buckets in region $REGION..."
BUCKETS=$(aws s3api list-buckets --region $REGION --query "Buckets[].Name" --output text)
const { spawn } = require('child_process');
module.exports.slackCommandHandler = async (event) => {
const { text } = event.body;
const deployWorkflow = spawn('curl', [
'-X', 'POST',
'-H', 'Authorization: token YOUR_GITHUB_TOKEN',
'-H', 'Accept: application/vnd.github.v3+json',
'https://api.github.com/repos/your_username/your_repo/actions/workflows/your_workflow_dispatch.yml/dispatches',
const express = require('express');
const { spawn } = require('child_process');
const bodyParser = require('body-parser');
const app = express();
const port = 3000;
app.use(bodyParser.urlencoded({ extended: true }));
app.post('/deploy', (req, res) => {
name: CI/CD Pipeline
on:
pull_request:
types: [opened, synchronize]
jobs:
deploy:
runs-on: ubuntu-latest
name: CI/CD Pipeline
on:
push:
branches:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
provider "aws" {
region = "us-east-1" # Update with your desired AWS region
}
# Create an S3 bucket for storing website files
resource "aws_s3_bucket" "website_bucket" {
bucket = "your-unique-bucket-name" # Update with your desired bucket name
website {
index_document = "index.html"
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template: