From 999e9e97d314e1702fa455abd9526042ef90b09d Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Sun, 1 Jan 2023 21:26:47 -0800 Subject: infra: add docker username and token into aws ssm --- jinwei.me/infra/cloudflare.tf | 10 ++++++++++ jinwei.me/infra/dockerhub.tf | 11 +++++++++++ jinwei.me/infra/variables.tf | 12 ++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 jinwei.me/infra/dockerhub.tf 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 @@ -45,6 +45,16 @@ resource "cloudflare_tunnel_config" "tunnel_route" { path = "/" service = "http://127.0.0.1:30081" } + ingress_rule { + hostname = "bean.jinwei.me" + path = "/" + service = "http://127.0.0.1:30082" + } + ingress_rule { + hostname = "beanweb.jinwei.me" + path = "/" + service = "http://127.0.0.1:30083" + } ingress_rule { service = "http_status:404" } 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 @@ +resource "aws_ssm_parameter" "dockerhub_username" { + name = "/${local.name}/docker/username" + type = "SecureString" + value = var.dockerhub_username +} + +resource "aws_ssm_parameter" "dockerhub_token" { + name = "/${local.name}/docker/token" + type = "SecureString" + value = var.dockerhub_token +} 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" { type = string sensitive = true } + +variable "dockerhub_username" { + description = "dockerhub username" + type = string + sensitive = true +} + +variable "dockerhub_token" { + description = "dockerhub token" + type = string + sensitive = true +} -- cgit v1.2.3