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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowCloudFrontOACAccessToAllObjects", | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "cloudfront.amazonaws.com" | |
}, | |
"Action": "s3:GetObject", |
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
#!/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) |
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
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', |
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
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) => { |
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
name: CI/CD Pipeline | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest |
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
name: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest |
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" # 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" |
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: nginx-deployment | |
spec: | |
replicas: 3 | |
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: v1 | |
kind: Service | |
metadata: | |
name: nginx-service | |
spec: | |
selector: | |
app: nginx | |
ports: | |
- protocol: TCP | |
port: 80 |
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: nginx-deployment | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: nginx | |
template: |
NewerOlder