This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
Parameterize Terraform and Add a CI/CD Pipeline #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR contains the following:
Terraform Code
There are a few updates to the Terraform code.
dynamic
blocks - This allows users to specify multipleinbound
andoutbound
rules, without hardcoding them into the TF code.node_pool
- By making this a module, we can reuse the code for creating the nodes. All the information about the necessary node pools can be configured in thetfvars
file. This follows the concept ofDRY
and makes it possible to have varying numbers ofnode_pool
based on environments.environments
. This concept is discussed further in theUSER_MANUAL.md
.CI/CD Pipeline
The CI/CD pipeline will allow users to run the
terraform plan
,terraform apply
, andterraform destroy
. The setup and utilization can be found in theUSER_MANUAL.md
. For now its a manual pipeline that only does Terraform. A section for future work is captured in the user manual. I would love to add the following to the pipeline:Disclaimer
terraform destroy
- The code for theterraform destroy
will fail if the VPC created by Terraform is set by Digital Ocean todefault
. We can utilize thelifecycle
block, but there are various things to consider before doing so. This is also discussed in the following thread.Conclusion
Please read the
USER_MANUAL.md
which can be found at:public-merge-kintsugi/terraform/USER_MANUAL.md
. This should provide a good starting point for set up and testing. Please let me know if the documentation is not clear, or if you would like further clarification. I think this is a good starting point for the IaC, and it allows for further improvements down the road.Let me know what you think!
Best regards,
Abdul Rabbani