Skip to content

Commit 30c390f

Browse files
committed
feat: add ovh gateway module
1 parent 16b0f12 commit 30c390f

File tree

6 files changed

+132
-0
lines changed

6 files changed

+132
-0
lines changed

ovh/gateway/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# OVH PCI private subnet
2+
3+
Create an OVH gateway
4+
5+
<!-- BEGIN_TF_DOCS -->
6+
## Requirements
7+
8+
| Name | Version |
9+
|------|---------|
10+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.3 |
11+
| <a name="requirement_ovh"></a> [ovh](#requirement\_ovh) | ~> 2.1 |
12+
| <a name="requirement_time"></a> [time](#requirement\_time) | ~> 0.9.1 |
13+
14+
## Providers
15+
16+
| Name | Version |
17+
|------|---------|
18+
| <a name="provider_ovh"></a> [ovh](#provider\_ovh) | ~> 2.1 |
19+
| <a name="provider_time"></a> [time](#provider\_time) | ~> 0.9.1 |
20+
21+
## Modules
22+
23+
No modules.
24+
25+
## Resources
26+
27+
| Name | Type |
28+
|------|------|
29+
| [ovh_cloud_project_gateway.gateway](https://registry.terraform.io/providers/ovh/ovh/latest/docs/resources/cloud_project_gateway) | resource |
30+
| [time_static.last_update](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/static) | resource |
31+
32+
## Inputs
33+
34+
| Name | Description | Type | Default | Required |
35+
|------|-------------|------|---------|:--------:|
36+
| <a name="input_cloud_project_id"></a> [cloud\_project\_id](#input\_cloud\_project\_id) | The OVH public cloud project id | `string` | n/a | yes |
37+
| <a name="input_customer"></a> [customer](#input\_customer) | Customer for the current deployment | `string` | `""` | no |
38+
| <a name="input_model"></a> [model](#input\_model) | Model of the gateway | `string` | n/a | yes |
39+
| <a name="input_name"></a> [name](#input\_name) | Name applied to this instance | `string` | `""` | no |
40+
| <a name="input_network_id"></a> [network\_id](#input\_network\_id) | ID of the private network | `string` | n/a | yes |
41+
| <a name="input_region"></a> [region](#input\_region) | Region of the gateway | `string` | n/a | yes |
42+
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | ID of the subnet | `string` | n/a | yes |
43+
| <a name="input_tags"></a> [tags](#input\_tags) | Default tags to add to resources | `map(any)` | `{}` | no |
44+
45+
## Outputs
46+
47+
| Name | Description |
48+
|------|-------------|
49+
| <a name="output_id"></a> [id](#output\_id) | n/a |
50+
<!-- END_TF_DOCS -->

ovh/gateway/gateway.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "ovh_cloud_project_gateway" "gateway" {
2+
service_name = var.cloud_project_id
3+
name = var.name
4+
model = var.model
5+
region = var.region
6+
network_id = var.network_id
7+
subnet_id = var.subnet_id
8+
}

ovh/gateway/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
locals {
2+
# tflint-ignore: terraform_unused_declarations
3+
interpolated_tags = merge({
4+
"Name" = var.name,
5+
"Customer" = var.customer,
6+
"ManagedBy" = "Terraform",
7+
"LastModifiedAt" = time_static.last_update.rfc3339,
8+
},
9+
var.tags
10+
)
11+
}
12+
13+
resource "time_static" "last_update" {
14+
}

ovh/gateway/outputs.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "id" {
2+
value = ovh_cloud_project_gateway.gateway.id
3+
}

ovh/gateway/providers.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
terraform {
2+
required_version = "~> 1.3"
3+
required_providers {
4+
ovh = {
5+
source = "ovh/ovh"
6+
version = "~> 2.1"
7+
}
8+
time = {
9+
source = "hashicorp/time",
10+
version = "~> 0.9.1"
11+
}
12+
}
13+
}

ovh/gateway/variables.tf

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
variable "name" {
2+
description = "Name applied to this instance"
3+
type = string
4+
default = ""
5+
}
6+
7+
variable "customer" {
8+
description = "Customer for the current deployment"
9+
type = string
10+
default = ""
11+
}
12+
13+
variable "tags" {
14+
description = "Default tags to add to resources"
15+
type = map(any)
16+
default = {}
17+
}
18+
19+
# bellow are specific modules variables
20+
variable "cloud_project_id" {
21+
description = "The OVH public cloud project id"
22+
type = string
23+
}
24+
25+
variable "model" {
26+
type = string
27+
description = "Model of the gateway"
28+
}
29+
30+
variable "region" {
31+
type = string
32+
description = "Region of the gateway"
33+
}
34+
35+
variable "network_id" {
36+
type = string
37+
description = "ID of the private network"
38+
}
39+
40+
variable "subnet_id" {
41+
type = string
42+
description = "ID of the subnet"
43+
}
44+

0 commit comments

Comments
 (0)