feat: implement stackit git instances (#791)

* feat: implement stackit git instances

* review changes
This commit is contained in:
Mauritz Uphoff 2025-05-09 08:50:23 +02:00 committed by GitHub
parent c7c64a5806
commit cf7a7d154e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 937 additions and 96 deletions

View file

@ -53,6 +53,7 @@ var (
ArgusCustomEndpoint = os.Getenv("TF_ACC_ARGUS_CUSTOM_ENDPOINT")
CdnCustomEndpoint = os.Getenv("TF_ACC_CDN_CUSTOM_ENDPOINT")
DnsCustomEndpoint = os.Getenv("TF_ACC_DNS_CUSTOM_ENDPOINT")
GitCustomEndpoint = os.Getenv("TF_ACC_GIT_CUSTOM_ENDPOINT")
IaaSCustomEndpoint = os.Getenv("TF_ACC_IAAS_CUSTOM_ENDPOINT")
LoadBalancerCustomEndpoint = os.Getenv("TF_ACC_LOADBALANCER_CUSTOM_ENDPOINT")
LogMeCustomEndpoint = os.Getenv("TF_ACC_LOGME_CUSTOM_ENDPOINT")
@ -433,6 +434,23 @@ func ServiceAccountProviderConfig() string {
)
}
func GitProviderConfig() string {
if GitCustomEndpoint == "" {
return `
provider "stackit" {
default_region = "eu01"
enable_beta_resources = true
}`
}
return fmt.Sprintf(`
provider "stackit" {
git_custom_endpoint = "%s"
enable_beta_resources = true
}`,
GitCustomEndpoint,
)
}
func ResourceNameWithDateTime(name string) string {
dateTime := time.Now().Format(time.RFC3339)
// Remove timezone to have a smaller datetime