(In Ktor: 1.6.2)
-
application.conf
... jwt { issuer = "https://cognito-idp.ap-northeast-1.amazonaws.com/__SPECIFY_POOL_ID_HERE__" audience = "__SPECIFY_CLIENT_ID_HERE__" realm = "ktor sample app"
const axios = require('axios'); | |
const slackUrl = 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX'; | |
exports.notifyBudgetAlert = (event, context) => { | |
if (event.data) { | |
const data = JSON.parse(Buffer.from(event.data, 'base64').toString()); | |
if (data.costAmount === 0) { | |
console.log('Skipped the process because the cost amount is zero. Budget name: ' + data.budgetDisplayName); |
docker run -itd --rm --name my-python --volume $PWD:/opt/work python:3 /bin/sh | |
docker exec -it my-python bash | |
cd /opt/work | |
python your_script.py |
(In Ktor: 1.6.2)
application.conf
...
jwt {
issuer = "https://cognito-idp.ap-northeast-1.amazonaws.com/__SPECIFY_POOL_ID_HERE__"
audience = "__SPECIFY_CLIENT_ID_HERE__"
realm = "ktor sample app"
FROM ubuntu:20.04 | |
# Installing dependent libraries... | |
RUN apt-get update && \ | |
apt-get install -y \ | |
curl \ | |
unzip | |
# Installing AWS CLI v2... | |
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ |
docker run --rm -p 10080:80 -e [email protected] -e PGADMIN_DEFAULT_PASSWORD=pgadmin dpage/pgadmin4 |
docker run --rm alpine ash -c "apk add curl && curl https://example.com" |
class ListSplitter { | |
companion object { | |
fun <T> split(list: List<T>, size: Int): List<List<T>> { | |
val result: MutableList<List<T>> = mutableListOf() | |
var i = 0 | |
while (i < list.size) { | |
result.add(list.subList(i, (i + size).coerceAtMost(list.size))) | |
i += size | |
} | |
return result |
/* | |
* 特定の EC2 Instance を起動あるいは停止させる関数 | |
*/ | |
const params = { | |
// 対象のEC2インスタンスIDのリスト | |
InstanceIds: [ | |
'i-00000000000000000', | |
] | |
}; |
import json | |
import urllib.request | |
teams_endpoint = "https://outlook.office.com/webhook/.../IncomingWebhook/..." | |
def build_text(message, detail): | |
body = json.dumps(detail, indent=2) | |
text = [] |
import json | |
import urllib.request | |
teams_endpoint = "https://outlook.office.com/webhook/.../IncomingWebhook/..." | |
def build_text(detail, attr): | |
def get_username_from_arn(arn): | |
return arn.split(":")[-1] |