包含标签 aws 的文章

aws cdk introduction

What is the AWS CDK? The AWS Cloud Development Kit (CDK) ,a framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. CDK stack How does CDK work Build with high-level constructs that automatically provide sensible, secure defaults for your AWS resources, defining more infrastructure with less code. Use programming idioms like parameters, conditionals, loops, composition, and inheritance to model your system design from building blocks provided by AWS and others.……

阅读全文

SAA-CO1考试之路

考试心得 考试成绩 852 背景 工作用到aws不到1年 有多年java开发经验 linux管理员,持有RHCE 准备周期 3周從準備到考試 每天8-12小时 做过实验的知识点列表 VPN endpoint/nat gateway/internet gateway/vpn/subnet/ACL RDS/Aurora/Reshift/Aurora/DynamoDB (snaphost copy az or cross region,ebs type change ,autoscaling ,entryption ,backup/replica ,Multi A-z,read/write unit) Cloudfront (OAI,SSL certificat ,validation TTL ,pre-signed URL) S3 (static websit ,ACL ,bucket policy,lifecyle) ec2 (Cloudwath agent install,ebs mount/unmount,snapshot,elasticip binding) Cloud53 (A/alias .routing policy) Athena on S3 SQL QUERY……

阅读全文

aws x-ray

AWS X-Ray 可以帮助开发人员分析与调试分布式生产应用程序,例如使用微服务架构构建的应用程序。借助 X-Ray,您可以了解应用程序及其底层服务的执行方式,从而识别和排查导致性能问题和错误的根本原因。X-Ray 可在请求通过应用程序时提供请求的端到端视图,并展示应用程序底层组件的映射。您可以使用 X-Ray 分析开发和生产中的应用程序,从简单的三层应用程序到包含上千种服务的复杂微服务应用程序。 簡單來說,xray是用來追踪服務與服務之間鏈條,每個服務之間的請求內容,時間,參數等信息 用api-gateway 和 lambda 實驗 本文用到的例子是前面的博文: Aws cloudformation deploy lambda and apigateway 只需要額外做以下兩步 開啟api-gateway的x-ray,api gateway console-> apis->spring-boot-lambda->stages->Prod->logs/tracing->enable x-ray tracing 開啟lambda的x-ray,functions->spring-boot-lambda-LambdaSpringBootFunction-7CK2QHXPRA6F->aws x-ray:active tracing test x-ray:fire a request to api gateway open x-ray console:service map:you will see a picture like below: ……

阅读全文

accelerating aws migration

aws migration from OP to cloud這是aws最注重的部分,關於遷移技術,aws提供了各種各樣的工具,比如遷移數據庫(sts,dms),遷移workload(aws server migration service),協助你計劃遷移收集信息的工具(aws application discovery service),track遷移進程的工具(migration hub),遷移海量數據的aws snowball or snowmobile,s3 acceleration, 加速數據傳輸的 dierct connect等等,從網絡到數據庫到文件,給你武裝到牙齒 以下是兩篇關於數據遷移的好文 https://medium.com/@awsontop/aws-cloud-migration-strategy-and-process-6ed38479735a https://www.slideshare.net/AmazonWebServices/accelerating-your-portfolio-migration-to-aws-using-aws-migration-hub-ent321-reinvent-2017 ……

阅读全文

aws online analytical processing (or OLAP)

OLAP在線分析工具越來越來成熟,從開始的數據倉庫,到強大的elk,再到雲,比如aws的 gaq(glue-athena-quicksight),當然aws也有elk在線服務 gaq vs elk,實際上是一類的產品,glue提供了crawler去爬去數據,類似 logstash,athena提供查詢工具類似elasticsearch ,quicksight 跟 kibana一樣ui.gaq是aws雲端的服務,沒有辦法部署在線下,elk既可以部署在op也可以部署在cloud上 這篇文章來自 https://medium.com/localz-engineering/serverless-big-data-start-here-aws-glue-athena-quicksite-4c70ecac9fe3 有一個圖片 實驗 cloudwatch agent 或者 application discovery agent 到ec2 cloud watch agent 或者 discovery agent sync log 到 s3 glue裡面創建crawler ,指定s3 glue裡面創建database 和table athena 寫sql語句查詢想要的數據 如果想要類似kinana那樣可視化的工具,那麼需要付費quicksight 完 ……

阅读全文

Difference between user pool and identity pool(Federated Identities)

剛開始使用cognito服務的時候特別讓人困惑,有user pool 和 identity pool(Federated Identities),user pool裡面還有federation,federation裡面有identity provider. identity pool 裡面有autenticated provider裡面也有user pool ID! 納尼?這是什麼鬼? let’s forget the connection between them user pool 簡單來說就是提供一個用戶驗證的服務,比如用戶自定義用戶,用fb,GOOGLE,twitter等賬戶登錄,登錄後獲取一個token,用戶的每次請求帶著這個token就可以了,用戶登錄後獲取的是你個人應用的resource! ,比如你自己做了一個網站,登錄後可以管理自己用戶,權限,圖片等等,你有權限去訪問這些資源 identity pool 也是提供一個用戶認證的服務,用戶可以在裡面設置aws 的role,也就說用戶登錄後得到的aws的resource 的訪問權限,比如你可以訪問s3.只是這個登錄可以跟 user pool提供的服務去綁定,也可以不用user pool的服務直接用 identity pool裡面的provider去對接,也就說,如果你有google的id也可以登錄後獲取aws resource 資源的訪問權限,這個是登錄後aws通過sts生成臨時credential 來做到的 summary user pool 只是負責authentication,沒有authorization,即便有也是用戶本身應用的服務 identity pool,既可以authentication,又可以authoriztion,授權的是aws的resource 上幾張圖 幾個非常有價值的link https://serverless-stack.com/chapters/cognito-user-pool-vs-identity-pool.html https://gorillalogic.com/blog/java-integration-with-amazon-cognito/……

阅读全文

Aws cognito sample

这是一个aws官方的文档,我认为最好的cognito的例子,如果理解这个sample,那么cognito就没有任何问题 https://aws.amazon.com/getting-started/projects/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/ 详解 廢話少說直接上圖 程序組成部分 - 靜態的代碼存放s3 - 動態的代碼存放lambda - 代碼的訪問入口通過api-gateway - 數據的存放時dynamoDB(程序登錄後有個點擊頁面位置生成的數據,與用戶驗證沒有太多關係) Cognito user pool 在user login 流程 - 用戶用用戶名+密碼(或mfa,這取決於cognito user pool的配置)請求登錄 - aws cognito user pool去驗證用戶 - 如果用戶通過驗證返回一個token - 下一次用戶用這個token來請求訪問 - aws cognito user pool 可以基本满足用户登录,如果涉及到权限可以跟自己数据进行绑定 - 这个例子里面特别要注意的是,api gateway 直接设置了 Authorizers :里面可以指定cognito 来对用戶進行驗證,不用額外寫程序來驗證,也就說每次訪問一個服務/ride.html,api-getway通過Authorizers直接去用cognito去驗證用戶的token - 這個例子分了兩個步驟,第一個步驟是直接登錄,登錄後獲得一個toke - 第二步驟是用api-gateway 自動驗證用戶的登錄,也就是authentication ……

阅读全文

Aws cloudformation deploy lambda and apigateway

用Cloudformation 来部署 java 的lambda 和api gateway,这里要用到spring-boot写java 代码,需要用到s3,存放lambda代码,需要创建lambda function和api agetway,还需要用到sam Aws lambda with Spring Boot 本文用到的git代码来自 https://github.com/gemerick/spring-boot-lambda 本文的内容来自 https://keyholesoftware.com/2018/04/26/aws-lambda-with-spring-boot/ 本文的步骤 安装sam git 克隆现有代码 创建s3 bucket 用cloudformation 上传 代码 用cloudformation 部署 测试代码 安装sam pip3 install --user aws-sam-cli git 克隆代码 git clone https://github.com/gemerick/spring-boot-lambda -b lambda mvn clean package 创建s3 bucket aws s3 mb s3://spring-boot-lambda-20100905 拷贝jar 到S3 ,更新sam的template aws cloudformation package --template-file sam.yaml --output-template-file target/output-sam.……

阅读全文

Aws ecs tutorial

Aws ecs 简单来说就是host docker container,跟K8S类似,如果用过k8s,那么ecs非常的好理解 本文主要按照 Gentle Introduction to How AWS ECS Works with Example Tutorial 搭建 关于ECS的专业的词汇 Task Definition :实际就是要给launch configration,比如暴露端口号,用什么docker image,cpu 内存需要多少,运行docker 的command,环境变量 Task :简单来说就是一个running instance Service :一组task Cluster :一组task 跑在一个或者多个 constainer 里面 Container Instance :容器实例里面跑的是多个 task 按照此图搭建一组ecs的服务 创建一个ecs cluster 创建一个ecsServiceRole 创建Task Definition 创建elb和 target group 创建 service,里面只有一个task 检查运行情况 把service里面的task 改为4 创建一个ecs cluster 创建secrutiry group my-ecs-sg……

阅读全文