Skip links

Moving Terraform State file to OCI Object Store

When developing with Terraform it is nice to keep everything local on your laptop. Makes for great ease of development; there are time when you want to share your environment, i.e. state file, with others in your development organization.  In order to do this, the state file has to be moved to a common area.  In many environments this would happen by moving the state file to an object store.  Although many people talk about the other cloud platforms and how to do things; Oracle provides a pretty good platform for many items.  The object store is only part of the it.

Build the Object Store

In order to build your object store, first you have to login to Oracle Cloud (cloud.oracle.com).  Once logged in, you then need to go to hamburger menu in the upper left corner.  Under Core Infrastructure, select Object Storage and Object Storage.

oci_object_storage_os_1.png

Once you arrive to the Object Storage page, you will be presented with a button that says Create Bucket.  The bucket is where the state file will reside once it is provisioned there.  Click Create Bucket.

After clicking the Create Bucket button, you are presented with a dialog to build the bucket.  In this dialog, provide the bucket name, what type of storage (Standard) to use and allow Oracle to maintain the encryption.  After ensuring these times are done, then click the Create Bucket button at the bottom of the dialog.

oci_object_storage_os_2.png

At this point, the bucket you plan on using for Terraform State file has been created.

Pre-Authenticated Request

With the Object Storage bucket created the next thing that has to be done is define a Pre-Authenticated Request.  Pre-Authenticated requests are used to allow access to the object storage bucket without having to login each time you want to move an item to the bucket.  This also allows for commands and dynamic commands to access the object store, place and use files in the bucket.

To create a Pre-Authenticated Request, click on the Create Pre-Authenticated Request button. This will bring up the Create Pre-Authenticated Request dialog.  Within this dialog, provide a name, ensure the radio button for Object is selected, ensure that the object can be read/write, lastly set the expiration date.  After all those items are set, click the Create Pre-Authenticated Request button.

oci_object_storage_os_3.png

Once the Pre-Authenticated Request has been created, you will be prompted to copy the corresponding URL.  In our case, this URL looks similar to this:

https://objectstorage.us-ashburn-1.oraclecloud.com/p/Zi1rw_yl1……….4HjMwEU2zaaBmx71sas_oU/n/idtlingilfcy/b/bucket-terraform/o/terraform.tfstate

Configure Backend State

Now that we have the URL needed to make an HTTP request to the Object Storage, we can configure the backend in the main.tf file.  The code block that needs to be established is as follows:

########################
# Backend
########################
terraform {
       backend "http” {
            address = "https://objectstorage.us-ashburn-1.oraclecloud.com/p/Zi1rw_yl1E9Z1q.........zaaBmx71sas_oU/n/idtlingilfcy/b/bucket-terraform/o/terraform.tfstate”
            update_method = “PUT"
       }
}

As you can tell this is quite simple.  We are simply telling terraform to use the HTTP protocol with the backend.  Then providing the address for the backend and what method to use.  In this case, we are using the cURL method of PUT to ensure changes to the state file are updated on the object store.

Initializing 

In order for the state to be placed on the Object Storage that was just created, the terraform environment has to be initialized.  This done by simply running terraform init.  

Validating

After the initialization and/or an apply process, the state file can be validated by looking into the object storage and seeing if the file exists.  In this example, the file was created and modified on 21 June 2020 @ 3:55 am UTC.  

oci_object_storage_os_4.png

Summary

With the Terraform state file located in a cloud environment and in an object storage are it can be shared between members of a development staff and network operations departments.  This makes it easy for everyone to keep track of what workloads have been created within a given cloud environment.  

Enjoy!!!

Leave a comment

  1. Hey there! Do you know if they make any plugins to help with Search Engine Optimization? I’m trying to get my site to rank for some
    targeted keywords but I’m not seeing very good success.

    If you know of any please share. Cheers! You can read similar
    art here: Eco product

  2. sugar defender ingredients Discovering Sugar Protector has been a game-changer for me,
    as I’ve always been vigilant concerning handling my blood sugar levels.
    I currently feel empowered and positive in my capacity to maintain healthy levels, and my most
    current checkup have actually mirrored this development.
    Having a credible supplement to complement my a substantial resource of convenience, and I’m absolutely thankful for the substantial distinction Sugar Defender has actually made
    in my general well-being.

  3. Oh my goodness! Impressive article dude! Thanks, However I am going through problems with your RSS. I don’t understand why I can’t join it. Is there anyone else getting identical RSS problems? Anyone who knows the solution will you kindly respond? Thanks.

  4. May I simply say what a relief to find a person that truly understands what they are discussing on the web. You definitely understand how to bring a problem to light and make it important. More and more people have to read this and understand this side of your story. I was surprised you aren’t more popular since you certainly have the gift.

  5. Hi! I just wish to give you a big thumbs up for the great info you have got here on this post. I am coming back to your blog for more soon.

  6. Howdy! This post could not be written any better! Reading through this article reminds me of my previous roommate! He constantly kept preaching about this. I will send this post to him. Fairly certain he will have a very good read. Thank you for sharing!

  7. Right here is the perfect webpage for everyone who wants to find out about this topic. You know a whole lot its almost hard to argue with you (not that I really will need to…HaHa). You certainly put a brand new spin on a subject which has been written about for decades. Wonderful stuff, just excellent.

  8. Nice post. I learn something totally new and challenging on websites I stumbleupon on a daily basis. It will always be interesting to read through articles from other writers and use something from other sites.

  9. After looking over a few of the articles on your web site, I truly appreciate your technique of writing a blog. I book-marked it to my bookmark webpage list and will be checking back in the near future. Take a look at my website too and let me know your opinion.

  10. Nice post. I learn something new and challenging on sites I stumbleupon every day. It will always be useful to read content from other writers and practice a little something from their websites.

  11. Excellent weblog right here! Additionally your website a lot up fast! What host are you the use of? Can I am getting your associate hyperlink on your host? I wish my website loaded up as fast as yours lol.

  12. Thank you for the well-written blog post. I greatly treasured your generosity and help you offer through the totally free tips on your blog, specially the ones provided through this article. I know Britta would love to read more of your blog post. I’ve sent your website url to her. We love your thoughtfulness during this difficult time.

  13. An outstanding share! I’ve just forwarded this onto a coworker who had been conducting a little homework on this. And he actually bought me breakfast because I stumbled upon it for him… lol. So let me reword this…. Thanks for the meal!! But yeah, thanks for spending the time to discuss this matter here on your blog.

  14. Throughout this time he would briefly flip Luke Skywalker to the dark aspect of the Power by way of sheer power as a lot as by guile, although Luke would later be redeemed by his sister Leia and restored to the sunshine facet of the Power and defeat Palpatine once and for all.

  15. These are assets of the sovereign nations which are typically held in reserves domestic and reserve foreign currencies such as the dollar, euro, pound sterling and yen.

  16. Prices play an especially vital position in market economies by providing important details about commodity and service availability.

  17. Also, most councils require residents to remove all plastic caps and lids from plastic bottles, and completely rinse them out to keep away from unpleasant smells or liquid contamination.

  18. These are a few brokers that traders can trust for opening a trading account and stay assured about the safety of their funds.

  19. Because a fairly small amount of the margin cash manages a considerable amount of funding represented in an equity index contract or settlement, a bit of change in the stock index degree may make a worthwhile return in your cash funding if you’re correct in regards to the share market’s course.

  20. When Americans started the massive shift to cell telephones as an alternative of landlines after phone deregulation, people in areas with poor cell phone coverage have been out of luck.

  21. Naturally sufficient the quantum of relocation and shifting from one place to a different in case or residential as well as industrial folks is kind of substantial in a metropolis like Dallas in Texas.

  22. But with the help of professional experts clients can be rest assured that their trade is going to be much easier and profit oriented that before.

  23. The tornado’s projected path towards several towns prompted the National Weather Service’s Paducah workplace to issue extra twister emergencies over the following two hours because the tornado tracked to the northeast, devastating multiple small towns and communities.

  24. Dugpa (Tibetan) ’drug pa (dug-pa) Adherents of the Buddhist religion of Tibet who, earlier to the reform by Tsong-kha-pa within the 14th century, adopted sorcery and different kind of tantric practices, which are totally international to the pure teachings of Buddhism.

  25. Regardless that he holds the file for the most variety of Everest summits with 17 successful attempts, he solely climbs to afford a brighter future for his youngsters and donates some income from his trekking business to a Sherpa instructional fund.

  26. To be taught how one can fill up your gasoline tank with final evening’s rooster grease, we must first study to tell apart between vegetable oils used as fuels and biodiesel.

  27. Even with that being finished individuals still strain and throw around complaints because they don’t understand what goes on.

  28. That’s because all the rules of the trade are already built into the preset parameters.

  29. I employed a bunch of people, after all, however we had the added excitement of integrating an entire art staff assigned to us, in Austin, by an artwork director a few hundred miles away in Ion Storm’s Dallas workplace.

  30. In 1780, it had become tough to supply British and German prisoners of battle and their guards with meals within the South, the place their presence had become a safety danger.

  31. He recalled that the 1965 program had so many things going simultaneously — among them the Mustang and the Galaxie — that tooling costs were critical.

  32. Terms encrypted excavation refers to obtaining cryptocurrencies by using computers to solve the addition of secret equations.

  33. For a quick breath of summer time, toss a sisal rug down on a hardwood ground, and lay a colorful flooring cloth out in the sunporch.

  34. Shopping for funding property at the lowest doable price is a key to success and leads to a lot increased internet yields.

  35. There are massive service sectors, notably lodges and restaurants, in Flagstaff, with many of those corporations having an in depth connection to NAU’s Faculty of Hotel and Restaurant Management, to make use of these college students.

  36. In July 2011, the fund announced plans to return just under $1 billion to investors by the end of 2011 to avoid reporting requirements under the Dodd-Frank reform act and to focus on family investments.

  37. In developing countries, economic liberalization refers more to liberalization or further “opening up” of their respective economies to foreign capital and investments.

  38. By recognizing and addressing the varied environmental elements, educators can create a conducive learning surroundings that supports optimal student outcomes.

  39. In Belmont Hills and Penn Wynne, Pennsylvania, respectively, two individuals have been killed when bushes fell onto the roofs of their automobiles.

  40. Cloudy, overcast and rainy weather prevent the panels from gathering energy, making weather dependency the most significant drawback of solar energy.

  41. In that link, you will have to insert your old password, new password, and confirmation of the new password.

  42. If you’re interspersing serious pc play and study, you will find your stay play bettering.

  43. If you utilize an Index option like the Dow Jones or the S&P, you will not have to be concerned about earnings or analyst projections for a company.

  44. The secret to creating a terrific panini is generous portions of cheese; you need the tasty, melted, cheese to glue the sandwich collectively.

  45. White can attack on the kingside and check out to use the passed h-pawn, whereas Black destroys the centre.

  46. Army Non-public First Class Lawrence Boudreaux, was introduced with the highest French meritorious army award for his actions during World Warfare II.

  47. In fairness, my premium has never gone up because of a non-fault crash but you only have to search online to find hundreds of stories of times when it has.

  48. LTrent driving school was started in 1969 on the
    premise that quality driver training can create a driver that has the skills to survive.

  49. This definition doesn’t include motorcycles, a vehicle that weighs more than 4.5 tonnes
    or a vehicle with seating for more than 12 adults, including the driver.

  50. I would like to say a huge thank you for
    being so professional and I’m so pleased I picked your
    company to help with my business.

  51. The number of driving instructors continues to fall year and year with
    more leaving the job now than ever before.

  52. My PDI’s are able to monitor their pupils lessons and progress and remind their own pupils when their lessons are booked.

  53. All driving instructor applicants will need to pay for a three-year authority,
    as per the current Road Safety (Driving Instructors) Regulations 2020.

  54. You pay the school a set weekly/monthly amount to be given a car and supplied with work.

  55. Tailored for driving schools, local associations and ADI
    groups to provide support, advice and protection for
    drivers, along with our incredible membership benefits and
    events.

  56. Keep up with industry updates and our thoughts on topics impacting instructors, associations and businesses.

  57. LTrent driving school was started in 1969 on the premise that
    quality driver training can create a driver that has the skills
    to survive.

  58. Look for an instructor who is fully qualified and registered with a recognized driving school or governing
    body.

  59. Piers ensures all students are treated with care and respect, nurturing
    their confidence and burgeoning road skills to get
    results.

  60. He begins by calling his CTA (Commodity Buying and selling Advisor) and after consultation locations an order to sell short the equivalent of $10 million of the S&P 500 index on the Chicago Mercantile Exchange “CME”.

  61. In the recent previous India is getting a favoured medical care destination for many nations as a result of low price and good quality medical procedures giving rise to the scope for medical tourism.

  62. When they want to look at a selected section of society, however, economists drill down from a national viewpoint by utilizing knowledge like discretionary revenue.

  63. Doctors and nurses in public hospitals in Zimbabwe held a strike attributable to an absence of protecting gear.

  64. The painters positioned the window part on an open easel positioned earlier than a window, or put the glass flat onto a transparent desk, so the artist may see the impact of the sunshine coming by means of the glass.

  65. Investigate paint and fabric brochures, decorating magazines and books, furniture catalogs, and Internet sites of product manufacturers.

  66. There are a number of reasons why Aozora Alliance might recommend high yield bonds, the first of which is of course the higher rate or return.

  67. Tennessee is home to eight Nationwide Scenic Byways, including the Natchez Hint Parkway, the East Tennessee Crossing Byway, the nice River Highway, the Norris Freeway, Cumberland Nationwide Scenic Byway, Sequatchie Valley Scenic Byway, The Trace, and the Cherohala Skyway.

  68. Town has developed on seven hills with the rivers running between them, a function that inspired the early European-American settlers to call it for Rome, the longtime capital of Italy that was also constructed on seven hills.

  69. But legend has it that Thomson Consumer Electronics (owners of RCA’s Client Electronics Division) still has in storage an electromechanical grasp recorder and disc pressing station.

  70. In terms of the index of volatility – it allows any investor to take a position and trade on volatility in currency exchange or shares markets.

  71. The Vanderbilt University Owen Graduate College of Administration is the graduate enterprise school of Vanderbilt College in Nashville, Tennessee, United States.

  72. LS: Exactly proper. We all get pissed off and dissatisfied, however while you cross that white line, you must be prepared and capable of contribute.

  73. Colleges, universities, and high schools had been solely allowed to offer online lessons whereas elementary and middle colleges have been allowed in-individual instruction following well being pointers.

  74. Practice makes perfect, and will be the best way for you to
    get comfortable behind the wheel and calm your nerves.

  75. Our instructors are trained to work with nervous drivers, making
    learning stress-free.
    Reverse parking doesn’t have to be a nightmare! Our structured lessons make it simple.
    Our driving lessons in Brisbane are designed to be fun, informative, and stress-free.

  76. Learning to drive in Brisbane is an exciting journey, and having a skilled instructor
    makes all the difference!
    Ready to hit the road? Our driving school is the best place to start!
    The sooner you start learning, the sooner you gain independence on the road!

  77. Learning with a qualified instructor makes passing the test much easier!

    Whether you’re a nervous beginner or looking to refine your skills, our driving instructors are here to help.

    With Brisbane’s changing traffic conditions, proper training is essential for
    every new driver.

  78. Your safety is our top priority—learn from
    the best!
    We provide professional, structured lessons with a focus on road safety.
    Brisbane’s roads present unique challenges—our lessons prepare you for all of them.

  79. Every driver is different—we customise our lessons to
    match your learning style.
    Booking a lesson is easy, and we’ll pick you up from home, school, or work!
    Driving in Brisbane means handling various road conditions—our
    lessons prepare you for them all.

  80. Your safety is our top priority—learn from the best!

    Reverse parking doesn’t have to be a nightmare! Our structured lessons make it
    simple. Every driver is different—we customise our lessons to match your learning style.

  81. Reverse parking doesn’t have to be a nightmare! Our structured lessons make it
    simple.
    Our goal is to help you pass your test AND become a safe, confident driver for life.
    With structured lessons, expert guidance, and plenty of practice, success is guaranteed.

  82. Booking a lesson is easy, and we’ll pick you
    up from home, school, or work!
    The right training builds safe, confident drivers—join our Brisbane driving school today!
    With structured lessons, expert guidance, and plenty of practice, success is guaranteed.

  83. Your confidence will grow with every lesson—our structured approach ensures it.

    Learners often worry about stalling in traffic—we’ll
    teach you how to avoid it. Whether you’re a nervous beginner or looking to refine your skills,
    our driving instructors are here to help.

  84. Brisbane’s roads can be busy, but we’ll help you drive them
    with confidence.
    Unsure about which driving school to choose? Our excellent reviews speak for themselves!
    Our driving lessons are tailored to help you navigate Brisbane’s roads with
    confidence.

  85. Need a refresher course? We help experienced drivers polish their skills,
    too!
    We provide professional, structured lessons with a focus on road safety.
    Safe driving habits start from day one—book your first lesson with us
    today!

  86. Transaction exposure can be reduced either with the use of money markets, foreign exchange derivatives-such as forward contracts, options, futures contracts, and swaps-or with operational techniques such as currency invoicing, leading and lagging of receipts and payments, and exposure netting.

  87. Silk, satin, and chiffon are in style choices, recognized for his or her luxurious texture and draping qualities.

  88. With trucks making up 18 of the new autos bought in 2016, it’s not difficult to see why overall truck sales have been up 9 and the gross sales figures of other autos dropped by 6.

  89. As soon as your new accountant has your figures and monetary statements, make an appointment for the both of you to assessment your corporation.

  90. The on-road license test is not going to cover the wide range of environments and challenges a teen will
    face during the intermediate period of licensure.

  91. By understanding the importance of every card and its position in the unfold, you possibly can gain invaluable insights into the stability and harmony within your relationship and make informed selections about how to restore equilibrium.

  92. If you live within the Los Angeles area, then you will wish to test both site for updates (I promise to be a lot, much better about posting them in time, too).

  93. Practice self-care: Taking care of your mental and physical health can help prevent the development of health problems.

  94. For a number of hundred years, residents of the West Indies often named hurricanes after the Catholic saint’s day on which the storm made landfall.

  95. Colonel Sydney Green, TD, Senior Civil Engineer, Metropolitan Division, Ministry of Transport & Civil Aviation.

  96. Do you select to be the particular person enabling the drug addicts and condemning them to a hopeless life of hell and have medicine readily out there to anyone who asks for it?

  97. A carrot-waggling trickster who occasionally parrots Shakespeare, Bugs Bunny is – as perpetually vexed huntsman Elmer Fudd says – a “wascally wabbit,” right?

  98. A theme wedding revolves around a particular idea, idea, or period, and all features of the wedding, together with the decor, attire, invitations, and even the food, are tailor-made to replicate that theme.

  99. Overall, the Intel ARC GPU’s high performance and specialized hardware units make it an ideal solution for a wide range of everyday applications, from gaming and video editing to scientific research and machine learning.

  100. Good day! I could have sworn I’ve visited this website before but after browsing through some of the articles I realized it’s new to me. Anyhow, I’m certainly happy I discovered it and I’ll be book-marking it and checking back frequently!

  101. These groups offer a safe and understanding environment where individuals can share their challenges, receive support, and learn from one another.