Giter Site home page Giter Site logo

terraform-ovh-publiccloud-network's Introduction

OVH PublicCloud Network Terraform module

This repo contains a Terraform Module for how to deploy network resources on OVH PublicCloud.

These types of resources are supported:

Network Topology Example

Usage

module "network" {
  source = "ovh/publiccloud-network/ovh"

  project_id      = "XXX"
  vrack_id        = "YYY"

  name            = "mynetwork"
  cidr            = "10.0.0.0/16"
  region          = "GRA3"
  public_subnets  = ["10.0.0.0/24", "10.0.10.0/24"]
  private_subnets = ["10.0.1.0/24", "10.0.11.0/24"]

  enable_nat_gateway  = true
  enable_bastion_host = true

  ssh_public_keys = ["${openstack_compute_keypair_v2.keypair.public_key}"]

  metadata = {
    Terraform   = "true"
    Environment = "dev"
  }
}

Examples

How do I contribute to this Module?

Contributions are very welcome! Check out the Contribution Guidelines for instructions.

Authors

Module managed by Yann Degat.

License

The 3-Clause BSD License. See LICENSE for full details.

terraform-ovh-publiccloud-network's People

Contributors

yanndegat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-ovh-publiccloud-network's Issues

Remove ignition ?

Following ovh/terraform-ovh-publiccloud-k8s#77, ignition could also be removed here.

Can't pass openstack provider from root

Hi. I try to use this project as terraform module. I declare a it like this:

module "network" {
  source = "ovh/publiccloud-network/ovh"

  providers = {
    ovh = "ovh.ovh"
    openstack = "openstack.ovh"
  }
...
}

And it gets downloaded with terraform init. As you can see I try to explicitly pass provider which I declared in my root module:

provider "openstack" {
  auth_url = "https://auth.cloud.ovh.net/v3" # Authentication URL
  domain_name = "default" # Domain Name - Always "default" for OVH
  alias = "ovh"
  region = "${var.region}"
  user_name   = "${var.user_name}"
  password    = "${var.password}"
}

The problem is that terraform plan gives me:

Error: Error running plan: 1 error(s) occurred:

  • module.network.provider.openstack: One of 'auth_url' or 'cloud' must be specified

I think it happens because of provider "openstack" is already defined here in main.tf.
If I comment it, the provider from my root is successfully used.

I also noticed that terraform tries to apply everything from examples directory of this module which is not my goal.

So, what is the correct use of this module? I would like to pass my own provider and do not get examples applied from here.

Looks like the most suitable options to use this module is to copy main.tf from here to my repo. But Terraform registry and documentation tells me that I just should declare it with source = "ovh/publiccloud-network/ovh"

Thanks

Error when updating network state

Hello,

just removed bastion and nat gateway from the state. An apply action give me this :

module.network.openstack_networking_subnet_v2.no_nat_private_subnets[1]: Creation complete after 6s (ID: 83c5cd7f-db2e-4a5f-b188-d2969e6fcd1d)
module.network.openstack_networking_subnet_v2.nat_private_subnets: Still destroying... (ID: f8d44558-47ff-4008-a8aa-192ec82214c0, 10s elapsed)
module.network.openstack_networking_subnet_v2.nat_private_subnets: Still destroying... (ID: f8d44558-47ff-4008-a8aa-192ec82214c0, 20s elapsed)
module.network.openstack_networking_subnet_v2.nat_private_subnets: Still destroying... (ID: f8d44558-47ff-4008-a8aa-192ec82214c0, 30s elapsed)
module.network.openstack_networking_subnet_v2.nat_private_subnets: Still destroying... (ID: f8d44558-47ff-4008-a8aa-192ec82214c0, 40s elapsed)
module.network.openstack_networking_subnet_v2.nat_private_subnets: Still destroying... (ID: f8d44558-47ff-4008-a8aa-192ec82214c0, 50s elapsed)
module.network.openstack_networking_subnet_v2.nat_private_subnets: Still destroying... (ID: f8d44558-47ff-4008-a8aa-192ec82214c0, 1m0s elapsed)

unterminable destroying action... I must destroy the whole project and restart from the begining to apply again....

any hints?

I used the bastion example.
Then switched off bastion host and nat gateway

simple example does not work

$ cd examples/simple/
$ terraform init
$ terraform apply -auto-approve

Results:

Error: Error applying plan:

1 error(s) occurred:

* module.network.openstack_networking_network_v2.net: 1 error(s) occurred:

* openstack_networking_network_v2.net: Error creating OpenStack Neutron network: Invalid request due to incorrect syntax or missing required parameters.

Maybe it requires a vrack even in the same region ?

$ openstack network create net
Error while executing command: BadRequestException: Unknown error, {"NeutronError": {"message": "Invalid input for operation: Can not get vrack_id and segmentation_id value from DB!.", "type": "InvalidInput", "detail": ""}}

Create simple private network with NAT or bastion

module "network" {
[...]
  enable_nat_gateway = false
  single_nat_gateway = false
  nat_as_bastion     = false
[...]
}

does not work:

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.ignition_networkd_unit.bastion_eth0: Refreshing state...
data.ignition_networkd_unit.bastion_eth1: Refreshing state...
data.ignition_user.nat_core: Refreshing state...
data.ignition_user.bastion_core: Refreshing state...
data.ignition_config.bastion: Refreshing state...
data.openstack_networking_network_v2.ext_net: Refreshing state...

Error: Error refreshing state: 1 error(s) occurred:

* module.network.data.template_file.private_subnets_ids: 1 error(s) occurred:

* module.network.data.template_file.private_subnets_ids: element: element() may not be used with an empty list in:

${element(openstack_compute_instance_v2.nats.*.id, count.index)}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.