With the introduction of version 0.10 Hashicorp split the core code from the code for the providers, (ie the code that provides the access to AWS, Azure, GCP etc). if successful you should receive a response similar to below. If you have code the was written in an earlier version, run the command terraform fmt to configure the code to be compliant with latest version. Since the introduction of version 0.12 there have been a number of changes to the way you run your terraform code. Now that we have run though the code it is time to run it. This gives us a visual overview of the deployment (click for large). Running this command produces the image shown below. terraform graph -type=plan | "c:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe" -Tpng > graph.png If you remember the first post, I mentioned a terraform commnad called terraform graph. What this does is provide a graphical representation of the deployed environment. Parameter_group_name = "default.mysql5.7" resource "aws_instance" "my_web_instance" " For full details on all the options available to configure a server please review the terraform documentation, but the example below will create a ready-to-go web server. The Stanza below shows the code that will deploy the Web Instance of the LAMP stack. Followed by definitions specific to the object being created. Now once again the resource command as with all Terraform commands follows a common form command, what is it to be, what are you calling it. The first major active resource to be created is that of the Web-server. ?> Creating the web server with Terraform The php index is shown below, you will need to save this out to a file called index.php and store it in the same directory as your terraform code. The Terraform code for this is in a text file here, remember to rename the file with a *.tf extension. In this post we will build out the web server and the RDS-based MySQL database. Please review part one to see how the network was created and configured. In this third in the series on Terraform, and the second on deploying a LAMP stack, we continue on with explaining the code used to deploy the solution.
0 Comments
Leave a Reply. |