Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IWireGuardManager

interface IWireGuardManager
Extends com.amazon.apmf.IStandard Standalone WireGuard manager interface. Provides APIs to manage WireGuard tunnel interfaces independently from the generic VPN manager.

Methods

createInterface()

void createInterface(WgInterfaceConfig* ifConfig)
Create a WireGuard interface. This is an asynchronous operation. On success, a WG_STATE_UP event is delivered. On failure, a WG_CREATE_FAILURE event is delivered.

Parameters

ifConfig
WgInterfaceConfig* — Required the interface configuration. The IP field is mandatory. Listen port and private key are optional.

Throws

Requires com.amazon.network.privilege.wireguard

removeInterface()

void removeInterface(u8 interfaceId)
Remove a WireGuard interface. This is an asynchronous operation.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.

Throws

Requires com.amazon.network.privilege.wireguard

getState()

WgState getState(u8 interfaceId)
Get the current WireGuard interface state.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.

Returns

WgState the current WireGuard state.

Throws

Requires com.amazon.network.privilege.wireguard

getConfig()

WgConfig? getConfig(u8 interfaceId)
Get the full WireGuard configuration including interface and peers.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.

Returns

WgConfig? The return value is optional and might be absent. the WireGuard configuration.

Throws

Requires com.amazon.network.privilege.wireguard

updateInterface()

void updateInterface(u8 interfaceId, WgUpdateInterface updateType, WgInterfaceConfig* ifConfig)
Update WireGuard interface configuration. This is an asynchronous operation. Multiple fields can be updated by combining update type flags.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.
updateType
WgUpdateInterface — Required bitmask of fields to update.
ifConfig
WgInterfaceConfig* — Required the new interface configuration values.

Throws

Requires com.amazon.network.privilege.wireguard

addPeer()

void addPeer(u8 interfaceId, WgPeerConfig* peerConfig)
Add a remote peer to the WireGuard interface. This is an asynchronous operation.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.
peerConfig
WgPeerConfig* — Required the peer configuration.

Throws

Requires com.amazon.network.privilege.wireguard

removePeer()

void removePeer(u8 interfaceId, u8[] peerPubKey)
Remove a peer from the WireGuard interface. This is an asynchronous operation.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.
peerPubKey
u8[] — Required the public key of the peer to remove (32 bytes).

Throws

Requires com.amazon.network.privilege.wireguard

updatePeer()

void updatePeer(u8 interfaceId, WgUpdatePeer updateType, WgPeerConfig* peerConfig)
Update a WireGuard peer configuration. This is an asynchronous operation. Multiple fields can be updated by combining update type flags.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.
updateType
WgUpdatePeer — Required bitmask of fields to update.
peerConfig
WgPeerConfig* — Required the new peer configuration values.

Throws

Requires com.amazon.network.privilege.wireguard

setPeerKeepAlive()

void setPeerKeepAlive(u8 interfaceId, u8[] peerPubKey, u16 keepAliveSeconds)
Set the keepalive interval for a peer.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.
peerPubKey
u8[] — Required the public key of the peer (32 bytes).
keepAliveSeconds
u16 — Required keepalive interval in seconds. 0 disables keepalive.

Throws

Requires com.amazon.network.privilege.wireguard

getPeerStats()

WgPeerStats? getPeerStats(u8 interfaceId, u8[] peerPubKey)
Get statistics for a specific peer.

Parameters

interfaceId
u8 — Required the WireGuard interface identifier.
peerPubKey
u8[] — Required the public key of the peer (32 bytes).

Returns

WgPeerStats? The return value is optional and might be absent. the peer statistics.

Throws

Requires com.amazon.network.privilege.wireguard
Last modified on October 29, 2026