vistaprint / terraformdevkit Goto Github PK
View Code? Open in Web Editor NEWSet of scripts to ease development and testing with Terraform.
License: Other
Set of scripts to ease development and testing with Terraform.
License: Other
When plan
is empty, TerraformDevkit still prompts for a terraform apply
. In case it's empty, we may want to skip terraform apply
itself (while still doing pre_apply
and post_apply
)
rake apply[env]
currently fails because of gruntwork-io/terragrunt#316
At the moment we only use terragrunt to create the lock table in dynamodb. We can automate this using the projects name and the aws-sdk in ruby.
At this moment TerraformDevKit requires users to provide AWS credentials. In addition to that, it is not clear how easy or transparent is to use other providers (e.g., Azure or Google). For instance, prod and test environments require manual input of the AWS profile.
Perhaps users should just pass all credentials info as part of the extra vars that end up being used when rendering the templates. For safety reasons, instead of asking for the profile name, we could just use some sort of captcha (e.g., asking for the result of a mathematical operation as well as printing some clear warning message).
Preflight task uses Socket.gethostname
to obtain the hostname, and then construct the temporal environment name together with a timestamp.
If the hostname contains an invalid character (i.e., any non-alphanumeric character) the execution will fail.
When running rake preflight
, there is no finish status after the task has completed and one has to determine if it succeeded or not based on the presence of error messages in the console.
Printing the execution result ( preflight SUCCEEDED
/ preflight FAILED
) would be useful.
Currently S3 buckets for remote state are set with default values. It would be useful to enable versioning so if a state is changed we can revert back,
After creating the infrastructure it might be necessary to do some further action. For instance, Athena tables cannot be created with terraform (yet). So, they need to be created by using the SDK. A post_apply
task would be the perfect fit for these type of actions.
We currently use running_on_jenkins?
to determine whether the execution is part of a continuous integration process. This is certainly not very generic.
For AWS infrastructures, for instance, one of the differences when running on jenkins is that the shared credentials file does not typically exist on the jenkins server. Instead, a key and secret are used. On development machines, using the profile information stored in the shared credentials file is the preferred option as it is more flexible.
It would be desirable to find a more generic approach to solve this requirement.
We can use travis to auto publish to rubygems when a tag is added to the repo. See the Docs
In some case the result of executing terraform is not checked (e.g., see
TerraformDevKit/tasks/devkit.rake
Line 98 in 28b0ecd
Fix that. Ideally, we could use the latest implementation of Command.run (available in feature/use-fixed-command
).
In some cases it is desirable to auto-generate some files that later during the prepare step will be copied into the environment folder. To do so, an extra hook is needed.
While updating the modules each time prevents using an old version of the modules, it also takes significantly longer. If modules are obtained from git (using a tag) there should be automatically updated when the version tag is changed. So, other than when using local modules, it seems there shouldn't be much need to update them every time.
When a mustache file is deleted the corresponding generated tf file in the envs folder is not deleted and must be removed manually. The same happens when a file is renamed, the original file is kept and the new file created.
We could remove all the tf files before generating them or check that the envs folder contains only tf files that have a corresponding mustache file, removing those that don't.
Since version 0.11.0 Terrafrom requires user input to run an apply in the same way that destroy requires user input to destroy infrastructure.
Right now the apply task cannot be used to force create infrastructure like destroy can be forced to teardown.
We should update the apply task to allow users to force create infrastructure if we´re in dev.
TerraformDevKit currently includes a command line utility to wait for a URL to be ready. There is no such a feature in the library itself. It would be desirable to move the request with retry implementation to the library, and then make the console application call the library.
There is no real need to use ROOT_PATH as long as rake is executed in the directory where the Rakefile and the rest of the infrastructure files are located. Using a global variable like ROOT_PATH makes testing more complicated and the code not so clear.
Given that we have to set up a few files to get off the ground it might be worthwhile to add a small cli to the package which would allow users to generate the initial project structure by supplying a couple of parameters on the command line.
When performing a rake clean[myenv] command, if the terraform destroy process fails, the clean command removes the environment myenv. That prevents trying to destroy it later.
Currently we only treat as template files any file that ends in .mustache
. We could just support specifying folders/files to use as templates.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.