Skip to content

Commit 9e6161d

Browse files
committed
chore(pulumi): add step in header
1 parent 3707f71 commit 9e6161d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pulumi/labs/lab01-modern-infrastructure-as-code/05-making-your-stack-configurable.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
大家可以看到,現在所有 `main.go` 的程式碼,都是直接 hardcode 的,那怎麼透過一些環境變數來動態改變設定呢?這時候可以透過 pulumi config 指令來調整喔,底下來看看怎麼實作,假設我們要讀取的 index.html 放在其他目錄底下,該怎麼動態調整?
44

5-
## 撰寫讀取 Config 函式
5+
## 步驟一: 撰寫讀取 Config 函式
66

77
```go
88
func getEnv(ctx *pulumi.Context, key string, fallback ...string) string {
@@ -46,7 +46,7 @@ config:
4646
})
4747
```
4848

49-
## 更新 Infrastructure
49+
## 步驟二: 進行部署
5050

5151
```sh
5252
$ pulumi up
@@ -74,7 +74,7 @@ Do you want to perform this update? details
7474
7575
可以看到 source 會被換成 `production/index.html`
7676
77-
## 讀取更多檔案
77+
## 步驟三: 讀取更多檔案
7878
7979
整個 Web 專案肯定不止一個檔案,所以再來改一下原本的讀取檔案列表流程
8080

pulumi/labs/lab01-modern-infrastructure-as-code/06-create-new-stack.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
在 Pulumi 可以很簡單的建立多種環境,像是 Testing 或 Production,只要將動態變數抽出來設定成 config 即可。底下來看看怎麼建立全先的環境,這步驟在 Pulumi 叫做 Stack。前面已經建立一個 dev 環境,現在我們要建立一個全新環境來部署 Testing 或 Production 該如何做呢?
44

5-
## 建立全新 Stack 環境
5+
## 步驟一: 建立全新 Stack 環境
66

77
透過 pulumi stack 可以建立全新環境
88

@@ -31,7 +31,7 @@ pulumi config set aws:profile demo
3131
pulumi config set aws:region ap-northeast-1
3232
```
3333

34-
## 建立 www 內容
34+
## 步驟二: 建立 www 內容
3535

3636
建立 `content/www` 目錄,一樣放上 index.htm + about.html
3737

@@ -53,7 +53,7 @@ about.html
5353
</html>
5454
```
5555

56-
## 部署 New Stack
56+
## 步驟三: 部署 New Stack
5757

5858
先看看 Preview 結果
5959

0 commit comments

Comments
 (0)