Skip to content

Instantly share code, notes, and snippets.

@sampreethamithkumar
sampreethamithkumar / List_Resources_Across_Accounts.MD
Last active December 23, 2024 01:16
List Resources Across Accounts

Script Name

list_resources_across_accounts.sh

Description

This script is designed to list resources across multiple AWS accounts. It specifically targets detached EBS volumes but can be easily modified to list other types of resources as needed. The script iterates through a list of AWS accounts defined in the AWS config file, retrieves detached EBS volumes information, and outputs the results to a text file.

Prerequisites

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
unencrypted-resources
Globals:
Function:
Timeout: 600
@sampreethamithkumar
sampreethamithkumar / Makefile
Last active August 9, 2022 06:29
Makefile for deploying react app in private subnet
# TODO: Update the AwsAccountID
AwsAccountId?=
AwsDefaultRegion?=ap-southeast-2
AppName?=PrivateHosting
ImageRepoName?=ecr-react-app
ImageTag?=latest
DockerRegistoryHost=${AwsAccountId}.dkr.ecr.${AwsDefaultRegion}.amazonaws.com
deploy-ecr:
aws cloudformation deploy \
@sampreethamithkumar
sampreethamithkumar / template.yaml
Last active August 9, 2022 06:21
Private Hosting React App
AWSTemplateFormatVersion: 2010-09-09
Description: React App private hosting
Parameters:
PrefixName:
Type: String
DockerRegistoryHost:
Type: String
AWSTemplateFormatVersion: 2010-09-09
Description: React App private hosting
Parameters:
EcrName:
Type: String
Resources:
Ecr:
Type: AWS::ECR::Repository
@sampreethamithkumar
sampreethamithkumar / .dockerignore
Created July 25, 2022 10:57
Docker build ignore files and folder for react app
build
node_modules
@sampreethamithkumar
sampreethamithkumar / dockerfile
Created July 25, 2022 10:54
Docker file for building and serving react app through Nginx
# Build Environment
FROM node:14.2.0 as build
# Working Directory
WORKDIR /app
#Copying node package files to working directory
COPY package.* .
#Installing app dependency
@sampreethamithkumar
sampreethamithkumar / nginx.conf
Created July 25, 2022 10:37
Nginx Config file
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}