{"id":36846379,"url":"https://github.com/paybyphone/terraform-provider-phpipam","last_synced_at":"2026-01-12T14:33:08.634Z","repository":{"id":54200628,"uuid":"85362727","full_name":"paybyphone/terraform-provider-phpipam","owner":"paybyphone","description":"Terraform provider plugin for PHPIPAM (https://phpipam.net/)","archived":false,"fork":false,"pushed_at":"2021-08-27T15:44:30.000Z","size":5467,"stargazers_count":14,"open_issues_count":13,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T14:32:03.191Z","etag":null,"topics":["phpipam","phpipam-api","terraform"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paybyphone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-17T23:25:25.000Z","updated_at":"2025-07-21T01:05:00.000Z","dependencies_parsed_at":"2022-08-13T09:01:05.219Z","dependency_job_id":null,"html_url":"https://github.com/paybyphone/terraform-provider-phpipam","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/paybyphone/terraform-provider-phpipam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybyphone%2Fterraform-provider-phpipam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybyphone%2Fterraform-provider-phpipam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybyphone%2Fterraform-provider-phpipam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybyphone%2Fterraform-provider-phpipam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paybyphone","download_url":"https://codeload.github.com/paybyphone/terraform-provider-phpipam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paybyphone%2Fterraform-provider-phpipam/sbom","scorecard":{"id":724391,"data":{"date":"2025-08-11","repo":{"name":"github.com/paybyphone/terraform-provider-phpipam","commit":"732e7409b2b3dbe5b95bd05a28b17735da74cd60"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":8,"reason":"5 out of the last 5 releases have a total of 5 signed artifacts.","details":["Info: signed release artifact: terraform-provider-phpipam_v0.2.0-compat-v0.8.8_SHA256SUMS.sig: https://github.com/paybyphone/terraform-provider-phpipam/releases/tag/v0.2.0-compat-v0.8.8","Info: signed release artifact: terraform-provider-phpipam_v0.2.0_SHA256SUMS.sig: https://github.com/paybyphone/terraform-provider-phpipam/releases/tag/v0.2.0","Info: signed release artifact: terraform-provider-phpipam_v0.1.2-compat-v0.8.8_SHA256SUMS.sig: https://github.com/paybyphone/terraform-provider-phpipam/releases/tag/v0.1.2-compat-v0.8.8","Info: signed release artifact: terraform-provider-phpipam_v0.1.2_SHA256SUMS.sig: https://github.com/paybyphone/terraform-provider-phpipam/releases/tag/v0.1.2","Info: signed release artifact: terraform-provider-phpipam_v0.1.1-compat-v0.8.8_SHA256SUMS.sig: https://github.com/paybyphone/terraform-provider-phpipam/releases/tag/v0.1.1-compat-v0.8.8","Warn: release artifact v0.2.0-compat-v0.8.8 does not have provenance: https://api.github.com/repos/paybyphone/terraform-provider-phpipam/releases/6019206","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/paybyphone/terraform-provider-phpipam/releases/6019195","Warn: release artifact v0.1.2-compat-v0.8.8 does not have provenance: https://api.github.com/repos/paybyphone/terraform-provider-phpipam/releases/5974232","Warn: release artifact v0.1.2 does not have provenance: https://api.github.com/repos/paybyphone/terraform-provider-phpipam/releases/5974204","Warn: release artifact v0.1.1-compat-v0.8.8 does not have provenance: https://api.github.com/repos/paybyphone/terraform-provider-phpipam/releases/5864831"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T12:20:17.331Z","repository_id":54200628,"created_at":"2025-08-22T12:20:17.331Z","updated_at":"2025-08-22T12:20:17.331Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["phpipam","phpipam-api","terraform"],"created_at":"2026-01-12T14:33:08.511Z","updated_at":"2026-01-12T14:33:08.587Z","avatar_url":"https://github.com/paybyphone.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Provider Plugin for PHPIPAM\n\nThis repository holds a external plugin for a [Terraform][1] provider to manage\nresources within [PHPIPAM][2], an open source IP address management system.\n\n[1]: https://www.terraform.io/\n[2]: https://phpipam.net/\n\n## About PHPIPAM\n\n[PHPIPAM][2] is an open source IP address management system written in PHP. It\nhas an evolving [API][3] that allows for the management and lookup of data that\nhas been entered into the system. Through our Go integration\n[phpipam-sdk-go][4], we have been able to take this API and integrate it into\nTerraform, allowing for the management and lookup of sections, VLANs, subnets,\nand IP addresses, entirely within Terraform.\n\n[3]: https://phpipam.net/api/api_documentation/\n[4]: https://github.com/paybyphone/phpipam-sdk-go\n\n## Installing\n\nSee the [Plugin Basics][5] page of the Terraform docs to see how to plunk this\ninto your config. Check the [releases page][6] of this repo to get releases for\nLinux, OS X, and Windows.\n\n[5]: https://www.terraform.io/docs/plugins/basics.html\n[6]: https://github.com/paybyphone/terraform-provider-phpipam/releases\n\n## Usage\n\nAfter installation, to use the plugin, simply use any of its resources or data\nsources (such as `phpipam_subnet` or `phpipam_address` in a Terraform\nconfiguration.\n\nCredentials can be supplied via configuration variables to the `phpipam`\nprovider instance, or via environment variables. These are documented in the\nnext section.\n\nYou can see the following example below for a simple usage example that reserves\nthe first available IP address in a subnet. This address could then be passed\nalong to the configuration for a VM, say, for example, a\n[`vsphere_virtual_machine`][7] resource.\n\n[7]: https://www.terraform.io/docs/providers/vsphere/r/virtual_machine.html\n\n```\nprovider \"phpipam\" {\n  app_id   = \"test\"\n  endpoint = \"https://phpipam.example.com/api\"\n  password = \"PHPIPAM_PASSWORD\"\n  username = \"Admin\"\n}\n\ndata \"phpipam_subnet\" \"subnet\" {\n  subnet_address = \"10.10.2.0\"\n  subnet_mask    = 24\n}\n\ndata \"phpipam_first_free_address\" \"next_address\" {\n  subnet_id = \"${data.phpipam_subnet.subnet.subnet_id}\"\n}\n\nresource \"phpipam_address\" {\n  subnet_id   = \"${data.phpipam_subnet.subnet.subnet_id}\"\n  ip_address  = \"${data.phpipam_first_free_address.next_address.ip_address}\"\n  hostname    = \"tf-test-host.example.internal\"\n  description = \"Managed by Terraform\"\n\n  lifecycle {\n    ignore_changes = [\n      \"subnet_id\",\n      \"ip_address\",\n    ]\n  }\n}\n```\n\n### Plugin Options\n\nThe options for the plugin are as follows: \n\n * `app_id` - The API application ID, configured in the PHPIPAM API panel. This\n   application ID should have read/write access if you are planning to use the\n   resources, but read-only access should be sufficient if you are only using\n   the data sources. Can also be supplied by the `PHPIPAM_APP_ID` environment\n   variable.\n * `endpoint` - The full URL to the PHPIPAM API endpoint, such as\n   `https://phpipam.example.com/api`. Can also be supplied by the\n   `PHPIPAM_ENDPOINT_ADDR` environment variable.\n * `password` - The password to access the PHPIPAM API with. Can also be\n   supplied via `PHPIPAM_PASSWORD` to prevent plain text password storage in\n   config.\n * `username` - The user name to access the PHPIPAM API with. Can also be\n   supplied via the `PHPIPAM_USER_NAME` variable.\n\n### Data Sources\n\nThe following data sources are supplied by this plugin:\n\n#### The `phpipam_address` Data Source\n\nThe `phpipam_address` data source allows one to get information about a specific\nIP address within PHPIPAM. Use this address to get general information about a\nspecific IP address such as its host name, description and more.\n\nLookups for IP addresses can only happen at this time via its entry in the\ndatabase, or the IP address itself. Future versions of this resource, when such\nfeatures become generally available in the PHPIPAM API, will allow lookup based\non host name, allowing for better ability for this resource to discover IP\naddresses that have been pre-assigned for a specific resource.\n\n**Example:**\n\n```\ndata \"phpipam_address\" \"address\" {\n  ip_address = \"10.10.1.1\"\n}\n\noutput \"address_description\" {\n  value = \"${data.phpipam_address.address.description}\"\n}\n```\n\n**Example With `description`:**\n\n```\ndata \"phpipam_address\" \"address\" {\n  subnet_id         = 3\n  description_match = \"Customer 1\"\n}\n\noutput \"address_description\" {\n  value = \"${data.phpipam_address.address.description}\"\n}\n```\n\n**Example With `custom_field_filter`:**\n\n```\ndata \"phpipam_address\" \"address\" {\n  subnet_id = 3\n\n  custom_field_filter {\n    CustomTestAddresses = \".*terraform.*\"\n  }\n}\n\noutput \"address_description\" {\n  value = \"${data.phpipam_address.address.description}\"\n}\n```\n\n##### Argument Reference\n\nThe data source takes the following parameters:\n\n * `address_id` - The ID of the IP address in the PHPIPAM database.\n * `ip_address` - The actual IP address in PHPIPAM.\n * `subnet_id` - The ID of the subnet that the address resides in. This is\n   required to search on the `description` or `hostname` fields.\n * `description` - The description of the IP address. `subnet_id` is required\n   when using this field.\n * `hostname` - The host name of the IP address. `subnet_id` is required when\n   using this field.\n * `custom_field_filter` - A map of custom fields to search for. The filter\n   values are regular expressions that follow the RE2 syntax for which you can\n   find documentation [here](https://github.com/google/re2/wiki/Syntax). All\n   fields need to match for the match to succeed. \n\n⚠️  **NOTE:** `description`, `hostname`, and `custom_field_filter` fields return\nthe first match found without any warnings. If you are looking to return\nmultiple addresses, combine this data source with the `phpipam_addresses` data\nsource.\n\n⚠️  **NOTE:** An empty or unspecified `custom_field_filter` value is the\nequivalent to a regular expression that matches everything, and hence will\nreturn the first address it sees in the subnet.\n\nArguments are processed in the following order of precedence:\n\n * `address_id`\n * `ip_address`\n * `subnet_id`, and either one of `description`, `hostname`, or\n   `custom_field_filter`\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `address_id` - The ID of the IP address in the PHPIPAM database.\n * `ip_address` - the IP address.\n * `subnet_id` - The database ID of the subnet this IP address belongs to.\n * `is_gateway` - `true` if this IP address has been designated as a gateway.\n * `description` - The description provided to this IP address.\n * `hostname` - The hostname supplied to this IP address.\n * `owner` - The owner name provided to this IP address.\n * `mac_address` - The MAC address provided to this IP address.\n * `state_tag_id` - The tag ID in the database for the IP address' specific\n   state. **NOTE:** This is currently represented as an integer but may change\n   to the specific string representation at a later time.\n * `skip_ptr_record` - `true` if PTR records are not being created for this IP\n   address.\n * `ptr_record_id` - The ID of the associated PTR record in the PHPIPAM\n   database.\n * `device_id` - The ID of the associated device in the PHPIPAM database.\n * `switch_port_label` - A string port label that is associated with this\n   address.\n * `note` - The note supplied to this IP address.\n * `last_seen` - The last time this IP address answered ping probes.\n * `exclude_ping` - `true` if this address is excluded from ping probes.\n * `edit_date` - The last time this resource was modified.\n * `custom_fields` - A key/value map of custom fields for this address.\n\n##### The `phpipam_addresses` Data Source\n\nThe `phpipam_addresses` data source allows you to search for IP addresses, much\nin the same way as you can in the single-form `phpipam_address` data source.\nHowever, multiple addresses are returned from this data source as a single list\nof address IDs as they are found in the PHPIPAM database. You can then use the\nsingle-form `phpipam_address` data source to extract the IP data for each\nmatched address in the database.\n\n**Example:**\n\n⚠️  **NOTE:** The below example requires Terraform v0.9.0 or later!\n\n```\ndata \"phpipam_addresses\" \"address_search\" {\n  subnet_id = 3\n\n  custom_field_filter {\n    CustomTestAddresses = \".*terraform.*\"\n  }\n}\n\ndata \"phpipam_address\" \"addresses\" {\n  count      = \"${length(data.phpipam_addresses.address_search.address_ids)}\"\n  address_id = \"${element(data.phpipam_addresses.address_search.address_ids, count.index)}\"\n}\n\noutput \"ip_addresses\" {\n  value = [\"${data.phpipam_address.addresses.*.ip_address}\"]\n}\n```\n\n##### Argument Reference\n\nThe data source takes the following parameters:\n\n * `subnet_id` (Required) - The ID of the subnet that the address resides in. This is\n   required to search on the `description` or `hostname` fields.\n\nOne of the following fields is required alongside `subnet_id`:\n\n * `description` - The description of the IP address. `subnet_id` is required\n   when using this field.\n * `hostname` - The host name of the IP address. `subnet_id` is required when\n   using this field.\n * `custom_field_filter` - A map of custom fields to search for. The filter\n   values are regular expressions that follow the RE2 syntax for which you can\n   find documentation [here](https://github.com/google/re2/wiki/Syntax). All\n   fields need to match for the match to succeed. \n\n⚠️  **NOTE:** An empty or unspecified `custom_field_filter` value is the\nequivalent to a regular expression that matches everything, and hence will\nreturn **all** addresses that contain the referenced custom field key!\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `address_ids` - A list of discovered IP address IDs.\n\n##### The `phpipam_first_free_address` Data Source\n\nThe `phpipam_first_free_address` data source allows you to get the next\navailable IP address in a specific subnet in PHPIPAM. Using this resource allows\nyou to automatically allocate an IP address that can be used as an IP address in\nresources such as `vsphere_virtual_machine`, or other virtual machine-like\nresources that require static IP addresses.\n\nNote that not having any addresses available will cause the Terraform run to\nfail. Conversely, marking a subnet as unavailable or used will not prevent this\ndata source from returning an IP address, so be aware of this while using this\nresource.\n\n**Example:**\n\n```\n// Look up the subnet\ndata \"phpipam_subnet\" \"subnet\" {\n  subnet_address = \"10.10.2.0\"\n  subnet_mask    = 24\n}\n\n// Get the first available address\ndata \"phpipam_first_free_address\" \"next_address\" {\n  subnet_id = \"${data.phpipam_subnet.subnet.subnet_id}\"\n}\n\n// Reserve the address. Note that we use ignore_changes here to ensure that we\n// don't end up re-allocating this address on future Terraform runs.\nresource \"phpipam_address\" {\n  subnet_id   = \"${data.phpipam_subnet.subnet.subnet_id}\"\n  ip_address  = \"${data.phpipam_first_free_address.next_address.ip_address}\"\n  hostname    = \"tf-test-host.example.internal\"\n  description = \"Managed by Terraform\"\n\n  lifecycle {\n    ignore_changes = [\n      \"subnet_id\",\n      \"ip_address\",\n    ]\n  }\n}\n\n// Supply the IP address to an instance. Note that we are also ignoring\n// network_interface here to ensure the IP address does not get re-calculated.\nresource \"vsphere_virtual_machine\" \"web\" {\n  name   = \"terraform-web\"\n  vcpu   = 2\n  memory = 4096\n\n  network_interface {\n    label        = \"VM Network\"\n    ipv4_address = \"${data.phpipam_first_free_address.next_address.ip_address}\"\n  }\n\n  disk {\n    template = \"centos-7\"\n  }\n\n  ignore_changes = [\n    \"network_interface\",\n  ]\n}\n```\n\n##### Argument Reference\n\nThe data source takes the following parameters:\n\n * `subnet_id` - The ID of the subnet to look up the address in.\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `ip_address` - The next available IP address.\n\n#### The `phpipam_section` Data Source\n\nThe `phpipam_section` data source allows one to look up a specific section,\neither by database ID or name. This data can then be used to manage other parts\nof PHPIPAM, such as in the event that the section name is known but not its ID,\nwhich is required for managing subnets.\n\n**Example:**\n\n```\ndata \"phpipam_section\" \"section\" {\n  name = \"Customers\"\n}\n\nresource \"phpipam_subnet\" \"subnet\" {\n  section_id = \"${data.phpipam_section.section.section_id}\"\n  subnet_address = \"10.10.3.0\"\n  subnet_mask = 24\n}\n```\n\n##### Argument Reference\n\nThe data source takes the following parameters:\n\n * `section_id` - The ID of the section to look up.\n * `name` - The name of the section to look up.\n\nOne of `section_id` or `name` must be supplied. If both are supplied,\n`section_id` is used.\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `section_id` - The ID of the section in the PHPIPAM database.\n * `name` - The name of the section.\n * `description` - The section's description.\n * `master_section_id` - The ID of the parent section in the PHPIPAM database.\n * `permissions` - A JSON representation of permissions for this section.\n * `strict_mode` - `true` if this subnet is set up to check that IP addresses\n   are valid for the subnets they are in.\n * `subnet_ordering` - How subnets in this section are ordered.\n * `display_order` - The section's display order number.\n * `edit_date` - The date this resource was last edited.\n * `show_vlan_in_subnet_listing` - `true` if VLANs are being shown in the subnet\n   listing for this section.\n * `show_vrf_in_subnet_listing` - `true` if VRFs are being shown in the subnet\n   listing for this section.\n * `show_supernet_only` - `true` if supernets are only being shown in the subnet\n   listing.\n * `dns_resolver_id` - The ID of the DNS resolver to use in the section.\n\n#### The `phpipam_subnet` Data Source\n\nThe `phpipam_subnet` data source gets information on a subnet such as its ID\n(required for creating addresses), description, and more.\n\n**Example:**\n\n```\n// Look up the subnet\ndata \"phpipam_subnet\" \"subnet\" {\n  subnet_address = \"10.10.2.0\"\n  subnet_mask    = 24\n}\n\n// Reserve the address.\nresource \"phpipam_address\" {\n  subnet_id   = \"${data.phpipam_subnet.subnet.subnet_id}\"\n  ip_address  = \"10.10.2.10\"\n  hostname    = \"tf-test-host.example.internal\"\n  description = \"Managed by Terraform\"\n}\n```\n\n**Example with `description_match`:**\n\n```\n// Look up the subnet (matching on either case of \"customer\")\ndata \"phpipam_subnet\" \"subnet\" {\n  section_id        = 1\n  description_match = \"[Cc]ustomer 2\"\n}\n\n// Get the first available address\ndata \"phpipam_first_free_address\" \"next_address\" {\n  subnet_id = \"${data.phpipam_subnet.subnet.subnet_id}\"\n}\n\n// Reserve the address. Note that we use ignore_changes here to ensure that we\n// don't end up re-allocating this address on future Terraform runs.\nresource \"phpipam_address\" {\n  subnet_id   = \"${data.phpipam_subnet.subnet.subnet_id}\"\n  ip_address  = \"${data.phpipam_first_free_address.next_address.ip_address}\"\n  hostname    = \"tf-test-host.example.internal\"\n  description = \"Managed by Terraform\"\n\n  lifecycle {\n    ignore_changes = [\n      \"subnet_id\",\n      \"ip_address\",\n    ]\n  }\n}\n```\n\n**Example With `custom_field_filter`:**\n\n```\n// Look up the subnet\ndata \"phpipam_subnet\" \"subnet\" {\n  section_id = 1\n\n  custom_field_filter = {\n    CustomTestSubnets = \".*terraform.*\"\n  }\n}\n\n// Get the first available address\ndata \"phpipam_first_free_address\" \"next_address\" {\n  subnet_id = \"${data.phpipam_subnet.subnet.subnet_id}\"\n}\n\n// Reserve the address. Note that we use ignore_changes here to ensure that we\n// don't end up re-allocating this address on future Terraform runs.\nresource \"phpipam_address\" {\n  subnet_id   = \"${data.phpipam_subnet.subnet.subnet_id}\"\n  ip_address  = \"${data.phpipam_first_free_address.next_address.ip_address}\"\n  hostname    = \"tf-test-host.example.internal\"\n  description = \"Managed by Terraform\"\n\n  lifecycle {\n    ignore_changes = [\n      \"subnet_id\",\n      \"ip_address\",\n    ]\n  }\n}\n```\n\n##### Argument Reference\n\nThe data source takes the following parameters:\n\n * `section_id` - The ID of the section of the subnet. Required if you are\n   looking up a subnet using the `description` or `description_match` arguments.\n * `subnet_id` - The ID of the subnet to look up.\n * `subnet_address` - The network address of the subnet to look up.\n * `subnet_mask` - The subnet mask, in bits, of the subnet to look up.\n * `description` - The subnet's description. `section_id` is required if you\n   want to use this option.\n * `description_match` - A regular expression to match against when searching\n   for a subnet. `section_id` is required if you want to use this option.\n * `custom_field_filter` - A map of custom fields to search for. The filter\n   values are regular expressions that follow the RE2 syntax for which you can\n   find documentation [here](https://github.com/google/re2/wiki/Syntax). All\n   fields need to match for the match to succeed. \n\n⚠️  **NOTE:** Searches with the `description`, `description_match` and\n`custom_field_filter` fields return the first match found without any warnings.\nConversely, the resource fails if it somehow finds multiple results on a CIDR\n(subnet and mask) search - this is to assert that you are getting the subnet you\nrequested. If you want to return multiple results, combine this data source with\nthe `phpipam_subnets` data source.\n\n⚠️  **NOTE:** An empty or unspecified `custom_field_filter` value is the\nequivalent to a regular expression that matches everything, and hence will\nreturn the first subnetit sees in the section.\n\nArguments are processed in the following order of precedence:\n\n * `subnet_id`\n * `subnet_address` and `subnet_mask`\n * `section_id`, and either one of `description`, `description_match`, or\n   `custom_field_filter`\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `subnet_id` - The ID of the subnet in the PHPIPAM database.\n * `subnet_address` - The network address of the subnet.\n * `subnet_mask` - The subnet mask, in bits.\n * `description` - The description set for the subnet.\n * `section_id` - The ID of the section for this address in the PHPIPAM\n   database.\n * `linked_subnet_id` - The ID of the linked subnet in the PHPIPAM database.\n * `vlan_id` - The ID of the VLAN for this subnet in the PHPIPAM database.\n * `vrf_id` - The ID of the VRF for this subnet in the PHPIPAM database.\n * `master_subnet_id` - The ID of the parent subnet for this subnet in the\n   PHPIPAM database.\n * `nameserver_id` - The ID of the nameserver used to assign PTR records for\n   this subnet.\n * `show_name` - `true` if the subnet name is are shown in the section, instead\n   of the network address.\n * `permissions` - A JSON representation of the permissions associated with this\n   subnet.\n * `create_ptr_records` - `true` if PTR records are created for addresses in\n   this subnet.\n * `display_hostnames` - `true` if hostnames are displayed instead of IP\n   addresses in the address listing for this subnet.\n * `allow_ip_requests` - `true` if the subnet allows IP requests in PHPIPAM.\n * `scan_agent_id` - The ID of the ping scan agent that is used for this subnet.\n * `include_in_ping` - `true` if this subnet is included in ping probes.\n * `host_discovery_enabled` - `true` if this subnet is included in new host\n   scans.\n * `is_folder` - `true` if this subnet is a folder and not an actual subnet.\n * `is_full` - `true` if the subnet has been marked as full.\n * `state_tag_id` - The ID of the state tag for this subnet. This may become an\n   actual string representation of this at a later time (example: `Used`).\n * `utilization_threshold` - The subnet's utilization threshold.\n * `location_id` - The ID of the location for this subnet.\n * `edit_date` - The date this resource was last updated.\n * `custom_fields` - A key/value map of custom fields for this subnet.\n\n##### The `phpipam_subnets` Data Source\n\nThe `phpipam_subnets` data source allows you to search for subnets, much in the\nsame way as you can in the single-form `phpipam_subnet` data source.  However,\nmultiple subnets are returned from this data source as a single list of subnet\nIDs as they are found in the PHPIPAM database. You can then use the single-form\n`phpipam_subnet` data source to extract the subnet data for each matched network\nin the database.\n\n**Example:**\n\n⚠️  **NOTE:** The below example requires Terraform v0.9.0 or later!\n\n```\ndata \"phpipam_subnets\" \"subnet_search\" {\n  subnet_id = 3\n\n  custom_field_filter {\n    CustomTestSubnets = \".*terraform.*\"\n  }\n}\n\ndata \"phpipam_subnet\" \"subnets\" {\n  count     = \"${length(data.phpipam_subnets.subnet_search.subnet_ids)}\"\n  subnet_id = \"${element(data.phpipam_subnets.subnet_search.subnet_ids, count.index)}\"\n}\n\noutput \"subnet_addresses\" {\n  value = [\"${data.phpipam_subnet.subnets.*.ip_address}\"]\n}\n\noutput \"subnet_cidrs\" {\n  value = [\"${formatlist(\"%s/%d\", data.phpipam_subnet.subnets.*.subnet_address, data.phpipam_subnet.subnets.*.subnet_mask)}\"]\n}\n```\n\n##### Argument Reference\n\nThe data source takes the following parameters:\n\n * `section_id` (Required) - The ID of the section of the subnet.\n\nOne of the following below parameters is required:\n\n * `description` - The subnet's description.\n * `description_match` - A regular expression to match against when searching\n   for a subnet.\n * `custom_field_filter` - A map of custom fields to search for. The filter\n   values are regular expressions. All fields need to match for the match to\n   succeed. \n\nYou can find documentation for the regular expression syntax used with the\n`description_match` and `custom_field_filter` attributes\n[here](https://github.com/google/re2/wiki/Syntax).\n\n⚠️  **NOTE:** An empty or unspecified `custom_field_filter` value is the\nequivalent to a regular expression that matches everything, and hence will\nreturn **all** subnets that contain the referenced custom field key!\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `subnet_ids` - A list of subnet IDs that match the given criteria.\n\n#### The `phpipam_vlan` Data Source\n\nThe `phpipam_vlan` data source allows one to look up a VLAN in the PHPIPAM\ndatabase. This can then be used to assign a VLAN to a subnet in the\n`phpipam_subnet` resource. It can also be used to gather other information on\nthe VLAN.\n\n**Example:**\n\n```\ndata \"phpipam_section\" \"section\" {\n  name = \"Customers\"\n}\n\ndata \"phpipam_vlan\" \"vlan\" {\n  number = 1000\n}\n\nresource \"phpipam_subnet\" \"subnet\" {\n  section_id     = \"${data.phpipam_section.section.section_id}\"\n  subnet_address = \"10.10.3.0\"\n  subnet_mask    = 24\n  vlan_id        = \"${data.phpipam_vlan.vlan.vlan_id}\"\n}\n```\n\n##### Argument Reference\n\nThe data source takes the following parameters:\n\n * `vlan_id` - The ID of the VLAN to look up. **NOTE:** this is the database ID,\n   not the VLAN number - if you need this, use the `number` parameter.\n * `number` - The number of the VLAN to look up.\n\nOne of `vlan_id` or `number` must be supplied. If both are supplied,\n`vlan_id` is used.\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `vlan_id` - The ID of the VLAN to look up. **NOTE:** this is the database ID,\n   not the VLAN number - if you need this, use the `number` parameter.\n * `number` - The number of the VLAN (the actual VLAN ID on your switch).\n * `l2_domain_id` - The layer 2 domain ID in the PHPIPAM database.\n * `name` - The name/label of the VLAN.\n * `description` - The description supplied to the VLAN.\n * `edit_date` - The date this resource was last updated.\n * `custom_fields` - A key/value map of custom fields for this VLAN.\n\n### Resources\n\nThe following resources are supplied by this plugin:\n\n#### The `phpipam_address` Resource\n\nThe `phpipam_address` resource manages an IP address in PHPIPAM. You can use it\nto create IP address reservations for IP addresses that have been created by\nother Terraform resources, or supplied by the `phpipam_first_free_address` data\nsource. An example usage is below. \n\n⚠️  **NOTE:** If you are using the `phpipam_first_free_address` to get the first\nfree IP address in a specific subnet, make sure you set `subnet_id` and\n`ip_address` as ignored attributes with the `ignore_changes` lifecycle\nattribute. This will prevent Terraform from perpetually deleting and\nre-allocating the address when it sees a different available IP address in the\n`phpipam_first_free_address` data source.\n\n**Example:**\n\n```\n// Look up the subnet\ndata \"phpipam_subnet\" \"subnet\" {\n  subnet_address = \"10.10.2.0\"\n  subnet_mask    = 24\n}\n\n// Get the first available address\ndata \"phpipam_first_free_address\" \"next_address\" {\n  subnet_id = \"${data.phpipam_subnet.subnet.subnet_id}\"\n}\n\n// Reserve the address. Note that we use ignore_changes here to ensure that we\n// don't end up re-allocating this address on future Terraform runs.\nresource \"phpipam_address\" {\n  subnet_id   = \"${data.phpipam_subnet.subnet.subnet_id}\"\n  ip_address  = \"${data.phpipam_first_free_address.next_address.ip_address}\"\n  hostname    = \"tf-test-host.example.internal\"\n  description = \"Managed by Terraform\"\n\n  custom_fields = {\n    CustomTestAddresses = \"terraform-test\"\n  }\n\n  lifecycle {\n    ignore_changes = [\n      \"subnet_id\",\n      \"ip_address\",\n    ]\n  }\n}\n```\n\n##### Argument Reference\n\nThe resource takes the following parameters:\n\n * `subnet_id` (Required) - The database ID of the subnet this IP address\n   belongs to.\n * `ip_address` (Required) - The IP address to reserve.\n * `is_gateway` (Optional) - `true` if this IP address has been designated as a\n   gateway.\n * `description` (Optional) - The description provided to this IP address.\n * `hostname` (Optional) - The hostname supplied to this IP address.\n * `owner` (Optional) - The owner name provided to this IP address.\n * `mac_address` (Optional) - The MAC address provided to this IP address.\n * `state_tag_id` (Optional) - The tag ID in the database for the IP address'\n   specific state. **NOTE:** This is currently represented as an integer but may\n   change to the specific string representation at a later time.\n * `skip_ptr_record` (Optional) - `true` if PTR records are not being created\n   for this IP address.\n * `ptr_record_id` (Optional) - The ID of the associated PTR record in the\n   PHPIPAM database.\n * `device_id` (Optional) - The ID of the associated device in the PHPIPAM\n   database.\n * `switch_port_label` (Optional) - A string port label that is associated with\n   this address.\n * `note` (Optional) - The note supplied to this IP address.\n * `exclude_ping` (Optional) - `true` if this address is excluded from ping\n   probes.\n * `remove_dns_on_delete` (Optional) - Removes DNS records created by PHPIPAM\n   when the address is deleted from Terraform. Defaults to `true`.\n * `custom_fields` (Optional) -  A key/value map of custom fields for this address.\n\n⚠️  **NOTE on custom fields:** PHPIPAM installations with custom fields must have\nall fields set to optional when using this plugin. For more info see\n[here](https://github.com/phpipam/phpipam/issues/1073). Further to this, either\nensure that your fields also do not have default values, or ensure the default\nis set in your TF configuration. Diff loops may happen otherwise!\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `address_id` - The ID of the IP address in the PHPIPAM database.\n * `last_seen` - The last time this IP address answered ping probes.\n * `edit_date` - The last time this resource was modified.\n\n#### The `phpipam_section` Resource\n\nThe `phpipam_section` resource manages a PHPIPAM section - a top-level category\nthat subnets and IP addresses are entered into. Use this resource if you want to\nmanage a section entirely from Terraform. If you just need to get information on\na section use the `phpipam_section` data source instead.\n\n**Example:**\n\n```\n// Create a section\nresource \"phpipam_section\" \"section\" {\n  name        = \"tf-test\"\n  description = \"Terraform test section\"\n}\n```\n\n##### Argument Reference\n\nThe resource takes the following parameters:\n\n * `name` (Required) - The name of the section.\n * `description` (Optional) - The section's description.\n * `master_section_id` (Optional) - The ID of the parent section in the PHPIPAM\n   database.\n * `strict_mode` (Optional) - `true` if this subnet is set up to check that IP\n   addresses are valid for the subnets they are in.\n * `subnet_ordering` (Optional) - How subnets in this section are ordered.\n * `display_order` (Optional) - The section's display order number.\n * `show_vlan_in_subnet_listing` (Optional) - `true` if VLANs are being shown in\n   the subnet listing for this section.\n * `show_vrf_in_subnet_listing` (Optional) - `true` if VRFs are being shown in\n   the subnet listing for this section.\n * `show_supernet_only` (Optional) - `true` if supernets are only being shown in\n   the subnet listing.\n * `dns_resolver_id` (Optional) - The ID of the DNS resolver to use in the\n   section.\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `section_id` - The ID of the section in the PHPIPAM database.\n * `edit_date` - The date this resource was last edited.\n\n#### The `phpipam_subnet` Resource\n\nThe `phpipam_subnet` resource can be used to create and manage a subnet in\nPHPIPAM. Use it to manage details on subnets you create in Terraform for other\nthings, such as storing the IDs of the subnets you create for AWS, or for a full\ntop-down management of subnets and IP addresses in Terraform. If you just need\nto get information on a subnet, use the `phpipam_subnet` data source instead.\n\n**Example:**\n\n```\ndata \"phpipam_section\" \"section\" {\n  name = \"Customers\"\n}\n\nresource \"phpipam_subnet\" \"subnet\" {\n  section_id     = \"${data.phpipam_section.section.section_id}\"\n  subnet_address = \"10.10.3.0\"\n  subnet_mask    = 24\n\n  custom_fields = {\n    CustomTestSubnets = \"terraform-test\"\n  }\n}\n```\n\n##### Argument Reference\n\nThe resource takes the following parameters:\n\n * `subnet_address` (Required) - The network address of the subnet.\n * `subnet_mask` (Required) - The subnet mask, in bits.\n * `description` (Optional) - The description set for the subnet.\n * `section_id` (Optional) - The ID of the section for this address in the\n   PHPIPAM database.\n * `linked_subnet_id` (Optional) - The ID of the linked subnet in the PHPIPAM\n   database.\n * `vlan_id` (Optional) - The ID of the VLAN for this subnet in the PHPIPAM\n   database.\n * `vrf_id` (Optional) - The ID of the VRF for this subnet in the PHPIPAM\n   database.\n * `master_subnet_id` (Optional) - The ID of the parent subnet for this subnet\n   in the PHPIPAM database.\n * `nameserver_id` (Optional) - The ID of the nameserver used to assign PTR\n   records for this subnet.\n * `show_name` (Optional) - `true` if the subnet name is are shown in the\n   section, instead of the network address.\n * `create_ptr_records` (Optional) - `true` if PTR records are created for\n   addresses in this subnet.\n * `display_hostnames` (Optional) - `true` if hostnames are displayed instead of\n   IP addresses in the address listing for this subnet.\n * `allow_ip_requests` (Optional) - `true` if the subnet allows IP requests in\n   PHPIPAM.\n * `scan_agent_id` (Optional) - The ID of the ping scan agent that is used for\n   this subnet.\n * `include_in_ping` (Optional) - `true` if this subnet is included in ping\n   probes.\n * `host_discovery_enabled` (Optional) - `true` if this subnet is included in\n   new host scans.\n * `is_folder` (Optional) - `true` if this subnet is a folder and not an actual\n   subnet.\n * `is_full` (Optional) - `true` if the subnet has been marked as full.\n * `state_tag_id` (Optional) - The ID of the state tag for this subnet. This may\n   become an actual string representation of this at a later time (example:\n   `Used`).\n * `utilization_threshold` (Optional) - The subnet's utilization threshold.\n * `location_id` (Optional) - The ID of the location for this subnet.\n * `custom_fields` (Optional) -  A key/value map of custom fields for this\n   subnet.\n\n⚠️  **NOTE on custom fields:** PHPIPAM installations with custom fields must have\nall fields set to optional when using this plugin. For more info see\n[here](https://github.com/phpipam/phpipam/issues/1073). Further to this, either\nensure that your fields also do not have default values, or ensure the default\nis set in your TF configuration. Diff loops may happen otherwise!\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `subnet_id` - The ID of the subnet in the PHPIPAM database.\n * `permissions` - A JSON representation of the permissions associated with this\n   subnet.\n * `edit_date` - The date this resource was last updated.\n\n#### The `phpipam_vlan` Resource\n\nThe `phpipam_vlan` resource can be used to manage a VLAN on PHPIPAM. Use it to\nset up a VLAN through Terraform, or update details such as its name or\ndescription. If you are just looking for information on a VLAN, use the\n`phpipam_vlan` data source instead.\n\n**Example:**\n\n```\nresource \"phpipam_vlan\" \"vlan\" {\n  name        = \"tf-test\"\n  number      = 1000\n  description = \"Managed by Terraform\"\n\n  custom_fields = {\n    CustomTestVLANs = \"terraform-test\"\n  }\n}\n```\n\n##### Argument Reference\n\nThe resource takes the following parameters:\n\n * `name` (Required) - The name/label of the VLAN.\n * `number` (Required) - The number of the VLAN (the actual VLAN ID on your switch).\n * `l2_domain_id` (Optional) - The layer 2 domain ID in the PHPIPAM database.\n * `description` (Optional) - The description supplied to the VLAN.\n * `edit_date` (Optional) - The date this resource was last updated.\n * `custom_fields` (Optional) -  A key/value map of custom fields for this\n   VLAN.\n\n⚠️  **NOTE on custom fields:** PHPIPAM installations with custom fields must have\nall fields set to optional when using this plugin. For more info see\n[here](https://github.com/phpipam/phpipam/issues/1073). Further to this, either\nensure that your fields also do not have default values, or ensure the default\nis set in your TF configuration. Diff loops may happen otherwise!\n\n##### Attribute Reference\n\nThe following attributes are exported:\n\n * `vlan_id` - The ID of the VLAN to look up. **NOTE:** this is the database ID,\n   not the VLAN number - if you need this, use the `number` parameter.\n * `edit_date` - The date this resource was last updated.\n\n## LICENSE\n\n```\nCopyright 2017 PayByPhone Technologies, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaybyphone%2Fterraform-provider-phpipam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaybyphone%2Fterraform-provider-phpipam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaybyphone%2Fterraform-provider-phpipam/lists"}