Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Set the region
REGION="us-west-2"
# Set the log group name and metric namespace
LOG_GROUP_NAME="AmazonBedrockGuardrailsLogs" # Replace with your log group name
METRIC_NAMESPACE="/aws/Bedrock/Guardrails"
# Get the Guardrail ID from the environment variable
@MattJColes
MattJColes / app.py
Created September 30, 2021 13:35
CDK imports 01
#!/usr/bin/env python3
from aws_cdk import core as cdk
# For consistency with TypeScript code, `cdk` is the preferred import name for
# the CDK's core module. The following line also imports it as `core` for use
# with examples from the CDK Developer's Guide, which are in the process of
# being updated to use `cdk`. You may delete this import if you don't need it.
from aws_cdk import core
from cdk_fun.cdk_fun_stack import CdkFunStack
existing_environment = core.Environment(
# can use env imports if using Dev / UAT / Prod
@MattJColes
MattJColes / traffic_lights.py
Created June 12, 2021 08:14
Using RPi to control LED traffic lights, iterate through each individually, then flash all twice. Keep loopin!
import RPi.GPIO as gpio
import time
gpio.setmode(gpio.BCM)
gpio.setup(5, gpio.OUT)
gpio.setup(6, gpio.OUT)
gpio.setup(13, gpio.OUT)
def main():