Created
August 9, 2020 07:16
-
-
Save dzeyelid/4e7277fe1b661fc4a211b2eb1eb622ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const body = { | |
text: alert.schemaId, | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": `:loudspeaker: リソースグループ \`${resourceGroup}\` の利用が予算の ${percentage}% を超えました!\nコストの見直しを行ってください。`, | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": `*リソースグループ*:\t${resourceGroup}\n*現在のコスト*:\t\t\t${spendingAmount}\n*予算*:\t\t\t\t\t\t\t${budget}\n*通貨*:\t\t\t\t\t\t\t${unit}`, | |
} | |
} | |
] | |
}; | |
const result = await axios.post(process.env.slackWebhookUrl, body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment