Taking backup of the built from OCI












1















I have used Terraform to built the instance and the resources in the OCI. Some I have done using the OCI console.



I would like to export all the built in some format to maintain that as a backup. In future if my instance or the resources gets changed accidentally or the corruption of data occurs, I need this export file to built the full environment.



Currently Terraform does not do the modification in the existing form while creating or doing changes in the instance or resource. It overwrites and changes everything, all the modification done in the OCI is reverted back if they are done using OCI console.



So please suggest me a way to export the current complete built. And any other scripting way to be followed for building the OCI.










share|improve this question





























    1















    I have used Terraform to built the instance and the resources in the OCI. Some I have done using the OCI console.



    I would like to export all the built in some format to maintain that as a backup. In future if my instance or the resources gets changed accidentally or the corruption of data occurs, I need this export file to built the full environment.



    Currently Terraform does not do the modification in the existing form while creating or doing changes in the instance or resource. It overwrites and changes everything, all the modification done in the OCI is reverted back if they are done using OCI console.



    So please suggest me a way to export the current complete built. And any other scripting way to be followed for building the OCI.










    share|improve this question



























      1












      1








      1








      I have used Terraform to built the instance and the resources in the OCI. Some I have done using the OCI console.



      I would like to export all the built in some format to maintain that as a backup. In future if my instance or the resources gets changed accidentally or the corruption of data occurs, I need this export file to built the full environment.



      Currently Terraform does not do the modification in the existing form while creating or doing changes in the instance or resource. It overwrites and changes everything, all the modification done in the OCI is reverted back if they are done using OCI console.



      So please suggest me a way to export the current complete built. And any other scripting way to be followed for building the OCI.










      share|improve this question
















      I have used Terraform to built the instance and the resources in the OCI. Some I have done using the OCI console.



      I would like to export all the built in some format to maintain that as a backup. In future if my instance or the resources gets changed accidentally or the corruption of data occurs, I need this export file to built the full environment.



      Currently Terraform does not do the modification in the existing form while creating or doing changes in the instance or resource. It overwrites and changes everything, all the modification done in the OCI is reverted back if they are done using OCI console.



      So please suggest me a way to export the current complete built. And any other scripting way to be followed for building the OCI.







      terraform oci oracle-cloud-infrastructure






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 25 at 18:51









      Rotemya

      1,29111524




      1,29111524










      asked Nov 28 '18 at 22:14









      Jijin ShajiJijin Shaji

      62




      62
























          1 Answer
          1






          active

          oldest

          votes


















          1














          In Terraform, your configuration file is always going to be the source of truth. When you apply your configuration the first time, Terraform stores the state of the created resources in a state file.



          If you make changes to the resources in OCI console, Terraform will not know about them until the next time you run "terraform apply". It will detect that the resources have changed. But it will also decide to apply your configuration file over your OCI console changes. It will also warn you about this first.



          This is part of the expected contract of Terraform. You would need to update your configuration file to tell Terraform exactly how you want your infrastructure to look like.



          Unfortunately, there is no tool that will currently take your OCI console changes and automatically update your configuration file.



          The closest thing to this is the "terraform import" command. The import functionality is limited to updating your state file with resources that were created in OCI console; but does not update your configuration file.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53528921%2ftaking-backup-of-the-built-from-oci%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            In Terraform, your configuration file is always going to be the source of truth. When you apply your configuration the first time, Terraform stores the state of the created resources in a state file.



            If you make changes to the resources in OCI console, Terraform will not know about them until the next time you run "terraform apply". It will detect that the resources have changed. But it will also decide to apply your configuration file over your OCI console changes. It will also warn you about this first.



            This is part of the expected contract of Terraform. You would need to update your configuration file to tell Terraform exactly how you want your infrastructure to look like.



            Unfortunately, there is no tool that will currently take your OCI console changes and automatically update your configuration file.



            The closest thing to this is the "terraform import" command. The import functionality is limited to updating your state file with resources that were created in OCI console; but does not update your configuration file.






            share|improve this answer




























              1














              In Terraform, your configuration file is always going to be the source of truth. When you apply your configuration the first time, Terraform stores the state of the created resources in a state file.



              If you make changes to the resources in OCI console, Terraform will not know about them until the next time you run "terraform apply". It will detect that the resources have changed. But it will also decide to apply your configuration file over your OCI console changes. It will also warn you about this first.



              This is part of the expected contract of Terraform. You would need to update your configuration file to tell Terraform exactly how you want your infrastructure to look like.



              Unfortunately, there is no tool that will currently take your OCI console changes and automatically update your configuration file.



              The closest thing to this is the "terraform import" command. The import functionality is limited to updating your state file with resources that were created in OCI console; but does not update your configuration file.






              share|improve this answer


























                1












                1








                1







                In Terraform, your configuration file is always going to be the source of truth. When you apply your configuration the first time, Terraform stores the state of the created resources in a state file.



                If you make changes to the resources in OCI console, Terraform will not know about them until the next time you run "terraform apply". It will detect that the resources have changed. But it will also decide to apply your configuration file over your OCI console changes. It will also warn you about this first.



                This is part of the expected contract of Terraform. You would need to update your configuration file to tell Terraform exactly how you want your infrastructure to look like.



                Unfortunately, there is no tool that will currently take your OCI console changes and automatically update your configuration file.



                The closest thing to this is the "terraform import" command. The import functionality is limited to updating your state file with resources that were created in OCI console; but does not update your configuration file.






                share|improve this answer













                In Terraform, your configuration file is always going to be the source of truth. When you apply your configuration the first time, Terraform stores the state of the created resources in a state file.



                If you make changes to the resources in OCI console, Terraform will not know about them until the next time you run "terraform apply". It will detect that the resources have changed. But it will also decide to apply your configuration file over your OCI console changes. It will also warn you about this first.



                This is part of the expected contract of Terraform. You would need to update your configuration file to tell Terraform exactly how you want your infrastructure to look like.



                Unfortunately, there is no tool that will currently take your OCI console changes and automatically update your configuration file.



                The closest thing to this is the "terraform import" command. The import functionality is limited to updating your state file with resources that were created in OCI console; but does not update your configuration file.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 28 '18 at 23:29









                Alex NgAlex Ng

                111




                111
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53528921%2ftaking-backup-of-the-built-from-oci%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

                    Calculate evaluation metrics using cross_val_predict sklearn

                    Insert data from modal to MySQL (multiple modal on website)