MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Terraform: run code after resources is created using using remote-exec provisioners

The chef, file, local-exec, puppet, remote-exec, provisioner invokes a script on a remote resource only after it is created. Thus, if you add provisioner code after “terraform apply”, it would not considers as a changes and terraform would flag no resources addition and change.

Thus, How to apply a provisioners changes in resources created. There are 2 method to apply provisioners even after “terraform apply”.

Adding provisioner sections to an existing (already provisioned) aws_instance is not something that terraform notices as a ‘change’, so the provisioner is not run during the next apply. The only way to run the provisioner is to destroy the instance and let terraform create it again.

Method 1 – Destroy and Recreate

Adding provisioner sections to an existing (already provisioned) aws_instance is not something that terraform notices as a ‘change’, so the provisioner is not run during the next apply. The only way to run the provisioner is to destroy the instance and let terraform create it again.

Method 2 – Using null_resource

The solution is to create a resource “null_resource” “nameYouWant” { } and then run your commands inside that. They will run after the initial resources are created:

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Terraform: Example Code for Create Multiple Azure Linux Vms

This page shows how to create several Azure Linux virtual machines from one Terraform configuration by using the count meta-argument. The VMs sit behind a load balancer…

Read More

Debugging Terraform + Helm Drift on EKS: Failure Behaviours and Fixes

A field tutorial based on a real incident removing a stale CriticalAddonsOnly toleration from metrics-server and KEDA on EKS Auto Mode clusters managed by Terraform Cloud (TFC) + the eks-blueprints-addons module. TL;DR We tried to…

Read More

How to Configure pre-commit for Terraform: Complete DevOps Guide with 15 Practical Use Cases, Commands, Security Checks, and Best Practices

Terraform pre-commit Hooks: Installation, Configuration, TFLint, Trivy, Checkov & CI/CD Guide Learn to configure pre-commit for Terraform with step-by-step commands, terraform fmt, validate, TFLint, Trivy, Checkov, terraform-docs,…

Read More

Terraform Tools for Developer Productivity Master Guide

Tools, Workflow, Security, Testing, CI/CD, Automation, AI Assistance, Governance, and Production Best Practices Verified baseline: 5 September 2026Audience: Terraform developers, DevOps/SRE, platform/cloud engineers, module authors, DevSecOps teams, and engineering…

Read More

HCP Terraform (Terraform Cloud) — Complete Guide to Variables, Scope & Precedence

Updated: October 2026 | Based on current HashiCorp documentation HCP Terraform provides several ways to pass values to Terraform code. These include variable defaults, .tfvars files, environment…

Read More

Terraform Cloud (HCP Terraform) — Organization, Project, Workspace, Team & User Mapping

Updated: October 15, 2026 | Based on current HashiCorp documentation Terraform Cloud is now called HCP Terraform. Its architecture separates infrastructure organization from user access management (RBAC)….

Read More