Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungI upgraded three Flutter apps to API 36. Here is what actually broke(20.09.2026 um 17:37 Uhr)
Sichere ProgrammierungSite-Wide Structured Data and Social Graph Integration(20.09.2026 um 17:44 Uhr)
Sichere ProgrammierungExact Match Or Fuzzy Logic For OFAC? 1,400 Tests Changed My Mind.(20.09.2026 um 17:45 Uhr)
Sichere ProgrammierungWhat Makes You Trust an APK Download?(20.09.2026 um 17:47 Uhr)
Sichere ProgrammierungGood News For Backend And Devops Buddy(20.09.2026 um 17:50 Uhr)
Linux Tipps & HardeningBeginner Guide: What Is Linux Mint and Why It Is So Popular(20.09.2026 um 17:54 Uhr)
Sichere ProgrammierungI upgraded three Flutter apps to API 36. Here is what actually broke(20.09.2026 um 17:37 Uhr)
Sichere ProgrammierungSite-Wide Structured Data and Social Graph Integration(20.09.2026 um 17:44 Uhr)
Sichere ProgrammierungExact Match Or Fuzzy Logic For OFAC? 1,400 Tests Changed My Mind.(20.09.2026 um 17:45 Uhr)
Sichere ProgrammierungWhat Makes You Trust an APK Download?(20.09.2026 um 17:47 Uhr)
Sichere ProgrammierungGood News For Backend And Devops Buddy(20.09.2026 um 17:50 Uhr)
Linux Tipps & HardeningBeginner Guide: What Is Linux Mint and Why It Is So Popular(20.09.2026 um 17:54 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Using OCI Bucket for Terraform/OpenTofu remote state backend

Reagiere als Erste:r — dein Feedback zählt!

Store Terraform state files in Oracle Cloud Infrastructure (OCI) Object Storage by configuring an S3-compatible backend.

A Terraform backend defines where Terraform stores its state data files. Without a backend, the state file lives locally on a single machine, making it hard for others to work based on the same cloud state, as well as having to store sensitive information locally.

This page describes how to configure an S3-compatible backend on OCI Object Storage Bucket by adding the backend block to your configuration.

A simple example

Assumptions

  • A Terraform/OpenTofu version >= 1.7

1. Install Terraform/OpenTofu

Follow the official installation page to install the Terraform or OpenTofu CLI on your machine:

All instructions in this doc will use the terraform CLI and otherwise refer to Terraform. Simply swap terraform with tofu if you prefer to use OpenTofu as all instructions and file contents are otherwise similar.

2. Configure the OCI Provider profile

To deploy OCI resources, you need access to manage the resources from your machine. This can be achieved using an API Key. To complete this step, see Setting up the OCI Configuration File using API Keys.

3. Create your AWS Customer Secret Key

Create a Customer Secret Key on your OCI console. This key enables Terraform to write to the bucket.

Head to Profile picture > My profile > Customer secret keys > Generate secret key

Give any display name you desire.

Screenshot: Getting customer secret key from OCI

4. Add your AWS Customer Secret Key

i) Create or go to the file ~/.aws/credentials
ii) Add the secret Generated key and Access key in the file under a profile name.

In this example, we use default as the profile name.

[default]
aws_access_key_id=68ce92f58a480b5cc17205467816a53b662f167a
aws_secret_access_key=1swn+e6GIyRz4tcEO42b95im7EBVO8rM5WM9apTs+fQ=

Screenshot: aws credentials file

5. Create your Terraform files

We'll create a folder with these files to create one VCN in a specified compartment:

📦terraform-test
 ┣ 📜main.tf
 ┣ 📜provider.tf
 ┗ 📜terraform.tf

The terraform.tf file will:

  • tell Terraform to use the oci provider
  • ensure the Terraform version is >= 1.7
  • use the S3-compatible OCI bucket backend to store the state

Important
Make sure to update:

  • the bucket attribute to reflect the name of your bucket
  • the endpoints attribute to use your region and object storage namespace (found in Profile > Tenancy Details)
  • the profile attribute. We use "default" as set in the previous step. Optionally for better configuration, use Partial Configuration
# terraform.tf
terraform {
  required_providers {
    oci = {
      source  = "oracle/oci"
      version = ">= 6.0.0"
    }
  }
  required_version = ">=1.7"

  backend "s3" {
    bucket    = "bucket01"
    key       = "terraform.tfstate"
    region    = "us-ashburn-1"
    endpoints = { s3 = "https://idjqfqrpn5uq.compat.objectstorage.us-ashburn-1.oci.customer-oci.com" }

    profile                     = "default"
    skip_region_validation      = true
    skip_credentials_validation = true
    skip_requesting_account_id  = true
    skip_metadata_api_check     = true
    skip_s3_checksum            = true
    use_path_style              = true
  }
}

The provider.tf file sets the OCI profile you are using. DEFAULT is the default profile

# provider.tf
provider "oci" {
  config_file_profile = "DEFAULT"
}

The main.tf file creates one simple VCN in the compartment you specify. Make sure to edit the compartment_id.

# main.tf
resource "oci_core_vcn" "test_vcn" {
  #Required
  compartment_id = "ocid1.compartment.oc1..aaaaaaaaivk7ay7yourcompartmentocidpdx3rb37g55uguzga"

  #Optional
  cidr_blocks  = ["10.5.0.0/16"]
  display_name = "vcn-test-01"
}

6. Deploy

Let us initialize and apply the plan:

terraform init
terraform apply

If all goes well, we see a success message:

Terraform successful application

And of course, the created VCN:

Deployed VCN

The Terraform tfstate file in the bucket:

tfstate file in bucket

References

Safe harbor statement

The information provided on this channel/article/story is solely intended for informational purposes and cannot be used as a part of any contractual agreement. The content does not guarantee the delivery of any material, code, or functionality, and should not be the sole basis for making purchasing decisions. The postings on this site are my own and do not necessarily reflect the views or work of Oracle or Mythics, LLC.

This work is licensed under a Creative Commons Attribution 4.0 International License.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Using OCI Bucket for Terraform/OpenTofu remote state backend

Thematisch verwandte Begriffe: Using, Bucket, TerraformOpenTofu, remote · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-93956 | A flaw has been found in olivier-ls PHP-FTS up to 1.1.2. Affected by thi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick