|
| 1 | +--- |
| 2 | +subcategory: "Elastic Metal" |
| 3 | +page_title: "Scaleway: scaleway_flexible_ip_mac_address" |
| 4 | +--- |
| 5 | + |
| 6 | +# scaleway_flexible_ip_mac_address |
| 7 | + |
| 8 | +Creates and manages Scaleway Flexible IP Mac Addresses. |
| 9 | +For more information, see [the documentation](https://developers.scaleway.com/en/products/flexible-ip/api). |
| 10 | + |
| 11 | +## Examples |
| 12 | + |
| 13 | +### Basic |
| 14 | + |
| 15 | +```hcl |
| 16 | +resource "scaleway_flexible_ip" "main" {} |
| 17 | +
|
| 18 | +resource "scaleway_flexible_ip_mac_address" "main" { |
| 19 | + flexible_ip_id = scaleway_flexible_ip.main.id |
| 20 | + type = "kvm" |
| 21 | +} |
| 22 | +``` |
| 23 | + |
| 24 | +### Duplicate on many other flexible IPs |
| 25 | + |
| 26 | +```hcl |
| 27 | +data "scaleway_baremetal_offer" "my_offer" { |
| 28 | + name = "EM-B112X-SSD" |
| 29 | +} |
| 30 | +
|
| 31 | +resource "scaleway_baremetal_server" "base" { |
| 32 | + name = "TestAccScalewayBaremetalServer_WithoutInstallConfig" |
| 33 | + offer = data.scaleway_baremetal_offer.my_offer.offer_id |
| 34 | + install_config_afterward = true |
| 35 | +} |
| 36 | +
|
| 37 | +resource "scaleway_flexible_ip" "ip01" { |
| 38 | + server_id = scaleway_baremetal_server.base.id |
| 39 | +} |
| 40 | +
|
| 41 | +resource "scaleway_flexible_ip" "ip02" { |
| 42 | + server_id = scaleway_baremetal_server.base.id |
| 43 | +} |
| 44 | +
|
| 45 | +resource "scaleway_flexible_ip" "ip03" { |
| 46 | + server_id = scaleway_baremetal_server.base.id |
| 47 | +} |
| 48 | +
|
| 49 | +resource "scaleway_flexible_ip_mac_address" "main" { |
| 50 | + flexible_ip_id = scaleway_flexible_ip.ip01.id |
| 51 | + type = "kvm" |
| 52 | + flexible_ip_ids_to_duplicate = [ |
| 53 | + scaleway_flexible_ip.ip02.id, |
| 54 | + scaleway_flexible_ip.ip03.id |
| 55 | + ] |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +## Arguments Reference |
| 60 | + |
| 61 | +The following arguments are supported: |
| 62 | + |
| 63 | +- `flexible_ip_id`: (Required) The ID of the flexible IP for which to generate a virtual MAC. |
| 64 | +- `type`: (Required) The type of the virtual MAC. |
| 65 | +- `flexible_ip_ids_to_duplicate` - (Optional) The IDs of the flexible IPs on which to duplicate the virtual MAC. |
| 66 | +~> **Important:** The flexible IPs need to be attached to the same server for the operation to work. |
| 67 | + |
| 68 | +## Attributes Reference |
| 69 | + |
| 70 | +In addition to all arguments above, the following attributes are exported: |
| 71 | + |
| 72 | +- `id` - The ID of the Flexible IP Mac Address |
| 73 | + |
| 74 | +~> **Important:** Flexible IP Mac Addresses' IDs are [zoned](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{zone}/{id}`, e.g. `fr-par-1/11111111-1111-1111-1111-111111111111` |
| 75 | + |
| 76 | +- `address` - The Virtual MAC address. |
| 77 | +- `zone` - The zone of the Virtual Mac Address. |
| 78 | +- `status` - The Virtual MAC status. |
| 79 | +- `created_at` - The date at which the Virtual Mac Address was created (RFC 3339 format). |
| 80 | +- `updated_at` - The date at which the Virtual Mac Address was last updated (RFC 3339 format). |
| 81 | + |
| 82 | +## Import |
| 83 | + |
| 84 | +Flexible IP Mac Addresses can be imported using the `{zone}/{id}`, e.g. |
| 85 | + |
| 86 | +```bash |
| 87 | +$ terraform import scaleway_flexible_ip_mac_address.main fr-par-1/11111111-1111-1111-1111-111111111111 |
| 88 | +``` |
0 commit comments