Terraform OVH Project

This Terraform project sets up an OVH cloud project with IAM policies for different user roles. It also configures AWS as the backend for Terraform state.

Prerequisites

  • Terraform installed on your machine.
  • AWS and OVH credentials configured.

Usage

  1. Clone the repository.
  2. Initialize Terraform:
    terraform init
    
    1
  3. Apply the Terraform configuration:
    terraform apply
    
    1

Backend Configuration

The Terraform state is stored in an S3 bucket. The backend configuration is defined in

versions.tf

terraform {
  backend "s3" {
    bucket = "yourbucket"
    key    = "terraform/ovh-project"
    region = "eu-central-1"
  }
}
1
2
3
4
5
6
7

Providers

The required providers are defined in

versions.tf

terraform {
  required_providers {
    ovh = {
      source  = "ovh/ovh"
      version = "1.5.0"
    }
    aws = {
      source  = "hashicorp/aws"
      version = "5.65.0"
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12

Requirements

NameVersion
aws5.65.0
ovh1.5.0

Modules

No modules.

Resources

NameType
ovh_cloud_project.cloud_projectopen in new windowresource
ovh_iam_policy.adminopen in new windowresource
ovh_iam_policy.editoropen in new windowresource
ovh_iam_policy.readeropen in new windowresource
ovh_me.myaccountopen in new windowdata source
ovh_me_identity_user.useropen in new windowdata source
ovh_me_identity_users.usersopen in new windowdata source
ovh_order_cart.mycartopen in new windowdata source
ovh_order_cart_product_plan.cloudopen in new windowdata source

Inputs

NameDescriptionTypeDefaultRequired
aws_account_idthis is for the tfstates Backend. in our case AWS.stringn/ayes
project_idProjects last block in namestringn/ayes
usersUsers and their roles provided by meshStack (Note that users must exist in stackit)
list(object(
{
meshIdentifier = string
username = string
firstName = string
lastName = string
email = string
euid = string
roles = list(string)
}
))
n/ayes
workspace_idProjects first block in namestringn/ayes

Outputs

NameDescription
ovh_login_linkn/a
tenant_idn/a

Source code & Installation

The source code of this kit module can be found hereopen in new window

Run the following command to install the kit module:

collie kit import ovh/buildingblocks/projects/buildingblock
1