投稿時間:2022-05-14 17:15:45 RSSフィード2022-05-14 17:00 分まとめ(14件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita ラズパイで消費電力を取得する(3)完結 https://qiita.com/shof0322/items/38a1316720ea833cf56d awsiotcore 2022-05-14 16:58:51
python Pythonタグが付けられた新着投稿 - Qiita Pythonでつくる対話システム(その先) https://qiita.com/Stchan/items/04af0a1f6bea3e4414b4 類義語 2022-05-14 16:24:28
python Pythonタグが付けられた新着投稿 - Qiita Pythonで競プロをするときに良く使うコードやtips https://qiita.com/gottie/items/c4bf35a6516ee5c06630 onhogepyabctxtimportsysif 2022-05-14 16:06:25
js JavaScriptタグが付けられた新着投稿 - Qiita SourceMapとは https://qiita.com/Rikkuzo/items/334e443ac2921869163c javascritp 2022-05-14 16:48:04
js JavaScriptタグが付けられた新着投稿 - Qiita AppletをJSに変換してみる 後編 https://qiita.com/noty2008/items/6874b24de62328761d7e applet 2022-05-14 16:25:36
js JavaScriptタグが付けられた新着投稿 - Qiita ゼロから始めるLINE BOT開発 https://qiita.com/taka777n/items/c601421b871fd2b6a55f messag 2022-05-14 16:24:04
AWS AWSタグが付けられた新着投稿 - Qiita ラズパイで消費電力を取得する(3)完結 https://qiita.com/shof0322/items/38a1316720ea833cf56d awsiotcore 2022-05-14 16:58:51
Git Gitタグが付けられた新着投稿 - Qiita Githubでデータ共有 その1 Githubユーザー登録編 https://qiita.com/makaishi2/items/2369ee88d6381a3651b0 github 2022-05-14 16:47:51
Ruby Railsタグが付けられた新着投稿 - Qiita 新規Railsプロジェクトの作成〜localhostに接続するまで https://qiita.com/myumura/items/a3cabc5b1d8e860fa57f lstutorialbundleinitwriti 2022-05-14 16:55:51
技術ブログ Developers.IO [레포트] Veeam과 AWS를 통해 안전한 IT 환경의 보호 https://dev.classmethod.jp/articles/secure-it-environment-with-veeam-and-aws/ 레포트 Veeam과AWS를통해안전한IT 환경의보호안녕하세요클래스메소드김재욱 Kim Jaewook 입니다 이번에는AWS Partner Summit Korea 세션중「Veeam과AWS를통해안전한IT 환경의보호」세션을정리해 2022-05-14 07:07:33
海外TECH DEV Community 🐉 AWS CDK 101 - 🏇 Using batched dynamodb stream to delete item on another dynamodb table https://dev.to/aravindvcyber/aws-cdk-101-using-batched-dynamodb-stream-to-delete-item-on-another-dynamodb-table-4oag AWS CDK Using batched dynamodb stream to delete item on another dynamodb tableBeginners new to AWS CDK please do look at my previous articles one by one in this series If in case missed my previous article do find it with the below links Original previous post at Dev PostReposted previous post at dev to aravindvcyberIn this article let us add a new async batch integration to our message dynamodb table which will help us to delete the processed records from the staging dynamodb table Benefits in this approach In this approach we tried to clear the staging table data asynchronously using the dynamodb stream directly invoking a lambda So we can use this in systems where we may not directly do the scavenging synchronous in a compute intensive workload Saving compute by avoiding wait time for these I O Again some may argue that anyway I am making a lambda call elsewhere separately which could be thought of as a good decoupling strategy as well But invocation charges and compute still apply there Yet we need no one more thing that the streams can be ready in batches by our lambda and the default is so one invocation At the same time the handler can do a batch request to delete the data from the dynamodb in a single request So not only you can read a batch of streams but you can also perform batch delete which is fast as well as a good reduction in usage of write units in dynamodb table when you have such throttled async integrations Maybe I will write a separate article later about it for now it is not limited to the delete operation here Planning Here we will be making use of the dynamodb streams to trigger the deleteItem action by invoking a new lambda handler function which achieves our objective Construction We need a new lambda function code that has a fresh handler to receive the dynamodb stream event object and process it as shown below Create a new lambda function in the file lambda message stream ts Here you may find that we are targeting an event name to be INSERT likewise we can have finer control over our desired outcome during these stream invocations as shown below New handle function logic stuffed flatbread exports created async function event any console log Received stream JSON stringify event undefined const results any await Promise all event Records map async Record any gt console log JSON stringify Record undefined if Record eventName INSERT results push await deleteDbItem Record dynamodb Keys results map res gt console log res Helper function dynamodb deleteItem Simple helper function to perform deleteItem from a dynamodb table const deleteDbItem any async keys any gt console log Deleting keys const deleteData DeleteItemInput TableName process env STAGING MESSAGES TABLE NAME Key keys ReturnConsumedCapacity TOTAL console log deleteItem JSON stringify deleteData undefined return await dynamo deleteItem deleteData promise Minor changes to the dynamodb table definition I have highlighted the necessary changes we need to perform dynamodb stream generation for our table Most importantly I have requested both the new and old images which will have all the necessary data however we are not going to use all of the data This is only for demonstration purposes const messages new dynamodb Table this MessagesTable tableName process env messagesTable sortKey name createdAt type dynamodb AttributeType NUMBER partitionKey name messageId type dynamodb AttributeType STRING encryption dynamodb TableEncryption AWS MANAGED readCapacity writeCapacity New item added below stream dynamodb StreamViewType NEW AND OLD IMAGES Defining the new lambda Here we will use the code bloc used above to provision our lambda as shown below inside our master stack const messageStreamFunc new lambda Function this messageStreamFunc runtime lambda Runtime NODEJS X code lambda Code fromAsset lambda handler message stream created logRetention logs RetentionDays ONE MONTH tracing Tracing ACTIVE layers nodejsUtils nodejsXray environment STAGING MESSAGES TABLE NAME envParams messages stgTableName messageStreamFunc applyRemovalPolicy RemovalPolicy DESTROY Grant permission for the handler to write to the table Also our handler must have sufficient access to delete from the other dynamodb table stgMessages stgMessages grantWriteData messageStreamFunc Adding Event source to the lambda function It is time not to connect the handler function to the dynamodb event source as follows messageStreamFunc addEventSource new DynamoEventSource messages startingPosition lambda StartingPosition LATEST or you can improve the batch size and window in seconds for long polling as follows messageStreamFunc addEventSource new DynamoEventSource messages startingPosition lambda StartingPosition LATEST batchSize maxBatchingWindow Duration seconds Sample dynamodb stream object I have shared the dynamodb stream object used as payload to invoke our handler lambda below Records eventID caafeaeea eventName INSERT eventVersion eventSource aws dynamodb awsRegion ap south dynamodb ApproximateCreationDateTime Keys createdAt N messageId S d e a bb caae NewImage createdAt N messageId S d e a bb caae event S n message new A secret message n SequenceNumber SizeBytes StreamViewType NEW AND OLD IMAGES eventSourceARN arn aws dynamodb ap south table MessagesTable stream Console log during execution Finally post execution we could find the above JSON payload we have received in the event object and which is then used to delete from our staging table you may find the results below in cloud watch logs In the next article we will demonstrate how we will use a similar approach to delete Object from S which we have previously created We will be adding more connections to our stack and making it more usable in the upcoming articles by creating new constructs so do consider following and subscribing to my newsletter We have our next article in serverless do check outThanks for supporting Would be great if you like to Buy Me a Coffee to help boost my efforts Original post at Dev PostReposted at dev to aravindvcyber 2022-05-14 07:27:10
海外ニュース Japan Times latest articles Vladimir Putin, family man https://www.japantimes.co.jp/news/2022/05/14/world/vladimir-putin-family-man/ private 2022-05-14 16:30:03
北海道 北海道新聞 欧州、オミクロン派生型を警戒 新型コロナ、感染増の恐れ https://www.hokkaido-np.co.jp/article/680753/ 欧州疾病予防管理センター 2022-05-14 16:08:00
北海道 北海道新聞 主要企業の7割が業績に影響 ウクライナ危機でコスト増 https://www.hokkaido-np.co.jp/article/680752/ 業績 2022-05-14 16:06:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)