Country or region and language

    Choose your country or region and your language.

    Suggested for you

      All countries and regions

        Choose your character

        It shows in the top bar and on your profile. Change it any time.

        Terraform course

        Lifecycle rules

        Opening Terraform
        Your turn

        Terraform lifecycle: replacement and protection

        A lifecycle rule changes how Terraform handles a resource transition. Read it alongside the proposed action and the provider’s schema.

        create_before_destroy asks Terraform to create the replacement before destroying the old object. That ordering can reduce an interruption, but it requires both objects to coexist and enough capacity for the overlap. A unique name or a constrained quota can prevent it.

        prevent_destroy rejects a plan that would destroy the protected resource while the rule applies. Removing the resource block also removes its lifecycle configuration, so it is not a permanent protection against every code change. Organizational review and provider permissions remain separate controls.

        ignore_changes can leave selected externally managed attributes out of update reconciliation. It doesn’t establish that the external owner made the right change. Document the owner and the attributes being delegated.

        The official lifecycle reference explains the full rules. In this browser model, inspect replacement plans and dependency reasoning. The local provider cannot prove real object naming rules, quotas, availability or deployment timing.

        Your Work Gym account

        Save your progress and pick up on another device. Your browser's progress comes with you.

        or

        You can keep practicing without an account.

        Change your plan

        Checking the price

        Help and feedback

        Ask a question, tell us what is not working, or share an idea. We reply by email.

        What is it about?

        We use it only to reply to you.