{"id":45916,"date":"2022-03-28T00:00:00","date_gmt":"2022-03-28T00:00:00","guid":{"rendered":"urn:uuid:914b8964-4fe3-80c1-a7d9-bfff419a0041"},"modified":"2022-03-28T00:00:00","modified_gmt":"2022-03-28T00:00:00","slug":"terraform-tutorial-drift-detection-strategies","status":"publish","type":"post","link":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/","title":{"rendered":"Terraform Tutorial: Drift Detection Strategies"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.trendmicro.com\/content\/dam\/trendmicro\/global\/en\/devops\/22\/c\/terraform-drift-detection-strategies\/tn-terraform-drift.jpg\"><\/p>\n<div><img decoding=\"async\" src=\"https:\/\/www.trendmicro.com\/content\/dam\/trendmicro\/global\/en\/devops\/22\/c\/terraform-drift-detection-strategies\/tn-terraform-drift.jpg\" class=\"ff-og-image-inserted\"><\/div>\n<p>A common misconception among DevOps teams using infrastructure as code (IaC) tools is that the templates they use to run their deployments are infallible sources of truth. Instead, a fundamental challenge of architectures built using tools like Terraform is configuration drift. This occurs when the actual state of your infrastructure begins to accumulate changes and deviates from the configurations defined in your code.<\/p>\n<p>Configuration drift can occur for many reasons, regardless of how good your DevOps engineers are at trying to avoid it. Even when your deployments are completely dependent on IaC, there might be situations where drift occurs. Common failure points typically include adding, removing, or modifying remote resources.<\/p>\n<p>Another big risk is that there\u2019s no easy way to guarantee that deployments in cloud environments are only being implemented by using IaC. It\u2019s often still possible to deploy manually or semi-manually by using the web portal browser, command-line interface, or via APIs.<\/p>\n<p>Because this is an ongoing\u2014and potentially serious\u2014problem in environments that rely on IaC, this article will show your DevOps teams how to counteract common Terraform drift. This article explores a few different strategies for detecting, monitoring, and remediating drift using examples from a sample Azure Virtual Machine deployment.<\/p>\n<p><span class=\"body-subhead-title\">Terraform state<\/span><\/p>\n<p>To better understand how Terraform drift can occur, it\u2019s important to know the purpose and significance of the Terraform state.<\/p>\n<p>In addition to containing environmental metadata, the most significant function of the Terraform state is to be the single source of truth for your back-end APIs. Terraform uses a declarative approach to configuration and resource mapping, binding each remote object to a resource and then recording this association in a Terraform state file.<\/p>\n<p>To do this, it contains the list of deployed resources with their settings and parameters and keeps track of any providers and dependencies.<\/p>\n<p>At the start of a simple <a href=\"https:\/\/www.terraform.io\/cli\/commands\/plan\" target=\"_blank\" rel=\"noopener\">terraform plan<\/a> deployment job, for example, the terraform.tfstate file is initialized with these properties:<\/p>\n<p><span class=\"pre\">Directory of C:\\Terraform\\my1stlinuxvm<br \/>02\/09\/2022&nbsp; 03:03 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 terraform.tfstate<\/span><\/p>\n<p>After running the deployment, the summary is a little different:<\/p>\n<p><span class=\"pre\">Directory of C:\\Terraform\\my1stlinuxvm<br \/>02\/09\/2022&nbsp; 03:09 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 27,589 terraform.tfstate<\/span><\/p>\n<p>The state file contains extensive details about all deployed resources. For example, it encodes approximately 25Mb of state information to deploy your Azure Virtual Machine\u2014including the deployment and state metadata itself. This metadata is found at the beginning of the file:<\/p>\n<p><span class=\"pre\">{<br \/>&nbsp;&nbsp;&nbsp; &#8220;version&#8221;: 4,<br \/>&nbsp;&nbsp;&nbsp; &#8220;terraform_version&#8221;: &#8220;0.13.4&#8221;,<br \/>&nbsp;&nbsp;&nbsp; &#8220;serial&#8221;: 12,<br \/>&nbsp;&nbsp;&nbsp; &#8220;lineage&#8221;: &#8220;ba42cc9f-46ae-13f5-4808-08716f7b82b1&#8221;,<br \/>&nbsp;&nbsp;&nbsp; &#8220;outputs&#8221;: {},<br \/>&nbsp;&nbsp;&nbsp; &#8220;resources&#8221;: [<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;mode&#8221;: &#8220;managed&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;type&#8221;: &#8220;azurerm_linux_virtual_machine&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;myterraformvm&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;provider&#8221;: &#8220;provider[\\&#8221;registry.terraform.io\/hashicorp\/azurerm\\&#8221;]&#8221;,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;instances&#8221;: [<\/span><\/p>\n<p>The Terraform state file also contains various environment metadata. In this case, the file clearly identifies the version of Terraform used for running the deployment. This is important to the <a href=\"https:\/\/www.hashicorp.com\/resources\/what-is-mutable-vs-immutable-infrastructure\" target=\"_blank\" rel=\"noopener\">immutable approach<\/a> that HashiCorp utilizes for infrastructure management. The metadata also includes a serial parameter, which is the file\u2019s internal counter indicating how many iterations of state change have occurred.<\/p>\n<p>The state is encoded as a JSON file. This makes it more machine-friendly than the native HashiCorp Configuration Language (HCL) used in most Terraform files, which is designed to emphasize readability by humans.<\/p>\n<p>Although it\u2019s a JSON document, the state file isn\u2019t intended to be directly manually modified, as this will tamper with its condition and might corrupt it.<\/p>\n<p>Instead, to get a clearer view of the state\u2019s contents, run the terraform show command, which will output something similar to this:<\/p>\n<p><span class=\"pre\">C:\\Terraform&gt;terraform show<br \/># azurerm_linux_virtual_machine.myterraformvm:<br \/>resource &#8220;azurerm_linux_virtual_machine&#8221; &#8220;myterraformvm&#8221; {<br \/>&nbsp;&nbsp;&nbsp; admin_username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= &#8220;azureuser&#8221;<br \/>&nbsp;&nbsp;&nbsp; allow_extension_operations&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = true<br \/>&nbsp;&nbsp;&nbsp; computer_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;myvm&#8221;<br \/>&nbsp;&nbsp;&nbsp; disable_password_authentication = true<br \/>&nbsp;&nbsp;&nbsp; encryption_at_host_enabled&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = false<br \/>&nbsp;&nbsp;&nbsp; extensions_time_budget&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;PT1H30M&#8221;<br \/>&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;\/subscriptions\/46801f45-d426-43b3-a094-0781444710a8\/resourceGroups\/my1stTFRG\/providers\/Microsoft.Compute\/virtualMachines\/myVM&#8221;<br \/>&nbsp;&nbsp;&nbsp; location&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;eastus&#8221;<br \/>&nbsp;&nbsp;&nbsp; max_bid_price&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= -1<br \/>&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;myVM&#8221;<br \/>&nbsp;&nbsp;&nbsp; network_interface_ids&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;\/subscriptions\/46801f45-d426-43b3-a094-0781444710a8\/resourceGroups\/my1stTFRG\/providers\/Microsoft.Network\/networkInterfaces\/myNIC&#8221;,<\/span><\/p>\n<p>Here, you can see all details from the last successful deployment state of these example resources.<\/p>\n<p><span class=\"body-subhead-title\">How drift creeps in<\/span><\/p>\n<p>Although Terraform\u2019s approach keeps things tidy when your DevOps engineers make changes from the Terraform CLI, changes outside the platform remain invisible to the Terraform state until the next terraform plan or terraform apply command.<\/p>\n<p>For example, if a DevOps engineer changes a VM size configuration using a manual update process, like a cloud CLI or portal, or runs a non-Terraform-automated process, like CloudFormation, an ARM template, Chef, Puppet, or Ansible, the Terraform State file won\u2019t detect the change.<\/p>\n<p>DevOps engineers can sometimes identify these differences by using the terraform plan command followed by the terraform apply command, but some changes can invisibly break the state and need to be manually resolved. In particular, aggregate types and API responses should be error-checked.<\/p>\n<p>You should therefore be cautious when modifying resources outside of Terraform and subsequently using terraform apply in your automations after doing so, as this command will revert your changes. Modifications like this can result in deployment failures by adversely changing the availability of deployed resources or even destructively affecting their state.<\/p>\n<p><span class=\"body-subhead-title\">Detecting Terraform drift<\/span><\/p>\n<p>The most basic way to detect drift is by comparing a Terraform state file to monitoring metrics provided by the actual infrastructure. This might involve something like comparing the Terraform state file to information from a cloud provider\u2019s API to find discrepancies that would indicate configuration drift.<\/p>\n<p><span class=\"body-subhead-title\">The READ method<\/span><\/p>\n<p>You can use a provider\u2019s READ method to capture the state of a schema and ensure that it\u2019s synchronized to your state file. Provider CREATE and UPDATE functions frequently normalize inputs\u2014as in the case of sanitized string inputs\u2014or apply default values to unspecified (often optional) attributes. So, it\u2019s good practice to call the READ method after any modifications to ensure your state is synchronized.<\/p>\n<p><span class=\"body-subhead-title\">Terraform refresh<\/span><\/p>\n<p>It\u2019s tedious to compare files manually, and you can\u2019t always rely on good practice being implemented universally, so Terraform provides commands for drift detection and remediation.<\/p>\n<p>In the past, developers could use terraform refresh to validate configuration updates. This command reads the state of managed remote objects and updates the state file accordingly. However, <a href=\"https:\/\/www.terraform.io\/cli\/commands\/refresh\" target=\"_blank\" rel=\"noopener\">terraform refresh is now deprecated<\/a>, as its behavior can cause serious issues if remote resources are incorrectly configured. It should only be used in versions of Terraform before v0.15.4.<\/p>\n<p><span class=\"body-subhead-title\">Terraform plan<\/span><\/p>\n<p>So, how do you easily remedy drift in your state file after making changes to remote objects outside of Terraform? If you need to perform a simple refresh, it\u2019s now recommended that you use the terraform plan command and apply the \u2013refresh-only option:<\/p>\n<p>terraform plan \u2013refresh-only<\/p>\n<p>The refresh functionality is also natively integrated in terraform plan and terraform apply, which are the two main commands used to trigger the deployment of resources.<\/p>\n<p>To run a Terraform-based deployment of resources, you&#8217;ll need to follow three steps:<\/p>\n<ol>\n<li>You\u2019ll start with the terraform init command, which initializes the resource provider\u2014Azure, AWS, Kubernetes, or whichever provider you\u2019re using\u2014and validates your terraform template file or files for syntax correctness.<\/li>\n<li>Next, run terraform plan. This command runs through your Terraform template and validates the deployment in a pre-deployment state. Consider this a check of what will get deployed in the final step.<\/li>\n<li>Use terraform apply to run the deployment. This command connects to the target environment and deploys the defined resources from the template file or files.<\/li>\n<\/ol>\n<p>The terraform.state file is created during the execution of the apply step, storing the actual most up-to-date state of the deployment in it.<\/p>\n<p>Here&#8217;s an example output of the terraform plan phase in your Azure Virtual Machine deployment, where the deploy.tf file is stored in a folder called my1stlinuxvm:<\/p>\n<p><span class=\"pre\">&gt; terraform plan my1stlinuxvm<\/span><\/p>\n<p>Refreshing Terraform state in-memory prior to plan&#8230;<br \/>The refreshed state will be used to calculate this plan, but will not be<br \/>persisted to local or remote state storage.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>An execution plan has been generated and is shown below.<br \/>Resource actions are indicated with the following symbols:<br \/>+ create<\/p>\n<p>Terraform will perform the following actions:<\/p>\n<p>&nbsp; # azurerm_linux_virtual_machine.myterraformvm will be created<br \/>&nbsp; + resource &#8220;azurerm_linux_virtual_machine&#8221; &#8220;myterraformvm&#8221; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + admin_username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;azureuser&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + allow_extension_operations&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = true<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + computer_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;myvm&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + disable_password_authentication = true<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + extensions_time_budget&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;PT1H30M&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + location&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;eastus&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + max_bid_price&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -1<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;myVM&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + network_interface_ids&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;Regular&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + private_ip_address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + private_ip_addresses&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + provision_vm_agent&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = true<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + public_ip_address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + public_ip_addresses&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + resource_group_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;my1stTFRG&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;Standard_DS2_v2&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + tags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + &#8220;environment&#8221; = &#8220;Terraform Demo&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + virtual_machine_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + zone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<\/p>\n<p>Notice when running this command, it clearly identifies the integrated refresh functionality. You can see this in the second line through the Refreshing Terraform state&#8230; operation.<\/p>\n<p>From there, initiate the actual deployment by running and examining the output of a terraform apply command:<\/p>\n<p><span class=\"pre\">&gt; terraform apply my1stlinuxvm<\/span><\/p>\n<p>An execution plan has been generated and is shown below.<br \/>Resource actions are indicated with the following symbols:<br \/>&nbsp; + create<\/p>\n<p>Terraform will perform the following actions:<\/p>\n<p>&nbsp; # azurerm_linux_virtual_machine.myterraformvm will be created<br \/>&nbsp; + resource &#8220;azurerm_linux_virtual_machine&#8221; &#8220;myterraformvm&#8221; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + admin_username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;azureuser&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + allow_extension_operations&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = true<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + computer_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;myvm&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;+ disable_password_authentication = true<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + extensions_time_budget&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;PT1H30M&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + location&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;eastus&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + max_bid_price&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -1<br \/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;+ name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;myVM&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + network_interface_ids&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;Regular&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + private_ip_address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + private_ip_addresses&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + provision_vm_agent&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = true<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + public_ip_address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + public_ip_addresses&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (known after apply)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + resource_group_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;my1stTFRG&#8221;<br \/>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;+ size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#8220;Standard_DS2_v2&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + tags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + &#8220;environment&#8221; = &#8220;Terraform Demo&#8221;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p>Once the deployment is complete, you can validate the Azure VM and, for example, check the size in the Azure Portal:<\/p>\n<p> Read More <a href=\"https:\/\/www.trendmicro.com\/en_us\/devops\/22\/c\/terraform-tutorial-drift-detection-strategies.html\">HERE<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A fundamental challenge of architecture built using tools like Terraform is configuration drift. Check out these actionable strategies and steps you can take to detect and mitigate Terraform drift and manage any drift issues you might face. Read More HERE&#8230;<\/p>\n","protected":false},"author":2,"featured_media":45917,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_layout":"default_layout","footnotes":""},"categories":[61],"tags":[9503,9505,9502,9501,9572,9506,9507],"class_list":["post-45916","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-trendmicro","tag-trend-micro-devops-article","tag-trend-micro-devops-aws","tag-trend-micro-devops-azure","tag-trend-micro-devops-cloud-native","tag-trend-micro-devops-conformity","tag-trend-micro-devops-expert-perspective","tag-trend-micro-devops-multi-cloud"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Terraform Tutorial: Drift Detection Strategies 2026 | ThreatsHub Cybersecurity News<\/title>\n<meta name=\"description\" content=\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security &amp; Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Terraform Tutorial: Drift Detection Strategies 2026 | ThreatsHub Cybersecurity News\" \/>\n<meta property=\"og:description\" content=\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security &amp; Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/\" \/>\n<meta property=\"og:site_name\" content=\"ThreatsHub Cybersecurity News\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-28T00:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.trendmicro.com\/content\/dam\/trendmicro\/global\/en\/devops\/22\/c\/terraform-drift-detection-strategies\/tn-terraform-drift.jpg\" \/>\n<meta name=\"author\" content=\"TH Author\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@threatshub\" \/>\n<meta name=\"twitter:site\" content=\"@threatshub\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TH Author\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/\"},\"author\":{\"name\":\"TH Author\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/person\\\/12e0a8671ff89a863584f193e7062476\"},\"headline\":\"Terraform Tutorial: Drift Detection Strategies\",\"datePublished\":\"2022-03-28T00:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/\"},\"wordCount\":2832,\"publisher\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/terraform-tutorial-drift-detection-strategies.jpg\",\"keywords\":[\"Trend Micro DevOps : Article\",\"Trend Micro DevOps : AWS\",\"Trend Micro DevOps : Azure\",\"Trend Micro DevOps : Cloud Native\",\"Trend Micro DevOps : Conformity\",\"Trend Micro DevOps : Expert Perspective\",\"Trend Micro DevOps : Multi Cloud\"],\"articleSection\":[\"TrendMicro\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/\",\"name\":\"Terraform Tutorial: Drift Detection Strategies 2026 | ThreatsHub Cybersecurity News\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/terraform-tutorial-drift-detection-strategies.jpg\",\"datePublished\":\"2022-03-28T00:00:00+00:00\",\"description\":\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/terraform-tutorial-drift-detection-strategies.jpg\",\"contentUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/terraform-tutorial-drift-detection-strategies.jpg\",\"width\":641,\"height\":350},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/terraform-tutorial-drift-detection-strategies\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Trend Micro DevOps : Article\",\"item\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/tag\\\/trend-micro-devops-article\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Terraform Tutorial: Drift Detection Strategies\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\",\"name\":\"ThreatsHub Cybersecurity News\",\"description\":\"%%focuskw%% Threat Intel \u2013 Threat Intel Services \u2013 CyberIntelligence \u2013 Cyber Threat Intelligence - Threat Intelligence Feeds - Threat Intelligence Reports - CyberSecurity Report \u2013 Cyber Security PDF \u2013 Cybersecurity Trends - Cloud Sandbox \u2013- Threat IntelligencePortal \u2013 Incident Response \u2013 Threat Hunting \u2013 IOC - Yara - Security Operations Center \u2013 SecurityOperation Center \u2013 Security SOC \u2013 SOC Services - Advanced Threat - Threat Detection - TargetedAttack \u2013 APT \u2013 Anti-APT \u2013 Advanced Protection \u2013 Cyber Security Services \u2013 Cybersecurity Services -Threat Intelligence Platform\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\"},\"alternateName\":\"Threatshub.org\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\",\"name\":\"ThreatsHub.org\",\"alternateName\":\"Threatshub.org\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Threatshub_Favicon1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Threatshub_Favicon1.jpg\",\"width\":432,\"height\":435,\"caption\":\"ThreatsHub.org\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/threatshub\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/person\\\/12e0a8671ff89a863584f193e7062476\",\"name\":\"TH Author\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"caption\":\"TH Author\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Terraform Tutorial: Drift Detection Strategies 2026 | ThreatsHub Cybersecurity News","description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/","og_locale":"en_US","og_type":"article","og_title":"Terraform Tutorial: Drift Detection Strategies 2026 | ThreatsHub Cybersecurity News","og_description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","og_url":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/","og_site_name":"ThreatsHub Cybersecurity News","article_published_time":"2022-03-28T00:00:00+00:00","og_image":[{"url":"https:\/\/www.trendmicro.com\/content\/dam\/trendmicro\/global\/en\/devops\/22\/c\/terraform-drift-detection-strategies\/tn-terraform-drift.jpg","type":"","width":"","height":""}],"author":"TH Author","twitter_card":"summary_large_image","twitter_creator":"@threatshub","twitter_site":"@threatshub","twitter_misc":{"Written by":"TH Author","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/#article","isPartOf":{"@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/"},"author":{"name":"TH Author","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/person\/12e0a8671ff89a863584f193e7062476"},"headline":"Terraform Tutorial: Drift Detection Strategies","datePublished":"2022-03-28T00:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/"},"wordCount":2832,"publisher":{"@id":"https:\/\/www.threatshub.org\/blog\/#organization"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/#primaryimage"},"thumbnailUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2022\/03\/terraform-tutorial-drift-detection-strategies.jpg","keywords":["Trend Micro DevOps : Article","Trend Micro DevOps : AWS","Trend Micro DevOps : Azure","Trend Micro DevOps : Cloud Native","Trend Micro DevOps : Conformity","Trend Micro DevOps : Expert Perspective","Trend Micro DevOps : Multi Cloud"],"articleSection":["TrendMicro"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/","url":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/","name":"Terraform Tutorial: Drift Detection Strategies 2026 | ThreatsHub Cybersecurity News","isPartOf":{"@id":"https:\/\/www.threatshub.org\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/#primaryimage"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/#primaryimage"},"thumbnailUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2022\/03\/terraform-tutorial-drift-detection-strategies.jpg","datePublished":"2022-03-28T00:00:00+00:00","description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","breadcrumb":{"@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/#primaryimage","url":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2022\/03\/terraform-tutorial-drift-detection-strategies.jpg","contentUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2022\/03\/terraform-tutorial-drift-detection-strategies.jpg","width":641,"height":350},{"@type":"BreadcrumbList","@id":"https:\/\/www.threatshub.org\/blog\/terraform-tutorial-drift-detection-strategies\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.threatshub.org\/blog\/"},{"@type":"ListItem","position":2,"name":"Trend Micro DevOps : Article","item":"https:\/\/www.threatshub.org\/blog\/tag\/trend-micro-devops-article\/"},{"@type":"ListItem","position":3,"name":"Terraform Tutorial: Drift Detection Strategies"}]},{"@type":"WebSite","@id":"https:\/\/www.threatshub.org\/blog\/#website","url":"https:\/\/www.threatshub.org\/blog\/","name":"ThreatsHub Cybersecurity News","description":"%%focuskw%% Threat Intel \u2013 Threat Intel Services \u2013 CyberIntelligence \u2013 Cyber Threat Intelligence - Threat Intelligence Feeds - Threat Intelligence Reports - CyberSecurity Report \u2013 Cyber Security PDF \u2013 Cybersecurity Trends - Cloud Sandbox \u2013- Threat IntelligencePortal \u2013 Incident Response \u2013 Threat Hunting \u2013 IOC - Yara - Security Operations Center \u2013 SecurityOperation Center \u2013 Security SOC \u2013 SOC Services - Advanced Threat - Threat Detection - TargetedAttack \u2013 APT \u2013 Anti-APT \u2013 Advanced Protection \u2013 Cyber Security Services \u2013 Cybersecurity Services -Threat Intelligence Platform","publisher":{"@id":"https:\/\/www.threatshub.org\/blog\/#organization"},"alternateName":"Threatshub.org","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.threatshub.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.threatshub.org\/blog\/#organization","name":"ThreatsHub.org","alternateName":"Threatshub.org","url":"https:\/\/www.threatshub.org\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2025\/05\/Threatshub_Favicon1.jpg","contentUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2025\/05\/Threatshub_Favicon1.jpg","width":432,"height":435,"caption":"ThreatsHub.org"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/threatshub"]},{"@type":"Person","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/person\/12e0a8671ff89a863584f193e7062476","name":"TH Author","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","caption":"TH Author"}}]}},"_links":{"self":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts\/45916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/comments?post=45916"}],"version-history":[{"count":0,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts\/45916\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/media\/45917"}],"wp:attachment":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/media?parent=45916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/categories?post=45916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/tags?post=45916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}