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
| // SuggestCustomIdentifier suggests the identifier of the EC2 instance | |
| func (g *EC2Generator) SuggestCustomIdentifier() (string, error) { | |
| client := http.Client{Timeout: timeout} | |
| key := "instance-id" | |
| resp, err := client.Get(g.baseURL.String() + "/" + key) | |
| // (省略) | |
| instanceID := string(body) |
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
| package main | |
| import ( | |
| "github.com/urfave/cli" | |
| "io" | |
| "os" | |
| ) | |
| func main() { |
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
| docker inspect -f "{{ .Config.WorkingDir }}" your-image |
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
| resource "sakuracloud_database" "db" { | |
| # 管理者(postgres)パスワード | |
| admin_password = "put_your_postgres_password" | |
| # デフォルトで作成されるユーザーの名前 | |
| user_name = "put_default_user_name" | |
| # デフォルトで作成されるユーザーのパスワード | |
| user_password = "put_your_default_user_password" |
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
| terraform # core binary | |
| terraform-provider-* # provider plugins | |
| terraform-provisioner-* # provisioner plugins |
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
| # ----------------------------------------------------------------------------- | |
| # 変数定義(ログイン情報など) | |
| # ----------------------------------------------------------------------------- | |
| # L2TP/IPSec 事前共有キー | |
| variable pre_shared_secret { default = "PutYourSecret" } | |
| # L2TP/IPSec ユーザー名/パスワード | |
| variable vpn_username { default = "PutYourName" } | |
| variable vpn_password { default = "PutYourPassword" } |
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
| $ docker run -it --rm -e ACCESS_KEY -e SECRET_KEY -v $PWD:/work \ | |
| sacloud/s3cmd ls |
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
| package main | |
| import ( | |
| "os" | |
| "log" | |
| "github.com/mitchellh/goamz/aws" | |
| "github.com/mitchellh/goamz/s3" | |
| ) |
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
| /************************ | |
| Server | |
| ************************/ | |
| resource "sakuracloud_server" "server01" { | |
| name = "server01" | |
| disks = ["${sakuracloud_disk.disk01.id}"] | |
| tags = ["@virtio-net-pci"] | |
| connection { | |
| user = "root" |
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
| func resourceSakuraCloudServer() *schema.Resource { | |
| return &schema.Resource{ | |
| // 以下は通常のリソースとしてCRUDを定義 | |
| Create: resourceSakuraCloudServerCreate, | |
| Update: resourceSakuraCloudServerUpdate, | |
| Read: resourceSakuraCloudServerRead, | |
| Delete: resourceSakuraCloudServerDelete, | |
| // インポートをサポートするリソースでは以下のようにImporterを実装 | |
| Importer: &schema.ResourceImporter{ | |
| State: schema.ImportStatePassthrough, |