Skip to content

Instantly share code, notes, and snippets.

View hrmsk66's full-sized avatar

Hiromasa Kakehashi hrmsk66

View GitHub Profile

Collect and log client information

sequenceDiagram
    participant Client
    participant C@E
    participant WeatherAPI
    participant LogService
    Client->>C@E: Beacon
    C@E->>Client: 204
    Note over C@E: Check Geo and User-Agent

Convert Fastly Terraform Project to CDKTF (TypeScript)

Note: As of April 2023, it appears that only TypeScript supports the conversion of existing Terraform projects.

Working Directory

The project directory structure in this example steps is as follows: cdktf is the working directory and tf is the existing Terraform Project.

@hrmsk66
hrmsk66 / create_object_store.md
Created September 14, 2022 03:41
Creating Object Store

Creating a new object store

1. create an object store

curl -i -X POST \
https://api.fastly.com/resources/stores/object \
-H "Fastly-Key: $FASTLY_API_KEY" \
-d '{"name":"test-object-store"}'

*点線はオリジナル画像のリクエスト/レスポンス

sequenceDiagram
    autonumber
    participant Client
    participant Edge/Deliver
    participant Edge/Fetch
    participant Shield/Deliver
    participant Shield/Fetch
@hrmsk66
hrmsk66 / sequence.md
Last active August 28, 2022 06:13
Restarting with ImageOpto

*点線はオリジナル画像のリクエスト/レスポンス

sequenceDiagram
    autonumber
    participant Client
    participant Edge/Deliver
    participant Edge/Fetch
    participant Shield/Deliver
    participant Shield/Fetch
import {
  decodeWebSocketEvents,
  encodeWebSocketEvents,
  WebSocketContext,
  WebSocketMessageFormat,
} from "@fanoutio/grip";
import { Publisher } from "@fastly/grip-compute-js";
import { GRIP_URL } from "./env";

はじめに

Compute@Edge の開発の流れやツールを紹介するためのハンズオンワークショップです。

ワークショップへ参加する為には Fastly CLI のインストールと JavaScript の開発環境が必要です。 まだ準備ができていない場合は、こちらの記事を参考にご対応ください。 https://zenn.dev/hrmsk66/articles/74e2e890726e99

Fastly CLI のバージョンの違いによるトラブルを避けるために fastly update コマンドを実行しておいてください。

@hrmsk66
hrmsk66 / backend_definition_via_loop.md
Last active March 26, 2022 04:50
Create backend definitions from a list of maps

Create backend definitions from a list of maps

variables.tf

variable "backends" {
    type = list(map(string))
}
@hrmsk66
hrmsk66 / conreq.go
Last active September 9, 2019 05:59
Generating concurrent HTTP/HTTPS requests
package main
import (
"flag"
"fmt"
"net/http"
"strconv"
"time"
)