最初に 5 ~ 10 分程度お時間を頂いて本日お時間を頂いた経緯などを説明したあと、色々お話を聞かせてもらえたらと思います。
- 如何に Terraform の state を分割するか
- 如何に Terraform によるリソースの管理を SRE から developer に委譲するか
- AWS のリソースを Terraform で管理している
commands: | |
apply: | |
description: | | |
Run `terraform apply` and add a comment to the pull request or Git commit. | |
parameters: | |
apply_options: | |
default: "" | |
description: | | |
The options of `terraform apply` command. The option `-auto-approve` is set automatically. | |
For example, `-refresh=false -parallelism=20`. |
curl -u admin:admin -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'X-Requested-By: api' -X POST 'http://127.0.0.1:9000/api/events/definitions?pretty=true' -d ' | |
{ | |
"title": "new-event-definition", | |
"description": "", | |
"priority": 2, | |
"alert": true, | |
"config": { | |
"type": "aggregation-v1", | |
"query": "test", | |
"streams": [ |
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
) | |
func main() { | |
cmd := exec.Command("sh", "-c", "ls | fzf") |
send-pr() { | |
local remote=`git config branch.master.remote` | |
local remote_url=`git config remote.${remote}.url` | |
case "$remote_url" in | |
https://github.com*) | |
git-pr | |
;; | |
https://ghe.example.com*) | |
ghe-pr | |
;; |
dctag() { | |
if [ $# -eq 0 -o "$1" = "help" -o "$1" = "--help" -o "$1" = "-help" ]; then | |
cat << EOS | |
List Docker image tags | |
Usage: $ dctag <image name> | |
ex. $ dctag alpine | |
EOS | |
return 0 | |
fi | |
if [ $# -ne 1 ]; then |
docker run -v /var/run/docker.sock:/var/run/docker.sock -ti --rm -e USER_NAME=$USER_NAME -e PASSWORD=$PASSWORD docker:19.03.1 sh -c 'echo $PASSWORD | docker login $REGISTRY --username $USER_NAME --password-stdin > /dev/null 2> /tmp/error.txt && cat /root/.docker/config.json || (cat /tmp/error.txt >&2 && exit 1)' |
# xurls: https://github.com/mvdan/xurls | |
s=0 | |
for url in `find . -name "*" -type f | xargs xurls | grep -v "ldap.*"`; do | |
if ! `curl -LI $url -o /dev/null --fail -s`; then | |
echo $url | |
s=1 | |
fi | |
done | |
if [ $s -ne 0 ]; then | |
exit 1 |
s=0 | |
for url in `find ./test -name "*" -type f | xargs xurls | grep -v "ldap.*"`; do | |
if ! `curl -LI $url -o /dev/null --fail -s`; then | |
echo $url | |
s=1 | |
fi | |
done | |
if [ $s -ne 0 ]; then | |
exit 1 | |
fi |
// https://play.golang.org/p/jUzWcBiO4xJ | |
// Output: | |
// B 0 | |
// A 0 | |
// end | |
package main | |
import ( | |
"fmt" |