Skip to content

Instantly share code, notes, and snippets.

View rayl15's full-sized avatar

Rahul Sharma rayl15

View GitHub Profile
@rayl15
rayl15 / region-cloud.yaml
Created February 20, 2025 08:44
AWS DataSync- In-Cloud Region
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS DataSync- In-Cloud Region
Resources:
s3Bucket:
Type: AWS::S3::Bucket
Properties:
PublicAccessBlockConfiguration:
BlockPublicAcls: True
BlockPublicPolicy: True
IgnorePublicAcls: True
@rayl15
rayl15 / datasync-onprem.yaml
Created February 20, 2025 08:28
AWS DataSync- On-Premises Region
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS DataSync- On-Premises Region
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Security
Parameters:
- kp
- Label:
GRANT CREATE ON *.* TO 'dbadmin';
GRANT ALTER ON *.* TO 'dbadmin';
GRANT DROP ON *.* TO 'dbadmin';
GRANT INDEX ON *.* TO 'dbadmin';
GRANT REFERENCES ON *.* TO 'dbadmin';
GRANT SELECT ON *.* TO 'dbadmin';
GRANT CREATE VIEW ON *.* TO 'dbadmin';
GRANT SHOW VIEW ON *.* TO 'dbadmin';
GRANT TRIGGER ON *.* TO 'dbadmin';
GRANT CREATE ROUTINE ON *.* TO 'dbadmin';
GRANT CREATE SESSION to DMS_USER;
GRANT SELECT ANY TABLE to DMS_USER;
GRANT SELECT ANY TRANSACTION to DMS_USER;
GRANT SELECT on DBA_TABLESPACES to DMS_USER;
--GRANT SELECT ON any-replicated-table to DMS_USER; ---has issues
GRANT EXECUTE on rdsadmin.rdsadmin_util to DMS_USER;
-- For Oracle 12c only:
GRANT LOGMINING to DMS_USER;
exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_VIEWS', 'DMS_USER', 'SELECT');
exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_TAB_PARTITIONS', 'DMS_USER', 'SELECT');
@rayl15
rayl15 / DMS.yaml
Last active February 13, 2025 05:18
DMS.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation Template for AWS Database Migration Tutorial.
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
-
Label:
default: "Database Migration Tutorial Lab Environment"
Parameters:
import boto3
import json
from botocore.exceptions import ClientError
def lambda_handler(event, context):
# Set the AWS Region
region = "us-east-1"
# Initialize the Bedrock Runtime client
client = boto3.client("bedrock-runtime", region_name=region)
@rayl15
rayl15 / bedrock.py
Last active January 24, 2025 09:37
Amazon Bedrock Sample
import boto3
import json
from botocore.exceptions import ClientError
# Set the AWS Region
region = "us-east-1"
# Initialize the Bedrock Runtime client
client = boto3.client("bedrock-runtime", region_name=region)
@rayl15
rayl15 / aws-sns-event-template-with-actual-ses-deliverynotification-sns-message Lambda function to process a Amazon SES Delivery Notification message from a SNS Topic into a DynamoDB Table
{
"Records": [
{
"EventSource":"aws:sns",
"EventVersion":"1.0",
"EventSubscriptionArn":"arn:aws:sns:us-west-2:xxxx:xxxx",
"Sns": {
"Type":"Notification",
"MessageId":"88B1B251-2E92-4FC3-BFAA-E3BBD0BAB10A",
"TopicArn":"arn:aws:sns:us-west-2:881222951025:survey-tool-ses-delivery",
@rayl15
rayl15 / lambda-helloWorld.js
Created November 18, 2016 12:32 — forked from robinvdvleuten/lambda-helloWorld.js
Sample "Hello, World!" Lambda function
/**
* Very simple Lambda which just returns a string on invocation.
*/
exports.handler = function(event, context) {
context.succeed('Hello, World!');
};