published on Friday, Feb 20, 2026 by stackitcloud
published on Friday, Feb 20, 2026 by stackitcloud
Associates an existing public IP to a network interface. This is useful for situations where you have a pre-allocated public IP or unable to use the stackit.PublicIp resource to create a new public IP. Must have a region specified in the provider configuration.
!> The stackit.PublicIpAssociate resource should not be used together with the stackit.PublicIp resource for the same public IP or for the same network interface.
Using both resources together for the same public IP or network interface WILL lead to conflicts, as they both have control of the public IP and network interface association.
Example Usage
resource "stackit_public_ip_associate" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
public_ip_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
# Only use the import statement, if you want to import an existing public ip associate
import {
to = stackit_public_ip_associate.import-example
id = "${var.project_id},${var.region},${var.public_ip_id},${var.network_interface_id}"
}
Create PublicIpAssociate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PublicIpAssociate(name: string, args: PublicIpAssociateArgs, opts?: CustomResourceOptions);@overload
def PublicIpAssociate(resource_name: str,
args: PublicIpAssociateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PublicIpAssociate(resource_name: str,
opts: Optional[ResourceOptions] = None,
network_interface_id: Optional[str] = None,
project_id: Optional[str] = None,
public_ip_id: Optional[str] = None,
region: Optional[str] = None)func NewPublicIpAssociate(ctx *Context, name string, args PublicIpAssociateArgs, opts ...ResourceOption) (*PublicIpAssociate, error)public PublicIpAssociate(string name, PublicIpAssociateArgs args, CustomResourceOptions? opts = null)
public PublicIpAssociate(String name, PublicIpAssociateArgs args)
public PublicIpAssociate(String name, PublicIpAssociateArgs args, CustomResourceOptions options)
type: stackit:PublicIpAssociate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args PublicIpAssociateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PublicIpAssociateArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args PublicIpAssociateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PublicIpAssociateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PublicIpAssociateArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var publicIpAssociateResource = new Stackit.PublicIpAssociate("publicIpAssociateResource", new()
{
NetworkInterfaceId = "string",
ProjectId = "string",
PublicIpId = "string",
Region = "string",
});
example, err := stackit.NewPublicIpAssociate(ctx, "publicIpAssociateResource", &stackit.PublicIpAssociateArgs{
NetworkInterfaceId: pulumi.String("string"),
ProjectId: pulumi.String("string"),
PublicIpId: pulumi.String("string"),
Region: pulumi.String("string"),
})
var publicIpAssociateResource = new PublicIpAssociate("publicIpAssociateResource", PublicIpAssociateArgs.builder()
.networkInterfaceId("string")
.projectId("string")
.publicIpId("string")
.region("string")
.build());
public_ip_associate_resource = stackit.PublicIpAssociate("publicIpAssociateResource",
network_interface_id="string",
project_id="string",
public_ip_id="string",
region="string")
const publicIpAssociateResource = new stackit.PublicIpAssociate("publicIpAssociateResource", {
networkInterfaceId: "string",
projectId: "string",
publicIpId: "string",
region: "string",
});
type: stackit:PublicIpAssociate
properties:
networkInterfaceId: string
projectId: string
publicIpId: string
region: string
PublicIpAssociate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The PublicIpAssociate resource accepts the following input properties:
- Network
Interface stringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- Project
Id string - STACKIT project ID to which the public IP is associated.
- Public
Ip stringId - The public IP ID.
- Region string
- The resource region. If not defined, the provider region is used.
- Network
Interface stringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- Project
Id string - STACKIT project ID to which the public IP is associated.
- Public
Ip stringId - The public IP ID.
- Region string
- The resource region. If not defined, the provider region is used.
- network
Interface StringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- project
Id String - STACKIT project ID to which the public IP is associated.
- public
Ip StringId - The public IP ID.
- region String
- The resource region. If not defined, the provider region is used.
- network
Interface stringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- project
Id string - STACKIT project ID to which the public IP is associated.
- public
Ip stringId - The public IP ID.
- region string
- The resource region. If not defined, the provider region is used.
- network_
interface_ strid - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- project_
id str - STACKIT project ID to which the public IP is associated.
- public_
ip_ strid - The public IP ID.
- region str
- The resource region. If not defined, the provider region is used.
- network
Interface StringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- project
Id String - STACKIT project ID to which the public IP is associated.
- public
Ip StringId - The public IP ID.
- region String
- The resource region. If not defined, the provider region is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the PublicIpAssociate resource produces the following output properties:
Look up Existing PublicIpAssociate Resource
Get an existing PublicIpAssociate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: PublicIpAssociateState, opts?: CustomResourceOptions): PublicIpAssociate@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
ip: Optional[str] = None,
network_interface_id: Optional[str] = None,
project_id: Optional[str] = None,
public_ip_id: Optional[str] = None,
region: Optional[str] = None) -> PublicIpAssociatefunc GetPublicIpAssociate(ctx *Context, name string, id IDInput, state *PublicIpAssociateState, opts ...ResourceOption) (*PublicIpAssociate, error)public static PublicIpAssociate Get(string name, Input<string> id, PublicIpAssociateState? state, CustomResourceOptions? opts = null)public static PublicIpAssociate get(String name, Output<String> id, PublicIpAssociateState state, CustomResourceOptions options)resources: _: type: stackit:PublicIpAssociate get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Ip string
- The IP address.
- Network
Interface stringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- Project
Id string - STACKIT project ID to which the public IP is associated.
- Public
Ip stringId - The public IP ID.
- Region string
- The resource region. If not defined, the provider region is used.
- Ip string
- The IP address.
- Network
Interface stringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- Project
Id string - STACKIT project ID to which the public IP is associated.
- Public
Ip stringId - The public IP ID.
- Region string
- The resource region. If not defined, the provider region is used.
- ip String
- The IP address.
- network
Interface StringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- project
Id String - STACKIT project ID to which the public IP is associated.
- public
Ip StringId - The public IP ID.
- region String
- The resource region. If not defined, the provider region is used.
- ip string
- The IP address.
- network
Interface stringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- project
Id string - STACKIT project ID to which the public IP is associated.
- public
Ip stringId - The public IP ID.
- region string
- The resource region. If not defined, the provider region is used.
- ip str
- The IP address.
- network_
interface_ strid - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- project_
id str - STACKIT project ID to which the public IP is associated.
- public_
ip_ strid - The public IP ID.
- region str
- The resource region. If not defined, the provider region is used.
- ip String
- The IP address.
- network
Interface StringId - The ID of the network interface (or virtual IP) to which the public IP should be attached to.
- project
Id String - STACKIT project ID to which the public IP is associated.
- public
Ip StringId - The public IP ID.
- region String
- The resource region. If not defined, the provider region is used.
Package Details
- Repository
- stackit stackitcloud/pulumi-stackit
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
stackitTerraform Provider.
published on Friday, Feb 20, 2026 by stackitcloud
