Skip to main content

·200 words·1 min

Universal Settings to Consider #

Remote State #

Are you going to maintain a single state file or group linked modules/deployments to shared state files?

Shared Provider Directory #

To limit the requirement of downloading providers each time, are you going to specify a source directory for your provider files?

#


Workspaces #

Pros #

  • Can easily switch between configurations of a single module
  • Less root configuration folders to maintain, all similar workspaces can be run from the same directory

Cons #

  • May be difficult to evaluate the resources deployed
  • Doesn’t handle differences well between deployments

Copying Root Configuration Directories #

Pros #

  • Your directory tree represents your infrastructure
  • Only need to update tfvars file to adjust between deployments

Cons #

  • Requires a lot of path references
  • A lot of file duplication
  • Default variable values are difficult to use because all potential variables must be used in the source configurations files

Using -chdir #

Pros #

  • Deployment can be represented by a sinlge tfvars file

Cons #

  • Requires path references
  • Must track which source directory you deployed from

Creating main.tf configurations programmatically #

Pros #

  • Easy to read
  • Simple file deployment structure

Cons #

  • Must maintain code to build configurations