Skip to content

Instantly share code, notes, and snippets.

Avatar

Shunsuke Suzuki suzuki-shunsuke

View GitHub Profile
View autoclose-renovate.yaml
name: Close Renovate pull requests
on:
workflow_dispatch:
inputs: {}
schedule:
# The "*" (#42, asterisk) character has special semantics in YAML, so this
# string has to be quoted.
- cron: '0/15 * * * *'
permissions:
View foo.go
package foo
func Foo() {}
View debug.log
2021-08-02T20:11:07.294+0900 [DEBUG] Adding temp file log sink: /var/folders/g5/s19ny0hd09g72v6pq5rbf54m0000gn/T/terraform-log681782424
2021-08-02T20:11:07.294+0900 [INFO] Terraform version: 1.0.3
2021-08-02T20:11:07.295+0900 [INFO] Go runtime version: go1.16.4
2021-08-02T20:11:07.295+0900 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/2.2.2/versions/1.0.3/terraform", "apply", "-auto-approve"}
2021-08-02T20:11:07.295+0900 [DEBUG] Attempting to open CLI config file: /Users/shunsuke/.terraformrc
2021-08-02T20:11:07.295+0900 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-08-02T20:11:07.295+0900 [DEBUG] checking for credentials in "/Users/shunsuke/.terraform.d/plugins"
2021-08-02T20:11:07.295+0900 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-08-02T20:11:07.295+0900 [DEBUG] will search for provider plugins in /Users/shunsuke/.terraform.d/plugins
2021-08-02T20:11:07.295+0900 [WARN] Provider plugin search ignored symlink /Users/shunsuke/.terraform.d/plugin
@suzuki-shunsuke
suzuki-shunsuke / README.md
Created Jul 7, 2021
Quipper における Rego の活用事例
View README.md

自己紹介

Rego で何をテストしているか

  • Conftest で Terraform Configuration と k8s manifest をテスト
    • k8s manifest は kustomize build で生成したものに対して実行
    • Terraform は Plan File に対して実行
@suzuki-shunsuke
suzuki-shunsuke / get_terraform_local_module_dependencies.sh
Created Oct 24, 2020
Shell script to get the list of Terraform local module paths which the specified path depends on.
View get_terraform_local_module_dependencies.sh
#!/usr/bin/env bash
#
# Get the list of Terraform local module paths which the specified path depends on.
# This command get dependencies recursively.
#
# Usage:
# $ bash scripts/get_dependencies.sh "<path>"
set -eu
set -o pipefail
View circleci-ci-skip.txt
.*\[ci skip\].*|.*\[CI SKIP\].*|.*\[skip ci\].*|.*\[SKIP CI\].*
View get_codebuild_pull_request.sh
#!/usr/bin/env bash
set -eu
if [ -z "${CODEBUILD_WEBHOOK_EVENT:-}" ]; then
repo=$(echo "${CODEBUILD_SOURCE_REPO_URL}" | sed -E "s|https://github\.com/(.*)$|\1|" | sed -E "s|\.git$||")
# https://docs.github.com/en/rest/reference/repos#list-pull-requests-associated-with-a-commit
body=$(curl \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.groot-preview+json" \
View sentry_example.go
package sentry
import (
"time"
"github.com/getsentry/sentry-go"
)
type Event struct {
Error error
View orb.yml
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`.
@suzuki-shunsuke
suzuki-shunsuke / create-event-definition.sh
Created Dec 3, 2019
Graylog Event Definition and Event Notification API (Graylog v3.1.2) https://github.com/suzuki-shunsuke/go-graylog/issues/170
View create-event-definition.sh
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": [