API Allowlist
Manage the addresses your NetActuate API keys can be used from with the NetActuate Terraform provider v2. Entries can apply to the whole account or to a single team member. For how the allowlist works, see API Access.
Requirements
- NetActuate Terraform provider 0.4.11 or later.
- The account owner's API key, or a team member's API key with
account.api-acl.managefor the scope they want to manage. - The address Terraform runs from already on the allowlist. Add the first entry in the portal, see API Access.
Account Entries
Set sub_user_id = 0 to create an account-wide entry. With the account owner's key, omitting sub_user_id also creates an account-wide entry. These entries allow API calls from the listed addresses for both the owner's and team members' keys.
resource "netactuate_api_acl" "office" {
cidr = "198.51.100.0/24"
description = "Office network"
}
resource "netactuate_api_acl" "ci_runner" {
cidr = "192.0.2.10"
description = "CI runner"
}
resource "netactuate_api_acl" "office_v6" {
cidr = "2001:db8:100::/48"
description = "Office network IPv6"
}
A single address is stored as a /32 or /128. A range is stored as its network, so 198.51.100.70/24 becomes 198.51.100.0/24.
Team Member Entries
With the account owner's key, set sub_user_id to a team member's sub_id to add an address for that member's API key. Find sub_id values with the netactuate_iam_team_members data source. The member can use their key from both their personal entries and the account-wide entries.
resource "netactuate_api_acl" "alice_home" {
cidr = "203.0.113.25"
description = "Alice home office"
sub_user_id = 1234
}
A team member can explicitly target their own sub_id or use 0 for account scope, subject to their permissions. They cannot target another team member's sub_id. If they omit sub_user_id, the API uses their personal scope when they can manage it. Otherwise it uses account scope if they have permission to manage it.
Arguments
| Argument | Description | Required |
|---|---|---|
cidr | Address or range, IPv4 or IPv6 | Yes |
description | Entry description | Yes |
sub_user_id | Team member ID, or 0 for the account. When omitted, the API uses the caller's default scope described above. Changing it replaces the entry | No |
cidr and description update in place. Each entry also exports sub_id, created_at, editable and resources. An identical CIDR can appear only once per scope.
Read the Allowlist
The netactuate_api_acls data source lists entries. In the same configuration as your entries, use depends_on so it reads them after they are created. The account owner's key lists account-wide entries by default. Set sub_user_id to list a specific team member's entries, or 0 to select account scope explicitly. A team member's key returns both account-wide and personal entries regardless of the filter.
data "netactuate_api_acls" "account" {
depends_on = [netactuate_api_acl.office, netactuate_api_acl.ci_runner, netactuate_api_acl.office_v6]
}
data "netactuate_api_acls" "alice" {
sub_user_id = 1234
depends_on = [netactuate_api_acl.alice_home]
}
output "account_allowlist" {
value = [for a in data.netactuate_api_acls.account.acls : "${a.start_ip}/${a.bits} ${a.description}"]
}
Each entry lists id, start_ip, end_ip, bits, description, sub_id, created_at, editable and resources. Entries the platform added for a VPC or NKE cluster list that resource in resources. See API Access from the VPC.
Import
Import a manually managed account or team-member entry by its entry ID:
terraform import netactuate_api_acl.office 12345
Entry IDs are the id values in the netactuate_api_acls data source. With the owner's API key, set the data source's sub_user_id to list a specific member's entries.
Use the data source to inspect entries managed by a VPC or NKE cluster. If you import one and apply a change to its CIDR or description, the API removes its resource associations. The entry becomes manually managed and can remain after the VPC or cluster is deleted.
Need Help?
If you need assistance with the API allowlist, visit our support page.