Initial Implementation of Github Repo Env Secrets
This commit is contained in:
19
github/config.tf
Normal file
19
github/config.tf
Normal file
@@ -0,0 +1,19 @@
|
||||
variable "environment_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "github_owner" {
|
||||
type = string
|
||||
default = "HideyoshiSolutions"
|
||||
}
|
||||
|
||||
variable "github_repository" {
|
||||
type = string
|
||||
default = "infra-hideyoshi.com"
|
||||
}
|
||||
|
||||
|
||||
variable "cluster_kubeconfig" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
23
github/github.tf
Normal file
23
github/github.tf
Normal file
@@ -0,0 +1,23 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
github = {
|
||||
source = "integrations/github"
|
||||
version = "6.3.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data "github_user" "current" {
|
||||
username = ""
|
||||
}
|
||||
|
||||
data "github_repository" "infra_hideyoshi_com" {
|
||||
full_name = "${var.github_owner}/${var.github_repository}"
|
||||
}
|
||||
|
||||
resource "github_actions_environment_secret" "cluster_kubeconfig" {
|
||||
repository = data.github_repository.infra_hideyoshi_com.name
|
||||
environment = var.environment_name
|
||||
secret_name = "KUBECONFIG"
|
||||
plaintext_value = var.cluster_kubeconfig
|
||||
}
|
||||
Reference in New Issue
Block a user