Examples

Basic Object Storage Bucket Examples

Info:

— The access_key and secret_key can be retrieved in the DCD, go to Menu > Storage > IONOS Object Storage > Key management.

— For the list of IONOS Object Storage Service endpoints, see Endpoints.

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.50.0"
    }
  }
}

provider "aws" {
  region                      = "de"
  access_key                  = "access_key_here"
  secret_key                  = "secret_key_here"
  # all these checks need to be skipped for an s3 external provider
  skip_credentials_validation = true
  skip_requesting_account_id  = true
  skip_region_validation      = true
  endpoints {
     s3 = "https://s3-eu-central-1.ionoscloud.com"
  }
}

resource "aws_s3_bucket" "tf_bucket_name_here" {
  bucket = "unique_name_here"
  tags = {
    Name        = "my bucket name tag"
    Environment = "dev"
  }
}

Object Storage bucket with Object Lock enabled

Object Storage bucket with Versioning enabled

Last updated

Was this helpful?