Skip to content

Instantly share code, notes, and snippets.

View helresa's full-sized avatar

Theresa Davis helresa

  • EcoGeek SL
  • Canary Islands, Spain
  • 03:47 (UTC)
View GitHub Profile
@helresa
helresa / aws_cloudwatch_alarm_rename.py
Created August 24, 2022 11:56 — forked from wys1203/aws_cloudwatch_alarm_rename.py
AWS CloudWatch alarm rename script
import sys
import boto3
def rename_alarm(alarm_name, new_alarm_name):
client = boto3.client('cloudwatch')
alarm = client.describe_alarms(AlarmNames=[alarm_name])
if not alarm:
raise Exception("Alarm '%s' not found" % alarm_name)
alarm = alarm['MetricAlarms'][0]
@helresa
helresa / lambda-at-edge.yaml
Created June 7, 2021 14:08 — forked from stu-smith/lambda-at-edge.yaml
Shows how to use CloudFormation to attach a Lambda@Edge function to a CloudFront distribution to add HSTS and CSP custom headers. NOTE: The stack must be updated twice: once with the condition set to false, and once with it set to true.
AWSTemplateFormatVersion: 2010-09-09
Parameters:
RootDomainName:
Type: String
IncludeLambdaEdge:
Type: String
AllowedValues: ['true', 'false']
Conditions:
IncludeLambdaEdge:
!Equals ['true', !Ref IncludeLambdaEdge]
Elastic Load Balancer, CloudFront and Let's Encrypt