Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions ovh/gateway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# OVH gateway

Create an OVH gateway

<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.3 |
| <a name="requirement_ovh"></a> [ovh](#requirement\_ovh) | ~> 2.1 |
| <a name="requirement_time"></a> [time](#requirement\_time) | ~> 0.9.1 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_ovh"></a> [ovh](#provider\_ovh) | ~> 2.1 |
| <a name="provider_time"></a> [time](#provider\_time) | ~> 0.9.1 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [ovh_cloud_project_gateway.gateway](https://registry.terraform.io/providers/ovh/ovh/latest/docs/resources/cloud_project_gateway) | resource |
| [time_static.last_update](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/static) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cloud_project_id"></a> [cloud\_project\_id](#input\_cloud\_project\_id) | The OVH public cloud project id | `string` | n/a | yes |
| <a name="input_customer"></a> [customer](#input\_customer) | Customer for the current deployment | `string` | `""` | no |
| <a name="input_model"></a> [model](#input\_model) | Model of the gateway | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | Name applied to this instance | `string` | `""` | no |
| <a name="input_network_id"></a> [network\_id](#input\_network\_id) | ID of the private network | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | Region of the gateway | `string` | n/a | yes |
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | ID of the subnet | `string` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Default tags to add to resources | `map(any)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_id"></a> [id](#output\_id) | n/a |
<!-- END_TF_DOCS -->
8 changes: 8 additions & 0 deletions ovh/gateway/gateway.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "ovh_cloud_project_gateway" "gateway" {
service_name = var.cloud_project_id
name = var.name
model = var.model
region = var.region
network_id = var.network_id
subnet_id = var.subnet_id
}
14 changes: 14 additions & 0 deletions ovh/gateway/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
locals {
# tflint-ignore: terraform_unused_declarations
interpolated_tags = merge({
"Name" = var.name,
"Customer" = var.customer,
"ManagedBy" = "Terraform",
"LastModifiedAt" = time_static.last_update.rfc3339,
},
var.tags
)
}

resource "time_static" "last_update" {
}
3 changes: 3 additions & 0 deletions ovh/gateway/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "id" {
value = ovh_cloud_project_gateway.gateway.id
}
13 changes: 13 additions & 0 deletions ovh/gateway/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
terraform {
required_version = "~> 1.3"
required_providers {
ovh = {
source = "ovh/ovh"
version = "~> 2.1"
}
time = {
source = "hashicorp/time",
version = "~> 0.9.1"
}
}
}
44 changes: 44 additions & 0 deletions ovh/gateway/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
variable "name" {
description = "Name applied to this instance"
type = string
default = ""
}

variable "customer" {
description = "Customer for the current deployment"
type = string
default = ""
}

variable "tags" {
description = "Default tags to add to resources"
type = map(any)
default = {}
}

# bellow are specific modules variables
variable "cloud_project_id" {
description = "The OVH public cloud project id"
type = string
}

variable "model" {
type = string
description = "Model of the gateway"
}

variable "region" {
type = string
description = "Region of the gateway"
}

variable "network_id" {
type = string
description = "ID of the private network"
}

variable "subnet_id" {
type = string
description = "ID of the subnet"
}

Loading