Skip to content

Instantly share code, notes, and snippets.

@scarbeau
scarbeau / monthly_aws_access_key_rotation_example.tf
Last active December 20, 2021 15:46
Terraform AWS Access Key Rotation
resource "aws_iam_user" "monthly_credential_rotation_example" {
provider = aws.local
name = "monthly-credential-rotation-example"
}
resource "aws_iam_access_key" "one" {
provider = aws.local
count = local.modmonth == 0 ? 1 : 0
user = aws_iam_user.monthly_credential_rotation_example.name
}
@mohammad-quanit
mohammad-quanit / ec2.txt
Last active December 28, 2022 23:40
Useful Commands & Scripts for AWS EC2 Service
# AWS EC2 Commands & Scripts
sudo su
yum update -y
**Getting metadata and other details of your ec2 instance**
curl http://169.254.169.254/latest/meta-data
curl http://169.254.169.254/latest/meta-data/ami-id
curl http://169.254.169.254/latest/meta-data/hostname
@nitrocode
nitrocode / update-ssm-tags.py
Last active October 1, 2020 23:33 — forked from pjaudiomv/update-ssm-tags.sh
Tags instances with detected platform_version
#!/usr/bin/env python
# Original: https://gist.github.com/pjaudiomv/ff5efca41cdb7244ef4416c6097f6a7a
import boto3
import pdb
TAG_PLATFORM_VERSION = 'platform_version'
def get_ssm_by_platform_versions(ssm_res):
@adrianbartyczak
adrianbartyczak / aws-signature-creator.sh
Created October 24, 2019 01:54
A signature creator for AWS signature version 4
#!/usr/bin/env bash
#
# File:
# aws-signature-creator.sh
#
# Description:
# A signature creator for AWS signature version 4
#
# References:
# https://czak.pl/2015/09/15/s3-rest-api-with-curl.html
@jonathonbyrdziak
jonathonbyrdziak / AddressHelper.php
Created August 18, 2010 20:20
Parse Address :: This function is designed to parse a complete street address using PHP. If it can't figure out the parsing itself, then it sends the address to google to have google parse the street address.
<?php
/**
* @author Jonathon Byrd
* @package Address Parsing
*
*
*/
class AddressHelper extends ObjectBase
{
/**