-
Notifications
You must be signed in to change notification settings - Fork 132
feat(ipam): add ipam ip resource #2188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
485e443
feat(ipam): add ipam ip resource
yfodil b5c94f5
lint & update cassettes
yfodil d81ed93
Merge branch 'master' into feat/add_ipam_ip_resource
yfodil a861141
update cassette
yfodil 0bdde1c
Merge branch 'feat/add_ipam_ip_resource' of github.com:yfodil/terrafo…
yfodil d2be030
Merge branch 'master' into feat/add_ipam_ip_resource
yfodil 1a37165
remove vpc v1
yfodil 4529e1c
fix documentation link
yfodil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ jobs: | |
- Iam | ||
- Instance | ||
- Iot | ||
- IPAM | ||
- K8S | ||
- Lb | ||
- Marketplace | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
--- | ||
subcategory: "IPAM" | ||
page_title: "Scaleway: scaleway_ipam_ip" | ||
--- | ||
|
||
# scaleway_ipam_ip | ||
|
||
Books and manages Scaleway IPAM IPs. | ||
|
||
## Example | ||
|
||
### Basic | ||
|
||
```hcl | ||
resource "scaleway_vpc" "vpc01" { | ||
name = "my vpc" | ||
} | ||
|
||
resource "scaleway_vpc_private_network" "pn01" { | ||
vpc_id = scaleway_vpc.vpc01.id | ||
ipv4_subnet { | ||
subnet = "172.16.32.0/22" | ||
} | ||
} | ||
|
||
resource "scaleway_ipam_ip" "ip01" { | ||
source { | ||
private_network_id = scaleway_vpc_private_network.pn01.id | ||
} | ||
} | ||
``` | ||
|
||
### Request a specific IPv4 | ||
|
||
```hcl | ||
resource "scaleway_vpc" "vpc01" { | ||
name = "my vpc" | ||
} | ||
|
||
resource "scaleway_vpc_private_network" "pn01" { | ||
vpc_id = scaleway_vpc.vpc01.id | ||
ipv4_subnet { | ||
subnet = "172.16.32.0/22" | ||
} | ||
} | ||
|
||
resource "scaleway_ipam_ip" "ip01" { | ||
address = "172.16.32.7/22" | ||
source { | ||
private_network_id = scaleway_vpc_private_network.pn01.id | ||
} | ||
} | ||
``` | ||
|
||
### Request an IPv6 | ||
|
||
```hcl | ||
resource "scaleway_vpc" "vpc01" { | ||
name = "my vpc" | ||
} | ||
|
||
resource "scaleway_vpc_private_network" "pn01" { | ||
vpc_id = scaleway_vpc.vpc01.id | ||
ipv6_subnets { | ||
subnet = "fd46:78ab:30b8:177c::/64" | ||
} | ||
} | ||
|
||
resource "scaleway_ipam_ip" "ip01" { | ||
is_ipv6 = true | ||
source { | ||
private_network_id = scaleway_vpc_private_network.pn01.id | ||
} | ||
} | ||
``` | ||
|
||
## Arguments Reference | ||
|
||
The following arguments are supported: | ||
|
||
- `address` - (Optional) Request a specific IP in the requested source pool. | ||
- `tags` - (Optional) The tags associated with the IP. | ||
- `source` - (Required) The source in which to book the IP. | ||
- `zonal` - The zone the IP lives in if the IP is a public zoned one | ||
- `private_network_id` - The private network the IP lives in if the IP is a private IP. | ||
- `subnet_id` - The private network subnet the IP lives in if the IP is a private IP in a private network. | ||
- `is_ipv6` - (Optional) Defines whether to request an IPv6 instead of an IPv4. | ||
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) of the IP. | ||
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the IP is associated with. | ||
|
||
## Attributes Reference | ||
|
||
In addition to all above arguments, the following attributes are exported: | ||
|
||
- `id` - The ID of the IP in IPAM. | ||
- `resource` - The IP resource. | ||
- `id` - The ID of the resource that the IP is bound to. | ||
- `type` - The type of resource the IP is attached to. | ||
- `name` - The name of the resource the IP is attached to. | ||
- `mac_address` - The MAC Address of the resource the IP is attached to. | ||
- `created_at` - Date and time of IP's creation (RFC 3339 format). | ||
- `updated_at` - Date and time of IP's last update (RFC 3339 format). | ||
- `zone` - The zone of the IP. | ||
|
||
~> **Important:** IPAM IPs' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111 | ||
|
||
## Import | ||
|
||
IPAM IPs can be imported using the `{region}/{id}`, e.g. | ||
|
||
```bash | ||
$ terraform import scaleway_ipam_ip.ip_demo fr-par/11111111-1111-1111-1111-111111111111 | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.