Install
1
Install the plugin$
npx claudepluginhub Sahib-Sawhney-WH/dapr-claude-plugin --plugin daprWant just this command?
Add to a custom plugin, then install with one command.
Description
Generate DAPR component YAML files for state stores, pub/sub, bindings, and secrets across Azure, AWS, and GCP
Command Content
DAPR Component Generator
Generate properly configured DAPR component YAML files for various backends across multiple cloud providers.
Behavior
When the user runs /dapr:component:
-
Select Component Type
- State Store (Redis, Cosmos DB, DynamoDB, Firestore, PostgreSQL, MongoDB)
- Pub/Sub (Redis, Service Bus, SNS/SQS, GCP Pub/Sub, Kafka, RabbitMQ)
- Secret Store (Key Vault, Secrets Manager, GCP Secret Manager, Local File, Kubernetes)
- Binding (Blob Storage, S3, GCS, Event Grid, Kinesis, Cron, HTTP)
-
Select Cloud Provider Based on component type, show relevant options:
- Local development options (Redis, local file, LocalStack, emulators)
- Azure (Cosmos DB, Service Bus, Key Vault, Blob Storage)
- AWS (DynamoDB, SNS/SQS, Secrets Manager, S3, Kinesis, SES)
- GCP (Firestore, Pub/Sub, Secret Manager, Cloud Storage)
-
Configure Settings
- Component name
- Connection details
- Authentication method (managed identity vs. connection string)
- Component-specific settings
-
Generate YAML Create component file in
./components/directory with:- Proper schema and version
- All required metadata
- Secret references (not plain text)
- Comments explaining settings
-
Validate Run validation to ensure component is correct
Arguments
-
$ARGUMENTS- Component type and backend:Local/Generic:
state redis- Redis state storepubsub redis- Redis pub/subbinding cron- Cron scheduler
Azure:
state cosmos- Azure Cosmos DBpubsub servicebus- Azure Service Bussecrets keyvault- Azure Key Vaultbinding blob- Azure Blob Storagebinding eventhubs- Azure Event Hubs (streaming/IoT)binding signalr- Azure SignalR (real-time WebSocket)binding queuestorage- Azure Queue Storage (simple queues)
AWS:
state dynamodb- AWS DynamoDBpubsub snssqs- AWS SNS/SQSsecrets awssecrets- AWS Secrets Managerbinding s3- AWS S3binding kinesis- AWS Kinesisbinding sqs- AWS SQSbinding ses- AWS SES (email)
GCP:
state firestore- GCP Firestorepubsub gcppubsub- GCP Pub/Subsecrets gcpsecrets- GCP Secret Managerbinding gcs- GCP Cloud Storage
Common Bindings:
binding http- HTTP/REST API calls and webhooksbinding kafka- Apache Kafka messagingbinding rabbitmq- RabbitMQ queuesbinding mqtt- MQTT for IoT devicesbinding postgresql- PostgreSQL databasebinding mysql- MySQL/MariaDB databasebinding redis- Redis caching/queuesbinding smtp- Email sendingbinding influxdb- InfluxDB time-seriesbinding localstorage- Local filesystembinding graphql- GraphQL endpoints
Examples
# Local development
/dapr:component state redis
/dapr:component binding cron
# Azure
/dapr:component state cosmos
/dapr:component pubsub servicebus
/dapr:component secrets keyvault
/dapr:component binding eventhubs
/dapr:component binding signalr
/dapr:component binding queuestorage
# AWS
/dapr:component state dynamodb
/dapr:component pubsub snssqs
/dapr:component secrets awssecrets
/dapr:component binding s3
# GCP
/dapr:component state firestore
/dapr:component pubsub gcppubsub
/dapr:component secrets gcpsecrets
# Common Bindings
/dapr:component binding http
/dapr:component binding kafka
/dapr:component binding rabbitmq
/dapr:component binding mqtt
/dapr:component binding postgresql
/dapr:component binding smtp
Generated Components
State Store - Redis (Local)
# components/statestore.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
type: state.redis
version: v1
metadata:
- name: redisHost
value: localhost:6379
- name: actorStateStore
value: "true"
State Store - Cosmos DB (Azure)
# components/statestore.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
type: state.azure.cosmosdb
version: v1
metadata:
- name: url
value: https://{account}.documents.azure.com:443/
- name: database
value: daprdb
- name: collection
value: state
- name: azureClientId
value: "{managed-identity-client-id}"
Pub/Sub - Service Bus (Azure)
# components/pubsub.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: pubsub
spec:
type: pubsub.azure.servicebus.topics
version: v1
metadata:
- name: namespaceName
value: "{namespace}.servicebus.windows.net"
- name: azureClientId
value: "{managed-identity-client-id}"
- name: consumerID
value: "{app-id}"
Secret Store - Key Vault (Azure)
# components/secretstore.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: secretstore
spec:
type: secretstores.azure.keyvault
version: v1
metadata:
- name: vaultName
value: "{vault-name}"
- name: azureClientId
value: "{managed-identity-client-id}"
Binding - Cron (Scheduled)
# components/scheduled-job.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: scheduled-job
spec:
type: bindings.cron
version: v1
metadata:
- name: schedule
value: "@every 5m"
State Store - DynamoDB (AWS)
# components/statestore.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
type: state.aws.dynamodb
version: v1
metadata:
- name: table
value: "dapr-state"
- name: region
value: "us-east-1"
# Use IRSA on EKS - omit accessKey/secretKey
- name: accessKey
secretKeyRef:
name: aws-credentials
key: access-key
- name: secretKey
secretKeyRef:
name: aws-credentials
key: secret-key
Pub/Sub - SNS/SQS (AWS)
# components/pubsub.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: pubsub
spec:
type: pubsub.aws.snssqs
version: v1
metadata:
- name: region
value: "us-east-1"
- name: accessKey
secretKeyRef:
name: aws-credentials
key: access-key
- name: secretKey
secretKeyRef:
name: aws-credentials
key: secret-key
State Store - Firestore (GCP)
# components/statestore.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
type: state.gcp.firestore
version: v1
metadata:
- name: project_id
value: "my-gcp-project"
- name: type
value: "service_account"
# Use Workload Identity on GKE - omit credentials
Pub/Sub - GCP Pub/Sub
# components/pubsub.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: pubsub
spec:
type: pubsub.gcp.pubsub
version: v1
metadata:
- name: projectId
value: "my-gcp-project"
# Use Workload Identity on GKE
Binding - S3 (AWS)
# components/s3-storage.yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: s3-storage
spec:
type: bindings.aws.s3
version: v1
metadata:
- name: bucket
value: "my-bucket"
- name: region
value: "us-east-1"
- name: accessKey
secretKeyRef:
name: aws-credentials
key: access-key
- name: secretKey
secretKeyRef:
name: aws-credentials
key: secret-key
Interactive Prompts
When running without arguments, prompt for:
- Component type (state/pubsub/secrets/binding)
- Backend service
- Environment (local/azure/other)
- Component name
- Connection details based on backend
Best Practices Applied
- Uses managed identity for Azure services
- Separates dev/prod configurations
- Includes comments for customization
- Sets appropriate defaults
- Validates before saving
Stats
Stars1
Forks0
Last CommitDec 24, 2025
Actions