Skip to content

Instantly share code, notes, and snippets.

View matwerber1's full-sized avatar

Mathew Werber matwerber1

  • Seattle
View GitHub Profile
@matwerber1
matwerber1 / compose.yml
Last active November 9, 2023 18:16
AWS - Containers - Compose - mount ~/.aws/cred
version: "3.8"
services:
AwsCLI:
image: public.ecr.aws/aws-cli/aws-cli
container_name: aws-cli
platform: linux/x86_64
volumes:
- ~/.aws/:~/.aws/ # Mount local credentials into container to use AWS CLI/SDK
environment:
@matwerber1
matwerber1 / aws-profile
Created November 27, 2023 05:46
Super Duper AWS CLI Profile Switching Script
#! /bin/bash -i
set -e
# Constants
PROFILE_NICKNAME_FILE=".awsprofile.env"
AWS_CONFIG_FILE="$AWS_CONFIG_FILE"
# Variables
original_request="$1"
requested_profile=""
@matwerber1
matwerber1 / readme.md
Created December 13, 2023 08:01
Querying AWS Cost and Usage V2 (CURv2) with Amazon Athena - DDL and Queries

DDL for Athena Table

This could be improved, but does the trick for now. This is for a report configured as "daily" with resource IDs:

CREATE EXTERNAL TABLE IF NOT EXISTS `org_data`.`curv2` (
  `discount_bundled_discount` string,
  `discount_total_discount` string,
  `identity_line_item_id` string,
  `identity_time_interval` string,