diff options
author | clarkzjw <[email protected]> | 2023-01-01 21:26:47 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-01-01 21:26:47 -0800 |
commit | 999e9e97d314e1702fa455abd9526042ef90b09d (patch) | |
tree | 895b5bec1507fa87cf0d3145ee00a9c488b96dce | |
parent | 1da9d7731b8cda1f433bb5b33a3922716844b1bb (diff) | |
download | jinwei.me-999e9e97d314e1702fa455abd9526042ef90b09d.tar.gz |
infra: add docker username and token into aws ssm
-rw-r--r-- | jinwei.me/infra/cloudflare.tf | 10 | ||||
-rw-r--r-- | jinwei.me/infra/dockerhub.tf | 11 | ||||
-rw-r--r-- | jinwei.me/infra/variables.tf | 12 |
3 files changed, 33 insertions, 0 deletions
diff --git a/jinwei.me/infra/cloudflare.tf b/jinwei.me/infra/cloudflare.tf index d0f7b8a..bb26eb5 100644 --- a/jinwei.me/infra/cloudflare.tf +++ b/jinwei.me/infra/cloudflare.tf | |||
@@ -46,6 +46,16 @@ resource "cloudflare_tunnel_config" "tunnel_route" { | |||
46 | service = "http://127.0.0.1:30081" | 46 | service = "http://127.0.0.1:30081" |
47 | } | 47 | } |
48 | ingress_rule { | 48 | ingress_rule { |
49 | hostname = "bean.jinwei.me" | ||
50 | path = "/" | ||
51 | service = "http://127.0.0.1:30082" | ||
52 | } | ||
53 | ingress_rule { | ||
54 | hostname = "beanweb.jinwei.me" | ||
55 | path = "/" | ||
56 | service = "http://127.0.0.1:30083" | ||
57 | } | ||
58 | ingress_rule { | ||
49 | service = "http_status:404" | 59 | service = "http_status:404" |
50 | } | 60 | } |
51 | } | 61 | } |
diff --git a/jinwei.me/infra/dockerhub.tf b/jinwei.me/infra/dockerhub.tf new file mode 100644 index 0000000..00a3bf2 --- /dev/null +++ b/jinwei.me/infra/dockerhub.tf | |||
@@ -0,0 +1,11 @@ | |||
1 | resource "aws_ssm_parameter" "dockerhub_username" { | ||
2 | name = "/${local.name}/docker/username" | ||
3 | type = "SecureString" | ||
4 | value = var.dockerhub_username | ||
5 | } | ||
6 | |||
7 | resource "aws_ssm_parameter" "dockerhub_token" { | ||
8 | name = "/${local.name}/docker/token" | ||
9 | type = "SecureString" | ||
10 | value = var.dockerhub_token | ||
11 | } | ||
diff --git a/jinwei.me/infra/variables.tf b/jinwei.me/infra/variables.tf index 04c1331..f364ef4 100644 --- a/jinwei.me/infra/variables.tf +++ b/jinwei.me/infra/variables.tf | |||
@@ -88,3 +88,15 @@ variable "hetzner_storagebox" { | |||
88 | type = string | 88 | type = string |
89 | sensitive = true | 89 | sensitive = true |
90 | } | 90 | } |
91 | |||
92 | variable "dockerhub_username" { | ||
93 | description = "dockerhub username" | ||
94 | type = string | ||
95 | sensitive = true | ||
96 | } | ||
97 | |||
98 | variable "dockerhub_token" { | ||
99 | description = "dockerhub token" | ||
100 | type = string | ||
101 | sensitive = true | ||
102 | } | ||