Skip to content

Commit

Permalink
fix: Virtual network migration from v2 (#20)
Browse files Browse the repository at this point in the history
* minor fix

* updated docs

* minor fix
  • Loading branch information
diegolagospagopa authored Jan 9, 2023
1 parent 0ae8676 commit 02fcbfa
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/MIGRATION_FROM_V2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
|--------|--------|-------|
| storage| ok | read migration guide |
| subnet | ok | read migration guide |
| vnet | ok | read migration guide |
| vpn | ok | read migration guide |
| kubernetes_cluster | ok | state import mandatory + read migration guide |
27 changes: 27 additions & 0 deletions virtual_network/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# Virtual Network

This module create a virtual network

## How to use

```ts
# vnet
module "vnet" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//virtual_network?ref=virtual-network-migration-v2"
name = local.vnet_name
location = azurerm_resource_group.rg_vnet.location
resource_group_name = azurerm_resource_group.rg_vnet.name
address_space = var.cidr_vnet

tags = var.tags
}
```

## How to migrate from v2

Due to possible drift in state is possible that you need to delete the state for this resource and re-import

```sh
terraform state rm module.vnet.azurerm_virtual_network.this
```

<!-- markdownlint-disable -->
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements
Expand Down
1 change: 0 additions & 1 deletion virtual_network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ resource "azurerm_virtual_network" "this" {

tags = var.tags
}

2 changes: 1 addition & 1 deletion virtual_network/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ output "resource_group_name" {

output "address_space" {
value = azurerm_virtual_network.this.address_space
}
}

0 comments on commit 02fcbfa

Please sign in to comment.