Skip to content

Instantly share code, notes, and snippets.

@Jagdeep1
Jagdeep1 / anthropic_bedrock_model.py
Created February 25, 2026 14:38
anthropic_bedrock_model.py
"""Custom Strands model provider using Anthropic SDK with AWS Bedrock."""
import base64
import json
import logging
import mimetypes
from collections.abc import AsyncGenerator
from typing import Any, TypedDict, TypeVar, cast
import anthropic
"""Upload 10 PDF documents to a Strands agent using AnthropicBedrockModel.
Demonstrates that the Anthropic Messages API (via AnthropicBedrockModel) bypasses
the Bedrock Converse API's 5-document-per-request limit.
"""
from pathlib import Path
import strands
from anthropic_bedrock_model import AnthropicBedrockModel
from fpdf import FPDF
@Jagdeep1
Jagdeep1 / tf-pipeline.yaml
Created December 17, 2020 18:43
Azure DevOps pipeline to trigger terraform
trigger:
branches:
include:
- development
pool:
name: AWS_AGENT_POOL # Name of the agent pool that has AWS agent created in step 1
resources:
containers:
@Jagdeep1
Jagdeep1 / main.tf
Created December 17, 2020 17:16
Terraform example
terraform {
backend "s3" {
bucket = "tfrb"
key = "tfrb.state"
region = "eu-west-1"
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
trigger:
- development
variables:
- group: tf-aws-agent
pool:
vmImage: ubuntu-latest
steps:
@Jagdeep1
Jagdeep1 / vm-cfn.yaml
Last active March 28, 2022 05:15
VM CloudFormation template
AWSTemplateFormatVersion: "2010-09-09"
Description: |
VM for Azure DevOps build agent to execute terraform code
Resources:
AzTFVpc:
Type: AWS::EC2::VPC
Properties:
@Jagdeep1
Jagdeep1 / istio.multiple-ingress.yaml
Created August 9, 2020 16:47
Istio configuration to setup multiple ingress gateways
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: multiple-ingress-istiocontrolplane
spec:
profile: default
values:
security:
selfSigned: false
@Jagdeep1
Jagdeep1 / istio.overlay-properties.yaml
Last active August 11, 2020 07:57
Modify default property using overlay object
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: multiple-ingress-istiocontrolplane
spec:
profile: default
values:
security:
selfSigned: false
@Jagdeep1
Jagdeep1 / istio.default.yaml
Last active August 9, 2020 16:46
Sample istio profile
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: multiple-ingress-istiocontrolplane
spec:
profile: default
values:
security:
selfSigned: false
@Jagdeep1
Jagdeep1 / sample-app.yaml
Created June 6, 2020 15:52
Sample app with secret store volume mount
kind: Pod
apiVersion: v1
metadata:
name: nginx-secrets-store
spec:
containers:
- image: nginx
name: nginx
volumeMounts:
- name: secrets-store-inline