Skip to content

Commit

Permalink
Template and Dns provider versions
Browse files Browse the repository at this point in the history
  • Loading branch information
wobondar committed Jan 25, 2021
1 parent 8344129 commit 9d3c737
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 deletions.
56 changes: 34 additions & 22 deletions src/command_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ provider "random" {
version = "{{.RandomProviderVersion}}"
}
provider "template" {
version = "{{.TemplateProviderVersion}}"
}
provider "dns" {
version = "{{.DnsProviderVersion}}"
}
provider "aws" {
region = "${module.config.region}"
version = "{{.AwsProviderVersion}}"{{ if .Local }}
Expand All @@ -50,17 +58,19 @@ provider "aws" {
)

type ProjectConfig struct {
ConfigModulePath string
TfconfigVersion string
MigrationPassed bool
Local bool
ProjectName string
ProjectDomain string
GitRepo string
AwsProfile string
AwsProviderVersion string
NullProviderVersion string
RandomProviderVersion string
ConfigModulePath string
TfconfigVersion string
MigrationPassed bool
Local bool
ProjectName string
ProjectDomain string
GitRepo string
AwsProfile string
AwsProviderVersion string
NullProviderVersion string
RandomProviderVersion string
TemplateProviderVersion string
DnsProviderVersion string
}

type EnvironmentDotEnv struct {
Expand Down Expand Up @@ -210,16 +220,18 @@ func (c *EnvCommand) executeTemplate(t *template.Template, config *ProjectConfig

func (c *EnvCommand) dotEnvMapper(env *EnvironmentDotEnv) *ProjectConfig {
return &ProjectConfig{
ConfigModulePath: c.modulesSource,
TfconfigVersion: Version,
MigrationPassed: c.app.BoolResolver(env.project["MIGRATED"]),
Local: c.local,
ProjectName: env.project["NAME"],
ProjectDomain: env.project["DOMAIN"],
GitRepo: env.project["GIT_REPO"],
AwsProfile: env.environment["TERRAFORM_AWS_PROFILE"],
AwsProviderVersion: env.environment["AWS_PROVIDER_VERSION"],
NullProviderVersion: env.environment["NULL_PROVIDER_VERSION"],
RandomProviderVersion: env.environment["RANDOM_PROVIDER_VERSION"],
ConfigModulePath: c.modulesSource,
TfconfigVersion: Version,
MigrationPassed: c.app.BoolResolver(env.project["MIGRATED"]),
Local: c.local,
ProjectName: env.project["NAME"],
ProjectDomain: env.project["DOMAIN"],
GitRepo: env.project["GIT_REPO"],
AwsProfile: env.environment["TERRAFORM_AWS_PROFILE"],
AwsProviderVersion: env.environment["AWS_PROVIDER_VERSION"],
NullProviderVersion: env.environment["NULL_PROVIDER_VERSION"],
RandomProviderVersion: env.environment["RANDOM_PROVIDER_VERSION"],
TemplateProviderVersion: env.environment["TEMPLATE_PROVIDER_VERSION"],
DnsProviderVersion: env.environment["DNS_PROVIDER_VERSION"],
}
}
2 changes: 1 addition & 1 deletion src/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

const Version = "v0.4.1"
const Version = "v0.4.2"

const CiEnvVar = "CI"
const TerraformLocalEnvVar = "TF_LOCAL"
Expand Down

0 comments on commit 9d3c737

Please sign in to comment.