Skip to content

Instantly share code, notes, and snippets.

@satoshi256kbyte
satoshi256kbyte / 主にクラウドの話してます - 広島 #1 発表内容.md
Last active May 26, 2024 11:57
主にクラウドの話してます - 広島 #1 発表内容
タイトル 発表者 時間
会場の説明&ご挨拶 - 19:00 -
AWS App Runnerで気軽にAPIを作ってみる そして、これはどんな人向けなのか? Satoshi Kaneyasu 19:10 -
事業会社で基幹業務システムを10年ほどAWSで運用してみた k2works 19:30 -
AWS App Runnerで気軽にAPIを作ってみる�ーそして、これはどんな人向けなのか?ー chanyou 19:50 -
休憩&告知タイム - 20:10 -
【LT】クラウド初学者が抱える不安について tsuda_ahr 20:20 -
【LT】Amazon Aurora Serverless v2が意外と高かった話と、AWS Database Migration Serviceの話 Satoshi Kaneyasu 20:30 -
【みんなで】Party Rockで生成APIを作ってみよう - 20:40 -
@satoshi256kbyte
satoshi256kbyte / samconfig.toml
Last active March 29, 2024 22:05
【サンプルコード】AWS SAMでAWS StepFunctionsからAmazon ECS on Fargateのタスクを起動する
# More information about the configuration file can be found here:
# https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html
version = 0.1
[default]
[default.global.parameters]
stack_name = "sam-app"
[default.build.parameters]
cached = true
@satoshi256kbyte
satoshi256kbyte / upsert_to_timestream.py
Last active December 24, 2023 10:13
Amazon Timestremへの書込み処理のレスポンスと例外を詳しく見てみるためのサンプルコード
import boto3
from datetime import datetime, timezone, timedelta
import os
from typing import List, Dict, Any, Optional
def lambda_handler(event: Dict[str, Any], context: Optional[Any]) -> Dict[str, Any]:
event_time = event.get('event_time', '2023-12-23T22:00:00')
specified_time = datetime.fromisoformat(event_time)
timestamp = int(specified_time.timestamp() * 1000)
@satoshi256kbyte
satoshi256kbyte / config
Last active December 10, 2023 11:33
ユーザー認証にAWS IAM Identity Centerを用いたAmazon Managed Grafanaに対し、Amazon Timestreamを指定したデータソースを設定するのを自動化するためのシェル
#!/bin/bash
workspace_url=https://XXX.grafana-workspace.ap-northeast-1.amazonaws.com
api_token=Please enter your API token here
@satoshi256kbyte
satoshi256kbyte / spdx-json-by-trivy-1.json
Last active December 10, 2023 11:31
Trivy ouput SBOM
{
"spdxVersion": "SPDX-2.3",
"dataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"name": ".",
"documentNamespace": "http://aquasecurity.github.io/trivy/filesystem/.-a21f4f50-b246-4874-94fc-dd614897f513",
"creationInfo": {
"creators": [
"Organization: aquasecurity",
"Tool: trivy-0.48.0"
@satoshi256kbyte
satoshi256kbyte / 1-lambda-basic-auth.yml
Last active December 4, 2023 03:27
CloudFormation - CloudFront with Lambda@Edge
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Lambda for BASIC authentication'
#----------------------------------------
# Metadata
#----------------------------------------
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
@satoshi256kbyte
satoshi256kbyte / timestream_store_test.py
Last active November 10, 2023 10:08
メモリストアとマグネティックストアの挙動を確認するために、以下のようなソースコードを書きました。 このコードの`二時間前のタイムスタンプを取得`とコメントしている部分を調整しながら、この時刻なら登録できる、この時刻ならできないを確認しています。
import boto3
from datetime import datetime, timedelta
import os
import random
import time
from typing import List, Dict, Any, Optional
def lambda_handler(event: Dict[str, Any], context: Optional[Any]) -> Dict[str, Any]:
@satoshi256kbyte
satoshi256kbyte / delete_sagemaker_endpoint_except_tag.py
Last active September 1, 2023 07:19
指定されたタグを持つAWS SageMakerエンドポイントだけを残し、それ以外のエンドポイントを削除するLambda
"""
このモジュールはAWS Lambda関数として動作し、
指定されたタグを持つAWS SageMakerエンドポイントだけを残し、それ以外のエンドポイントを削除します。
"""
import boto3
from typing import Dict, Any
def lambda_handler(event: Dict[str, Any], context: Any) -> Dict[str, Any]:
@satoshi256kbyte
satoshi256kbyte / delete-sagemaker-inference-endpoint.py
Last active September 1, 2023 07:18
指定されたタグを持つAWS SageMakerエンドポイントを削除するLambda
"""
このモジュールはAWS Lambda関数として動作し、
指定されたタグを持つAWS SageMakerエンドポイントを削除します。
"""
import boto3
from typing import Dict, Any
def lambda_handler(event: Dict[str, Any], context: Any) -> Dict[str, Any]:
@satoshi256kbyte
satoshi256kbyte / stop_notebook_instance.py
Last active September 1, 2023 07:20
指定されたタグを持つノートブックインスタンスを停止するLambda
"""
このモジュールはAWS Lambda関数として動作し、
指定されたタグを持つノートブックインスタンスを停止します。
"""
import boto3
from typing import Any, Dict
def lambda_handler(event: Dict[Any, Any], context: Any) -> Dict[str, Any]: