Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
if(infra == code){return true}

Exequiel Barrirero exequielrafaela

💭
if(infra == code){return true}
View GitHub Profile
@exequielrafaela
exequielrafaela / aws_create_users_ubuntu.sh
Created Dec 17, 2021 — forked from vasansr/aws_create_users_ubuntu.sh
AWS User Data Script to create users when launching an Ubuntu server EC2 instance
View aws_create_users_ubuntu.sh
#!/bin/bash
#
# Initial script to create users when launching an Ubuntu server EC2 instance
#
declare -A USERKEY
#
# Create one entry for every user who needs access. Be sure to change the key to their
View aws-backup-table-1.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
"AWS Services","Key Points"
"AWS Backup","AWS Backup is a centralised backup service that makes it easy and cost-effective for you to backup your application data across AWS services in the AWS Cloud, helping you meet your business and regulatory backup compliance requirements.You should use AWS Backup to manage and monitor backups across the AWS services you use, from a single place.Services supported:EBS (it leverages EBS Snapshots)RDS (it supports RDS Aurora Automated Backups and RDS Snapshots)EFS (transition to cold storage is supported for this service)DynamoDBFSxStorage Gateway.You pay for the amount of backup storage you use and the amount of backup data you restore in the month. [*]"
"AWS Data Lifecycle Manager","DLM provides a simple way to manage the lifecycle of EBS resources, such as volume snapshots.You should use DLM when you want to automate the creation, retention, and deletion of EBS snapshots.It is simple to implement. Once set up, it can be monitored easily through CloudWatch.Pricing is mod
@exequielrafaela
exequielrafaela / aws_s3_storage_bucket.tf
Last active Oct 6, 2020
AWS S3 Secure Multipurpose Storage Bucket
View aws_s3_storage_bucket.tf
#
## Examples
# - Complete | https://github.com/binbashar/terraform-aws-s3-bucket/tree/master/examples/complete
# - Replication | https://github.com/binbashar/terraform-aws-s3-bucket/tree/master/examples/s3-replication
#
#=============================#
# Module Instanciation #
#=============================#
module "s3_bucket" {
@exequielrafaela
exequielrafaela / aws-s3api-delete-objects-from-aws-s3api-list.sh
Last active Oct 6, 2020
aws s3api delete-objects from aws s3api list
View aws-s3api-delete-objects-from-aws-s3api-list.sh
AWS_SHARED_CREDENTIALS_FILE="/home/user/.aws/test/credentials" \
AWS_CONFIG_FILE="/home/user/.aws/test/config" \
aws s3api delete-objects \
--profile test-shared-devops \
--bucket test-shared-gdrive-backup \
--delete \
"$(AWS_SHARED_CREDENTIALS_FILE="/home/user/.aws/test/credentials" AWS_CONFIG_FILE="/home/user/.aws/test/config" aws s3api list-object-versions \
--profile test-shared-devops \
--bucket test-shared-gdrive-backup | jq '{Objects: [.Versions[] | {Key:.Key, VersionId : .VersionId}], Quiet: false}')"
@exequielrafaela
exequielrafaela / gh-pages-deploy.md
Created Aug 5, 2020 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).
View gh-pages-deploy.md

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

View LimitRegionSizeCondition.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "MultiServiceFullAccessCustom",
"Effect": "Allow",
"Action": [
"ec2:*",
"rds:*"
],
@exequielrafaela
exequielrafaela / aws_cloudfront_no_origin_s3_restriction_test.sh
Last active Oct 28, 2019
Scurity & Audit Bash script functions based on awscli to get differente AWS services information for different scenarios
View aws_cloudfront_no_origin_s3_restriction_test.sh
#!/usr/bin/env bash
#
# AWS ENV vars for your project (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)
#
# AWS_PROFILE – Specifies the name of the CLI profile with the credentials and options to use.
# This can be the name of a profile stored in a credentials (~/.aws/credentials) or config (~/.aws/config)
# file, or the value default to use the default profile. If you specify this environment variable,
# it overrides the behavior
# of using the profile named [default] in the configuration file.
@exequielrafaela
exequielrafaela / prometheus.yml
Created Oct 17, 2019 — forked from reachlin/prometheus.yml
sample prometheus configuration explained
View prometheus.yml
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@exequielrafaela
exequielrafaela / DEVELOPMENT_WORKFLOW_A.md
Last active Jun 28, 2019
CI/CD Development Workflow w/ Spinnaker + Jenkins
View DEVELOPMENT_WORKFLOW_A.md

Workflow implementation example A

Jenkins as 1ry executor with dev/stg/prod docker image tags prefix

DEV

  1. Scm-github / scm-bitbucket: git push / PR to develop branch.
  2. Jenkins webhook automatically/manual triggers job which will build docker image w/ unit tests (optional can be in a separate pre-dependency Jenkins / CircleCI job) adding dev-build# tag -> If OK.
  3. Push docker image to AWS ECR.
  4. New docker image with tag dev-* detected by Spinnaker hook that auto triggers a deployment pipeline with DB migrations + ENV vars secret mgmt
@exequielrafaela
exequielrafaela / .gitignore
Last active Jul 6, 2019
Reference .gitignore
View .gitignore
# Hidden files #
################
.*
#
# Except
#
!*.env.example
!*.dockeringnore
!*.hosts
!/.gitignore