agent: | Auto Exec |
What is an "Expert"? How do we create our own expert?
Add credentials for various integrations
Managing workspaces and access control
DagKnows Architecture Overview
Setting up SSO via Azure AD for Dagknows
Enable "Auto Exec" and "Send Execution Result to LLM" in "Adjust Settings" if desired
(Optionally) Add ubuntu user to docker group and refresh group membership
Deployment of an EKS Cluster with Worker Nodes in AWS
Adding, Deleting, Listing DagKnows Proxy credentials or key-value pairs
Comprehensive AWS Security and Compliance Evaluation Workflow (SOC2 Super Runbook)
AWS EKS Version Update 1.29 to 1.30 via terraform
Instruction to allow WinRM connection
MSP Usecase: User Onboarding Azure + M365
Post a message to a Slack channel
How to debug a kafka cluster and kafka topics?
Open VPN Troubleshooting (Powershell)
Execute a simple task on the proxy
Assign the proxy role to a user
Create roles to access credentials in proxy
Install OpenVPN client on Windows laptop
Setup Kubernetes kubectl and Minikube on Ubuntu 22.04 LTS
Install Prometheus and Grafana on the minikube cluster on EC2 instance in the monitoring namespace
update the EKS versions in different clusters
AI agent session 2024-09-12T09:36:14-07:00 by Sarang Dharmapurikar
Parse EDN content and give a JSON out
Check whether a user is there on Azure AD and if the user account status is enabled
Get the input parameters of a Jenkins pipeline
Working with AWS DynamoDB
This runbook allows users to list all available tables in the database, enabling easy management and overview. Additionally, DynamoDB provides the flexibility to access and modify individual table items, supporting a wide range of use cases from web applications to IoT systems, by efficiently handling data retrieval and updates.
- 1YlDLNOTAFYgvxf6MUm1wList All AWS DynamoDB tables
1
There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.This task retrieves names of all AWS DynamoDB tables in a specified AWS account and region, useful for inventory checks, administrative tasks, or automating operations across multiple tables.
inputsoutputsimport boto3 from botocore.exceptions import BotoCoreError, ClientError # Specify the region name here; set it to None to list tables from all regions # Example: 'ap-south-1' for a specific region, or None for all regions #region_name = 'us-east-1' creds = _get_creds(cred_label)['creds'] access_key = creds['username'] secret_key = creds['password'] def list_tables_in_region(dynamodb_client, region): """List tables in a given region using the provided DynamoDB client.""" paginator = dynamodb_client.get_paginator('list_tables') for page in paginator.paginate(): if page['TableNames']: for table in page['TableNames']: print(f"Region: {region}, Table: {table}") else: print(f"Region: {region}, No DynamoDB tables found.") try: if region_name: print(f"Listing DynamoDB tables from the region: {region_name}...") dynamodb_client = boto3.client( 'dynamodb', aws_access_key_id=access_key, aws_secret_access_key=secret_key, region_name=region_name ) list_tables_in_region(dynamodb_client, region_name) else: print("Listing DynamoDB tables from all regions...") ec2_client = boto3.client( 'ec2', aws_access_key_id=access_key, aws_secret_access_key=secret_key,region_name='us-east-1' ) regions = [region['RegionName'] for region in ec2_client.describe_regions()['Regions']] for region in regions: dynamodb_client = boto3.client( 'dynamodb', aws_access_key_id=access_key, aws_secret_access_key=secret_key, region_name=region_name ) list_tables_in_region(dynamodb_client, region) except ClientError as e: print(f"A client error occurred: {e.response['Error']['Message']}. Please check your AWS configuration and permissions.") except BotoCoreError as e: print(f"A BotoCore error occurred: {e}. This might be a network issue or a problem with your AWS SDK setup.") except Exception as e: print(f"An unexpected error occurred: {e}. This might be due to unexpected issues in the script or the environment.") context.proceed = Falsecopied1 - 2yoHHDsF3cmAry80zyBV3Access/Modify AWS DynamoDB Table Item
2
Access/Modify AWS DynamoDB Table Item
There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.This task includes fetching (accessing) data using item keys and updating or altering (modifying) table data(optional).
inputsoutputsimport boto3 from botocore.exceptions import BotoCoreError, ClientError creds = _get_creds(cred_label)['creds'] access_key = creds['username'] secret_key = creds['password'] # Specify the AWS region, table name, and primary key for the DynamoDB item #region_name = 'us-east-1' # e.g., 'ap-south-1' #table_name = 'Music' # e.g., 'your_table_name' #primary_key = {"Artist": "Acme Band", "SongTitle": "Happy Day"} #primary_key = {'PrimaryKeyName': 'PrimaryKeyValue'} # Replace with your primary key and its value try: # Initialize DynamoDB client for the specified region dynamodb = boto3.resource('dynamodb', aws_access_key_id=access_key,aws_secret_access_key=secret_key,region_name=region_name) # Initialize the table table = dynamodb.Table(table_name) # Fetch the item response = table.get_item(Key=primary_key) item = response.get('Item') if item: print("Fetched item:", item) # Example logic for updating the item (if needed) # update_key = 'AttributeNameToUpdate' # Attribute you want to update # new_value = 'NewValue' # New value for the attribute # update_response = table.update_item( # Key=primary_key, # UpdateExpression=f"SET {update_key} = :val", # ExpressionAttributeValues={':val': new_value}, # ReturnValues="UPDATED_NEW" # ) # print("Updated item:", update_response) else: print("Item not found.") except ClientError as e: print(f"A client error occurred: {e.response['Error']['Message']}. Please check your AWS configuration and permissions.") except BotoCoreError as e: print(f"A BotoCore error occurred: {e}. This might be a network issue or a problem with your AWS SDK setup.") except Exception as e: print(f"An unexpected error occurred: {e}. This might be due to unexpected issues in the script or the environment.")copied2