Serverless で ApiGw のロギングいれようとして、`CloudWatch Logs role ARN must be set in account settings to enable logging` となったのでメモ

問題 Serverless Framework で、以下のようにロギング設定を追加して、以下エラーになった provider: # 省略 logs: restApi: accessLogging: false # Optional configuration which enables or disables access logging. Defaults to true. executionLogging: true # Optional configuration which enables or disables execution logging. Defaults to true. level: ERROR # Optional configuration which specifies the log level to use for execution logging. May be set to either INFO or ERROR. fullExecutionData: false # Optional configuration which specifies whether or not to log full requests/responses for execution logging....

2023-02-13 ·  2023-04-24 · 1 分 · 130 文字

firebase-admin で使用する秘密鍵を SecretManager に登録する

FCM Push用秘密鍵を SecretManager に登録する FCM 秘密鍵を取得 FireBaseへログイン プロジェクトを選択 プロジェクトの設定 サービスアカウント FireBase Admin SDK > 新しい秘密鍵の生成 FCM 秘密鍵を SecretManager に登録 取得した秘密鍵を ./fcm.json で配置する 以下コマンドで登録 aws secretsmanager put-secret-value --secret-id ${SECRET_ID} --secret-string "$(cat<./fcm.json)" 使う SecretManager を扱い易いようにクラス化する 'use strict'; const { SecretsManagerClient, GetSecretValueCommand } = require('@aws-sdk/client-secrets-manager'); const clazz = class Sm { constructor() { this.client = new SecretsManagerClient({ region: process.env.REGION }); // REGION で環境変数へRegionを設定している前提 } async get(key) { const command = new GetSecretValueCommand({ SecretId: key }); const res = await this....

2023-02-13 ·  2023-04-23 · 1 分 · 170 文字

x11 and wayland

docker wayland 転送 - Google 検索 WSLgとdocker composeで全部やる Waylandのソケットは、/mnt/wslg/runtime-dir/wayland-0にあります。 … x11 - How can I run a graphical application in a container under Wayland? - Unix & Linux Stack Exchange LinuxとWSLとDockerとXの仕組み ここで注目すべき(?)はRDPの存在で、これまでのWindowsのリモートデスクトップの枠組みを拡張して(?)、VAILやRAILといった仕組みでデスクトップではなくWindowレベルでの「リモートデスクトップ」を実現しているということです。 この他、Xパケットの転送のみでは実現できなかった「音情報」の転送も組み込んでいます。 Docker on WSL2 on Windows 10? Docker Desktopを企業活動で利用するのが有料になったことから、Docker Desktop を使わずに Windows で Docker する - プログラム の超個人的なメモという魔術が出回るようになりました。このアーキテクチャの場合、TCPでX11 Protocolを書き出しているので、Unix Domain Socketではなく、ポートフォワードで実現するのかなと思います(未確認) 理解しながら動かすGUIアプリ on Docker - Qiita wsl側からホスト側のアドレスは イーサネット アダプター vEthernet (WSL) を探す export DISPLAY=aaa.bbb.ccc.ddd:0 WSL2におけるVcXsrvの設定 - Qiita wsl側からDISPLAYを設定する際のホストの記述方法は mshome....

2023-01-19 ·  2023-04-24 · 1 分 · 98 文字

アクセス制限ポリシーを当てたRoleへスイッチできるユーザをaws cli で作成する

案件で作る機会があったので、さっと IAM.yml AWSTemplateFormatVersion: "2010-09-09" Description: "SampleApp - IAM" Parameters: ProjectName: Description: "Project name" Type: "String" Default: "SampleApp" Resources: IamSampleDeveloperRole: Type: AWS::IAM::Role Properties: RoleName: !Sub ${ProjectName}SampleDeveloper AssumeRolePolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Principal: AWS: !Sub arn:aws:iam::${AWS::AccountId}:root Action: sts:AssumeRole ManagedPolicyArns: - arn:aws:iam::aws:policy/CloudWatchReadOnlyAccess IamSampleDeveloperPolicies: Type: AWS::IAM::Policy Properties: PolicyName: IamSampleDeveloperPolicy PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - dynamodb:List* - dynamodb:DescribeReservedCapacity* - dynamodb:DescribeLimits - dynamodb:DescribeTimeToLive Resource: '*' - Effect: Allow Action: - dynamodb:BatchGet* - dynamodb:DescribeStream - dynamodb:DescribeTable - dynamodb:Get* - dynamodb:Query - dynamodb:Scan - dynamodb:BatchWrite* - dynamodb:CreateTable - dynamodb:Delete* - dynamodb:Update* - dynamodb:PutItem Resource: - arn:aws:dynamodb:*:*:table/dev-* - Effect: Allow Action: - s3:ListAllMyBuckets Resource: - arn:aws:s3:::* - Effect: Allow Action: - s3:* Resource: - arn:aws:s3:::*dev* Roles: - Ref: IamSampleDeveloperRole IamSampleDevelopersGroup: Type: AWS::IAM::Group Properties: GroupName: !...

2023-01-06 ·  2023-01-06 · 1 分 · 210 文字

Android でリリース用KeyStoreだけでなく、デバッグ用も外だし(共通化)してコマンドからAPKを作る

build.gradle signingConfig/ 配下を外だしするので、build.gradleではIncludeするような指定を行う apply from: 'signingConfigs/config.gradle', to: android の部分 signingConfig signingConfigs.debug の部分を追加することで、 通常のAndroid署名キー( %USERPROFILE%/.android/debug.keystore )を参照しなくなる模様 apply from: 'signingConfigs/config.gradle', to: android buildTypes { debug { debuggable true applicationIdSuffix = '.debug' versionNameSuffix = '-debug' signingConfig signingConfigs.debug } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } } signingConfig/config.gradle VCS管理外のシークレット情報として、以下 app/signingConfig/** signingConfigs/ ├── config.gradle ├── debug.jks └── release.jks debug.jks は Windowsの場合 %USERPROFILE%/.android/debug.keystore からコピーすると Windowsで使用していた署名キーを引き継げる. storePassword や keyAlias は Androidデフォルトの値 signingConfigs { debug { storeFile file('....

2022-12-22 ·  2022-12-22 · 2 分 · 310 文字