Skip to content

Instantly share code, notes, and snippets.

View peterjgrainger's full-sized avatar
🐱

Peter Grainger peterjgrainger

🐱
View GitHub Profile
public void readSecret() {
try {
URL yahoo = new URL("http://localhost:2773/secretsmanager/get?secretId=/authorizer/jwt");
URLConnection yc = yahoo.openConnection();
yc.setRequestProperty("X-Aws-Parameters-Secrets-Token", System.getenv("AWS_SESSION_TOKEN"));
BufferedReader in = new BufferedReader(
new InputStreamReader(
yc.getInputStream()));
String inputLine;
@peterjgrainger
peterjgrainger / get-request-minute.py
Created August 23, 2023 11:16
Requests per minute
# Use cloudwatch API with Boto3 to get the highest requests per second over a given month for wafv2
import boto3
from datetime import datetime, timedelta
client = boto3.client("cloudwatch")
response = client.get_metric_statistics(
Namespace="AWS/WAFV2",
MetricName="AllowedRequests",
Dimensions=[
{"Name": "WebACL", "Value": "test"},