File tree Expand file tree Collapse file tree 6 files changed +132
-0
lines changed Expand file tree Collapse file tree 6 files changed +132
-0
lines changed Original file line number Diff line number Diff line change 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 -->
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ output "id" {
2+ value = ovh_cloud_project_gateway. gateway . id
3+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments