Skip to content

Instantly share code, notes, and snippets.

View yamamoto-febc's full-sized avatar

Kazumichi Yamamoto yamamoto-febc

  • SAKURA internet / さくらインターネット
  • Oita, Japan
  • X @yamamoto_febc
View GitHub Profile
@yamamoto-febc
yamamoto-febc / example.tf
Created September 28, 2021 04:13
Terraformからさくらのクラウドの「IPアドレス設定スクリプト」を利用する例
terraform {
required_providers {
sakuracloud = {
source = "sacloud/sakuracloud"
version = "2.12.0"
}
}
}
# IPアドレス設定用 パブリックスタートアップスクリプト
@yamamoto-febc
yamamoto-febc / create.sh
Created July 21, 2021 00:38
とりあえずサーバが欲しい時にUsacloudで作る時のテンプレートなど
#!/bin/bash
usacloud server create --parameters parameter.json --name "name" password "password"
@yamamoto-febc
yamamoto-febc / debug
Created April 14, 2021 05:13
cdktf-compile-error
$ cdktf deploy
.gen/providers/sakuracloud/data-sakuracloud-vpc-router.ts:167:14 - error TS2416: Property 'index' in type 'DataSakuracloudVpcRouterPrivateNetworkInterface' is not assignable to the same property in base type 'ComplexComputedList'.
Type 'number' is not assignable to type 'string'.
167 public get index() {
~~~~~
.gen/providers/sakuracloud/data-sakuracloud-vpc-router.ts:167:14 - error TS2611: 'index' is defined as a property in class 'ComplexComputedList', but is overridden here in 'DataSakuracloudVpcRouterPrivateNetworkInterface' as an accessor.
@yamamoto-febc
yamamoto-febc / reproducing.md
Last active January 9, 2020 08:48
Pulumi doesn't respect provider generated resource id when updating

Steps to reproduce

1. Write code and run pulumi up

Write code

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sakuracloud.NewServer(ctx, "from-pulumi-with-go", &sakuracloud.ServerArgs{
$ kubectl get all --all-namespaces

NAMESPACE          NAME                                 READY     STATUS    RESTARTS   AGE
coredns-37390e68   pod/coredns-5cdbd55895-p7sgb         1/1       Running   0          12m
istio-095b8502     pod/istio-citadel-c49d8995c-tnm4x    1/1       Running   0          12m
istio-095b8502     pod/istio-gateway-868ff87668-bmspd   1/1       Running   0          12m
istio-095b8502     pod/istio-pilot-787795d8dd-4ttzf     2/2       Running   0          12m

NAMESPACE          NAME                    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                  AGE
@yamamoto-febc
yamamoto-febc / file0.txt
Last active May 8, 2018 06:27
Rancher 2.0のデータストアを覗く方法 ref: https://qiita.com/yamamoto-febc/items/498b911611dd25351ad7
sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
@yamamoto-febc
yamamoto-febc / test_generator.go
Last active February 22, 2018 12:41
テスト用にこんな感じのジェネレーターを探してる
/*
* こんなインターフェースを与えると
*/
type Foobar interface {
List() []*Foo
Read(string) (*Foo, error)
}
/*
* こんなソースを生成して欲しい
@yamamoto-febc
yamamoto-febc / file0.txt
Last active October 18, 2018 02:09
usacloudとlego(Let's encrypt)でウェブアクセラレータの証明書更新を自動化 ref: https://qiita.com/yamamoto-febc/items/3d1ac131717603761f9a
usacloud dns create --name example.com
@yamamoto-febc
yamamoto-febc / file0.txt
Last active October 18, 2018 02:05
さくらのクラウド + legoでLet's encrypt(DNS-01) ref: https://qiita.com/yamamoto-febc/items/290d5c455fe5b4f285bf
# さくらのクラウドAPIキーを環境変数に指定
export SAKURACLOUD_ACCESS_TOKEN=<APIアクセストークン>
export SAKURACLOUD_ACCESS_TOKEN_SECRET=<APIアクセスシークレット>
# --dns=sakuracloudと指定してlego runを実行
lego --email="[email protected]" --domains="example.com" --dns="sakuracloud" run
@yamamoto-febc
yamamoto-febc / file0.txt
Created November 20, 2017 23:03
Ansibleでusacloudを楽々インストール ref: https://qiita.com/yamamoto-febc/items/2499beeb96c07104fda6
$ yum install -y ansible