terraform loop

Terraform ループ Terraform での loop 処理の書き方(for, for_each, count) flatten Function

2023年7月19日 · 1 分

poetry version requirements

Poetry : パッケージ依存定義 (Dependency specification) バージョン要件(requirements) 要件 例 意味 Caret requirements ^1.2.3 >=1.2.3 <2.0.0 Tilde requirements ~1.2.3 >=1.2.3 <1.3.0 Wildcard requirements 1.* >=1.0.0 <2.0.0 Inequality requirements < 2 < 2.0.0 Exact requirements ==1.2.3 もしくは 1.2.3 ==1.2.3 @ operator 依存(dependancies) 依存 git dependencies path dependencies url dependencies extras source dependencies python Multiple constraints dependencies 拡張

2023年7月17日 · 1 分

Google Cloud Run

Google Cloud Run Kubernetes から Cloud Run に移行する Google Cloud なんもわからないマンが、Cloud Run の凄さをあれこれ調べてみた AWS App Runner https://aws.amazon.com/jp/apprunner/

2023年7月16日 · 1 分

Managed k8s

Managed k8s Provider Service Product AWS EKS(Elastic Kubernetes Service) GCP GKE(Google Kubernetes Engine) Azure AKS(Azure Kubernetes Service) マネージド Kubernetes とは?EKS・AKS・GKE を比較 AWS EKS vs. ECS AWS 自身が考える ECS と EKS の役割 EKS: EKS : 他のプロバイダー/オンプレミスからの移行 ECS: Kubernetes に比べてはるかに運用がしやすく、低コストで、マルチテナントのプラットフォームとしての効率が非常に高い クラスターの起動を無料で行うことができます

2023年7月16日 · 1 分

redis

Elasic Cache for Redis バージョン 1 2 3 4 5 $ redis-cli --version redis-cli 5.0.7 $ redis-server -v Redis server v=5.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=66bd629f924ac924 接続: 1 REDIS_URL=redis://mycloud-stage-redis-nc.sigrvp.ng.0001.apne1.cache.amazonaws.com:6379/0 1 2 3 $ export $(cat .env|xargs) $ redis-cli -u $REDIS_URL PING PONG Python redis-py: https://github.com/redis/redis-py django-redis: https://github.com/jazzband/django-redis channels_redis: https://github.com/django/channels_redis クラスターモードへの接続 Cluster Client 1 2 3 4 5 6 7 8 9 import logging from redis.cluster import RedisCluster ENDPOINT = "mycloud-stage-redis-test.sigrvp.clustercfg.apne1.cache.amazonaws.com" logging.basicConfig(level=logging.INFO) redis = RedisCluster(host=ENDPOINT, port="6379") if redis.ping(): logging.info("Connected to Redis") django-redis: ...

2023年7月14日 · 1 分

Celery AWS ECS

Celery on ECS 【Python Celery】本番運用時に知っておくべき 10 のこと https://github.com/Alexmhack/Django-Celery-Redis-AWSEB Redis Celery + AWS Redis で使ってみる クラスターモード Redis >= 3.2 ElastiCache for Redis のクラスターモードについて調べてみる SQS broker としてつかえるが、 backend としては使えない(SQS + RabbitMQ/Redis/SQLAlchemy を考える) Celery + SQS on Django on Elastic Beanstalk Deploying Django on AWS: Setting up Celery and SQS Deploying Django Application on AWS with Terraform. Setting up Celery and SQS ECS running celery tasks and celery beat in ECS with Django docker compose ecs deploy aws tutorial: celery incompatible attribute #8040 AWS Batch を検討したけど AWS Fargate を採用した話 Celery Logging celery.app.log Three Ideas to Customise Celery logging handlers 標準出力: ...

2023年7月13日 · 1 分

EC2 mount EFS

AWS EC2 moutn EFS E2 からマウント 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #!/bin/bash EFS_ID="fs-0f90bd97a364a6e94" # PKG=amazon-efs-utils RES=$(dpkg --get-selections | grep $PKG) MOUNT_PATH="/efs" if [ -z "${RES}" ]; then apt update && apt upgrade -y && apt autoremove -y apt-get -y install binutils git clone https://github.com/aws/efs-utils cd efs-utils ./build-deb.sh apt-get install -y ./build/amazon-efs-utils*deb fi # if [ ! -d $MOUNT_PATH ]; then mkdir $MOUNT_PATH fi # mount -t efs $EFS_ID:/ $MOUNT_PATH

2023年7月12日 · 1 分

MySQL only_full_group_by

only_full_group_by エラー: 1 2 3 4 5 6 OperationalError: ( 1055, "Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'server.sales_sales.sales_status' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by") 対処: sql_mod に traditional を指定する ...

2023年6月30日 · 1 分

azure cognitive service

Azure Cognitive Services Azure Cognitive Services は、Microsoft Azure の製品として提供されている AI 機能作成サービスです ¹². これらのサービスは、REST API およびクライアントライブラリ SDK を使用して、人工知能を直接的に利用することなく、アプリケーションに認識、言語理解、音声、画像、検索などの機能を追加することができます ¹³. Azure Cognitive Services は、視覚、音声、言語、決定、検索などの分野を対象に AI 機能を簡単に利用することができます ¹. また、学習済みの AI モデル予測機能を活用できるのが特徴です ¹. ソース: Bing との会話 2023/6/30 (1) AI をもっと身近に!Azure Cognitive Services とは?今注目されて …. https://www.rworks.jp/cloud/azure/azure-column/azure-entry/28078/. (2) Azure Cognitive Services とは - Azure Cognitive Services. https://learn.microsoft.com/ja-jp/azure/cognitive-services/what-are-cognitive-services. (3) Cognitive Services - AI ソリューション向け API | Microsoft Azure. https://azure.microsoft.com/ja-jp/products/cognitive-services/. カテゴリ 視覚 音声 Language 決定 Azure OpenAI Service

2023年6月29日 · 1 分

Cloud Function defautl pages

AWS CloudFuntion URL 変更 AWS CloudFront Functions を使用して、ブラウザリクエストの URL を書き換えてオリジンに送信するには、HTTP リクエストを別の URL にリダイレクトする関数を作成する必要があります。 AWS ドキュメントには、CloudFront Functions を使用して HTTP リクエストを別の URL にリダイレクトする方法が記載されています ¹。 また、Classmethod 社の記事には、CloudFront Functions でオリジンに手を加えずに URL リダイレクトを行う方法が記載されています ³。 ご参考までに、以下は CloudFront Functions で HTTP リクエストを別の URL にリダイレクトする例です ²。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 function handler(event) { var request = event.request; var headers = request.headers; var uri = request.uri; var host = headers.host.value; var newurl = null; // Check the URI is '/abc/sign-up'. if (uri === "/abc/sign-up") { newurl = `https://${host}/sign-up`; } if (newurl !== null) { return { statusCode: 301, statusDescription: "Moved Permanently", headers: { location: { value: newurl }, }, }; } return request; } この例では、URI が/abc/sign-upに一致した場合に、https://${host}/sign-upへリダイレクトしています。この例を参考に、ご自身の環境に合わせた関数を作成してください。 ...

2023年6月26日 · 2 分