Showing posts with label aws. Show all posts
Showing posts with label aws. Show all posts

2023-04-21

aws lambda

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/migration-whats-different.html

A noticable change from the the SDK for Java 1.x to the SDK for Java 2.x is the package name change. Package names begin with software.amazon.awssdk in SDK 2.x, whereas the SDK 1.x uses com.amazonaws.


https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps

https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda

https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/dynamodb/


https://docs.aws.amazon.com/lambda/latest/dg/java-samples.html

https://docs.aws.amazon.com/lambda/latest/dg/getting-started.html

https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaScheduledEvents_section.html

https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html


https://www.youtube.com/watch?v=A1rYiHTy9Lg Deploy a SpringBoot API on AWS Lambda in 10 minutes

        "Access-Control-Allow-Credentials" : true // Required for cookies, authorization headers with HTTPS 
backend must return the applicable CORS headers https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors-console.html


2023-04-18

aws dynamodb

 aws dynamodb list-tables --profile userX --region us-east-1

api: https://docs.aws.amazon.com/cli/latest/reference/dynamodb/index.html#cli-aws-dynamodb

list-tables

get-item put-item update-item delete-item batch-get-item batch-write-item

query scan

https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/javav2/example_code/dynamodb/src/main/java/com/example/dynamodb/ListTables.java

https://javatodev.com/spring-boot-dynamo-db-crud-tutorial/ (old java1 example, but with dynamodb from docker) 

https://www.techgeeknext.com/cloud/spring-boot-aws-dynamodb-crud-example

$ docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -inMemory -sharedDb

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/examples-dynamodb-enhanced.html

https://bluexp.netapp.com/blog/aws-cvo-blg-dynamodb-pricing-how-to-optimize-usage-and-reduce-costs

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.html

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/service_code_examples.html

2022-11-07

AWS EC2 Amazon Linux

#https://dev.to/viralsangani/be-anonymous-create-your-own-proxy-server-with-aws-ec2-2k63

#1) amazon linux

#2) spot instance (permanent)

#3) key ssh

#4) network group All,ssh,http, https


#!/bin/bash

sudo yum update -y

sudo yum install -y httpd

sudo systemctl start httpd

sudo systemctl enable httpd

cd /var/www/html

sudo sh -c 'echo "hello from $(hostname -f)" > /var/www/html/index.html'


####################

 #If you are using Amazon Linux 2023 (AL2023)

# 1. Install compilation tools and dependencies

sudo dnf groupinstall -y "Development Tools"

sudo dnf install -y asciidoc


# 2. Download and extract the latest Tinyproxy release

cd /tmp

wget https://github.com/tinyproxy/tinyproxy/releases/download/1.11.1/tinyproxy-1.11.1.tar.gz

tar -xzf tinyproxy-1.11.1.tar.gz

cd tinyproxy-1.11.1

./configure --prefix=/usr --sysconfdir=/etc

make

sudo make install


# 4. Create a systemd service file so it can run as a daemon

sudo tee /etc/systemd/system/tinyproxy.service > /dev/null << 'EOF'

[Unit]

Description=Tinyproxy lightweight HTTP proxy

After=network.target


[Service]

Type=simple

ExecStart=/usr/bin/tinyproxy -d -c /etc/tinyproxy/tinyproxy.conf

User=nobody

Group=nobody

Restart=on-failure


[Install]

WantedBy=multi-user.target

EOF


# 5. Create required runtime directory and permissions

sudo mkdir -p /var/run/tinyproxy

sudo chown nobody:nobody /var/run/tinyproxy

#####################

sudo sed -i 's/^Allow 127\.0\.0\.1$/#Allow 127.0.0.1/' /etc/tinyproxy/tinyproxy.conf

sudo sed -i 's/^Allow ::1$/#Allow ::1/' /etc/tinyproxy/tinyproxy.conf


# 6. Enable and start the service

sudo systemctl daemon-reload

sudo systemctl enable --now tinyproxy



#curl -i -x http://YOUR_EC2_PUBLIC_IP:8888 http://ifconfig.me




2022-10-23

AWS Certified Cloud Practitioner Certification Course (CLF-C01)

AWS Certified Cloud Practitioner Training 2020 - Full Course

https://youtu.be/3hLmDS179YE?t=3266 EC2 create witch IAM role to access SSM 

S3 - CloudFront - edge locations

https://youtu.be/3hLmDS179YE?t=6567 AWS Marketplace

AWS Certified Cloud Practitioner Certification Course (CLF-C01) - Pass the Exam!

 https://youtu.be/SOTamWNgDKc?t=14799 AWS toolkit for VSCode


AWS for Startups - Deploying with AWS: https://youtu.be/U3VSJhaC4kc

##############


https://github.com/Mainak99/AWS-Slides

2022-09-15

AWS

 
SIMPLE MONTHLY CALCULATOR

https://www.youtube.com/watch?v=U3VSJhaC4kc

CheatSheet:

EB https://www.youtube.com/watch?v=RrKRN9zRBWs&t=0s


ECS and Fargate 2:54 

X-Rays 3:20 https://www.youtube.com/watch?v=RrKRN9zRBWs&t=0s


Route 53 3:44 https://youtu.be/RrKRN9zRBWs?t=13482



AWS CLI SDK https://youtu.be/RrKRN9zRBWs?t=14652


KMS https://youtu.be/RrKRN9zRBWs?t=15254


Kinesis https://youtu.be/RrKRN9zRBWs?t=17561

Cognito  https://youtu.be/RrKRN9zRBWs?t=15919

SNS  https://youtu.be/RrKRN9zRBWs?t=16378

SQS https://youtu.be/RrKRN9zRBWs?t=17013

https://www.linkedin.com/pulse/sqs-send-receive-delete-messages-nodejs-karandeep-singh-/?trk=articles_directory
var AWS = require('aws-sdk')
var sqs = new AWS.SQS();


// For Standard Queue
exports.handler = async (event) => {
    
    var params = {
      DelaySeconds: 2,
      MessageAttributes: {
        "Author": {
          DataType: "String",
          StringValue: "Karandeep Singh"
        },
      },
      MessageBody: "TEST of the SQS service.",
      QueueUrl: "https://sqs.us-east-1.amazonaws.com/570411717331/MyTestQueue"
    };
    
    let queueRes = await sqs.sendMessage(params).promise();
    const response = {
        statusCode: 200,
        body: queueRes,
    };
    
    return response; 
};.
DynamoDB 5:49 https://www.youtube.com/watch?v=RrKRN9zRBWs&t=21255s



EC2 https://youtu.be/RrKRN9zRBWs?t=25811



VPC https://youtu.be/RrKRN9zRBWs?t=27358



ELB 7:55 https://youtu.be/RrKRN9zRBWs?t=28085



Security Groups https://youtu.be/RrKRN9zRBWs?t=28462


NACLs https://youtu.be/RrKRN9zRBWs?t=28670



IAM 8:35 https://youtu.be/RrKRN9zRBWs?t=32553



CloudFront 9:54 https://youtu.be/RrKRN9zRBWs?t=33694



CloudTrail 9:34 https://youtu.be/RrKRN9zRBWs?t=34481


AWS Quick Starts are collection of pre-built CloudFormation templates 9:42
CloudFormation  10:40 https://youtu.be/RrKRN9zRBWs?t=38487



SAM CLI https://youtu.be/RrKRN9zRBWs?t=38979



CI https://youtu.be/RrKRN9zRBWs?t=39500



CodeCommit https://youtu.be/RrKRN9zRBWs?t=39736


CodeBuild https://youtu.be/RrKRN9zRBWs?t=40786



Docker commands 11:00


part 2
https://youtu.be/eCopK1RoyFM?t=979

https://youtu.be/eCopK1RoyFM?t=1454

RDS 0:30 https://youtu.be/eCopK1RoyFM?t=4000

S3 CheatSheet https://youtu.be/eCopK1RoyFM?t=6728

ElastiCache CS 2:02 https://youtu.be/eCopK1RoyFM?t=7350

Lambda CS https://youtu.be/eCopK1RoyFM?t=8287

API Gateway 2:28 https://youtu.be/eCopK1RoyFM?t=9030

Step Functions CS 3:45 https://youtu.be/eCopK1RoyFM?t=13433


CloudWatch
Developer Associate CS? 3:47