-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
push the bootstrap module thing to plan
- Loading branch information
1 parent
f1d1fe2
commit 5aa9aea
Showing
3 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,13 +122,14 @@ func applyEnvs(fs afero.Fs, p *plan.Plan, envBox *packr.Box, componentBox *packr | |
if e != nil { | ||
return errors.Wrap(e, "unable to apply templates for component") | ||
} | ||
} | ||
path = filepath.Join(rootPath, "envs", env, "cloud-env") | ||
if envPlan.Type == "aws" { | ||
e := applyModule(fs, path, "[email protected]:chanzuckerberg/shared-infra//terraform/modules/aws-env", templates.Templates.ModuleInvocation) | ||
if e != nil { | ||
return errors.Wrap(e, "unable to apply module") | ||
|
||
if componentPlan.BootstrapModule != "" { | ||
e := applyModule(fs, path, componentPlan.BootstrapModule, templates.Templates.ModuleInvocation) | ||
if e != nil { | ||
return errors.Wrap(e, "unable to apply module") | ||
} | ||
} | ||
|
||
} | ||
} | ||
return nil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ type Component struct { | |
SharedInfraVersion string | ||
TerraformVersion string | ||
SiccMode bool | ||
|
||
BootstrapModule string | ||
} | ||
|
||
type Env struct { | ||
|
@@ -314,11 +316,43 @@ func buildEnvs(conf *config.Config, siccMode bool) map[string]Env { | |
componentPlan.Env = envName | ||
componentPlan.Component = componentName | ||
componentPlan.OtherComponents = otherComponentNames(conf.Envs[envName].Components, componentName) | ||
// This is a bit awkward but should go away when we make the modules thing first-class. | ||
if envPlan.Type == "aws" { | ||
componentPlan.OtherComponents = append(componentPlan.OtherComponents, "cloud-env") | ||
} | ||
componentPlan.SiccMode = siccMode | ||
|
||
envPlan.Components[componentName] = componentPlan | ||
} | ||
|
||
if envPlan.Type == "aws" { | ||
componentPlan := Component{} | ||
|
||
componentPlan.AWSRegionBackend = envPlan.AWSRegionBackend | ||
componentPlan.AWSRegionProvider = envPlan.AWSRegionProvider | ||
componentPlan.AWSRegions = envPlan.AWSRegions | ||
|
||
componentPlan.AWSProfileBackend = envPlan.AWSProfileBackend | ||
componentPlan.AWSProfileProvider = envPlan.AWSProfileProvider | ||
componentPlan.AWSProviderVersion = envPlan.AWSProviderVersion | ||
componentPlan.AccountID = envPlan.AccountID | ||
|
||
componentPlan.TerraformVersion = envPlan.TerraformVersion | ||
componentPlan.InfraBucket = envPlan.InfraBucket | ||
componentPlan.Owner = envPlan.Owner | ||
componentPlan.Project = envPlan.Project | ||
componentPlan.SharedInfraVersion = conf.Defaults.SharedInfraVersion | ||
|
||
componentPlan.Env = envName | ||
componentPlan.Component = "cloud-env" | ||
componentPlan.OtherComponents = []string{} | ||
componentPlan.SiccMode = siccMode | ||
|
||
componentPlan.BootstrapModule = "[email protected]:chanzuckerberg/shared-infra//terraform/modules/aws-env" | ||
|
||
envPlan.Components["cloud-env"] = componentPlan | ||
} | ||
|
||
envPlans[envName] = envPlan | ||
} | ||
return envPlans | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters