
Initialization requires us to connect to the remote backend.įor the local copy, the backend “http” block would not work. The Terraform project is not initialized locally. Can we perform local development and perform tests? Perhaps, no, for a couple of reasons. However, we also have the Terraform configuration files created on the local system. CI/CD pipeline that automates the provisioning.Īs far as updating and committing the changes to the configuration on the web browser is concerned – all of this works well since everything is managed by GitLab. The configuration that creates an EC2 instance. USING GIT ANNEX WITH GITLAB CODE
With these five files created, create a commit and push the code to the Gitlab project/repository. It is a reference to the constructs from the files included at the very beginning.
We will get back to this later in this post.Įach stage uses the keyword “extends” with a certain. We have not yet defined the cleanup stage.
deploy – executes terraform apply command. build – initializes the code on the runner. fmt – for formatting the Terraform config. If we look at the stages, they are very much similar to the Terraform operations we would perform in a workflow. Next, we declared the stage names and defined the same in a sequence.
In the YAML file above, we have included a couple of Templates. This improves readability and promotes code reuse. In GitLab, it is possible to reuse other YAML templates stored locally, remotely, or in a different project. Here we have included a couple of templates at the beginning.