Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial import of files without removing existing files #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peterwwillis
Copy link

This is the same as branch reorganize-proposal-1, but using the latest
master branch code, and without removing any existing files.


These changes are a proposal for how to manage infrastructure as code.

The basic idea is as follows:

  1. env/ directory contains configuraiton specific to an environment. An 'environment' is any logical grouping of infrastructure that is specific to one particular use case, or location, or account, etc. Environments inherit configuration hierarchically. A component 'airflow' in a directory 'dev' in a directory 'sfo2' in a directory 'docean' will allow that 'airflow' component to inherit the configuration of those parent directories, so configuration never needs to be duplicated across environments. It also allows for simple perusal of configuration to find configuration values specific to an environment, or more global configuration.

  2. A terraform/ directory contains a root directory, where root modules are kept. These modules are passed terraform.sh.tfvars configuration files from an env/. The module is designed to absorb configuration and apply changes the same way in all accounts, with some logic embedded in the Terraform code to work around differences in different environments. In this way, the same root module can be used for multiple environments, keeping the code DRY.

  3. A terraform/ directory also contains a sub directory, which are sub-modules. Think of these as "libraries" of Terraform code. These are not always necessary, but sometimes the extra layer of abstraction is convenient. A well-designed root module is often enough for small projects without the need for sub-modules.

  4. Purpose-built deployment scripts are used to pass the env/ configuration to the components being deployed, which may live in other directories for example the terraform/ modules directories). In some cases, symlinking to an env/ directory can prevent the need to write a custom deployment script.

This proposal is not yet complete. Still to be completed:

  • Finish taking some existing Terraform modules and adapting them with new variables, and filling in the env/ directories with new .tfvars files to carry the variables.

  • Sample of actually planning, importing, and applying existing infrastructure to use this new setup.

  • A guide to developing with this model

  • A guide to deploying with this model

  • Docker, GitHub Actions, and other code/configuration to execute deployment scripts using this model

This is the same as branch reorganize-proposal-1, but using the latest
master branch code, and without removing any existing files.
@peterwwillis
Copy link
Author

peterwwillis commented Feb 27, 2022

This PR should be safe to be merged, as it no longer deletes or moves any files, and only modifies .gitignore and a README.

Copy link
Contributor

@ZavenArra ZavenArra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@ximena9201
Copy link
Contributor

@ZavenArra if we merge this we can start the Tf code from here. Sorry for the late reply. I see is safe to merge though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants