1. Packages
  2. Aiven Provider
  3. API Docs
  4. AzurePrivatelinkConnectionApproval
Aiven v6.37.0 published on Thursday, Apr 10, 2025 by Pulumi

aiven.AzurePrivatelinkConnectionApproval

Explore with Pulumi AI

Approves an Azure Private Link connection to an Aiven service with an associated endpoint IP.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aiven from "@pulumi/aiven";
import * as azurerm from "@pulumi/azurerm";

const staticIps: aiven.StaticIp[] = [];
for (const range = {value: 0}; range.value < 2; range.value++) {
    staticIps.push(new aiven.StaticIp(`static_ips-${range.value}`, {
        project: projectId,
        cloudName: region,
    }));
}
const _default = new aiven.Pg("default", {
    serviceName: "postgres",
    project: aivenProjectId,
    projectVpcId: aivenProjectVpcId,
    cloudName: region,
    plan: plan,
    staticIps: staticIps.map(sip => (sip.staticIpAddressId)),
    pgUserConfig: {
        pgVersion: "13",
        staticIps: true,
        privatelinkAccess: {
            pg: true,
            pgbouncer: true,
        },
    },
});
const privatelink = new aiven.AzurePrivatelink("privatelink", {
    project: aivenProjectId,
    serviceName: _default.name,
    userSubscriptionIds: [azureSubscriptionId],
});
const endpoint = new azurerm.index.PrivateEndpoint("endpoint", {
    name: "postgres-endpoint",
    location: region,
    resourceGroupName: azureResourceGroup.name,
    subnetId: azureSubnetId,
    privateServiceConnection: [{
        name: _default.name,
        privateConnectionResourceId: privatelink.azureServiceId,
        isManualConnection: true,
        requestMessage: _default.name,
    }],
}, {
    dependsOn: [privatelink],
});
const approval = new aiven.AzurePrivatelinkConnectionApproval("approval", {
    project: aivenProjectId,
    serviceName: _default.serviceName,
    endpointIpAddress: endpoint.privateServiceConnection[0].privateIpAddress,
});
Copy
import pulumi
import pulumi_aiven as aiven
import pulumi_azurerm as azurerm

static_ips = []
for range in [{"value": i} for i in range(0, 2)]:
    static_ips.append(aiven.StaticIp(f"static_ips-{range['value']}",
        project=project_id,
        cloud_name=region))
default = aiven.Pg("default",
    service_name="postgres",
    project=aiven_project_id,
    project_vpc_id=aiven_project_vpc_id,
    cloud_name=region,
    plan=plan,
    static_ips=[sip.static_ip_address_id for sip in static_ips],
    pg_user_config={
        "pg_version": "13",
        "static_ips": True,
        "privatelink_access": {
            "pg": True,
            "pgbouncer": True,
        },
    })
privatelink = aiven.AzurePrivatelink("privatelink",
    project=aiven_project_id,
    service_name=default.name,
    user_subscription_ids=[azure_subscription_id])
endpoint = azurerm.index.PrivateEndpoint("endpoint",
    name=postgres-endpoint,
    location=region,
    resource_group_name=azure_resource_group.name,
    subnet_id=azure_subnet_id,
    private_service_connection=[{
        name: default.name,
        privateConnectionResourceId: privatelink.azure_service_id,
        isManualConnection: True,
        requestMessage: default.name,
    }],
    opts = pulumi.ResourceOptions(depends_on=[privatelink]))
approval = aiven.AzurePrivatelinkConnectionApproval("approval",
    project=aiven_project_id,
    service_name=default.service_name,
    endpoint_ip_address=endpoint["privateServiceConnection"][0]["privateIpAddress"])
Copy
Coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aiven = Pulumi.Aiven;
using Azurerm = Pulumi.Azurerm;

return await Deployment.RunAsync(() => 
{
    var staticIps = new List<Aiven.StaticIp>();
    for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
    {
        var range = new { Value = rangeIndex };
        staticIps.Add(new Aiven.StaticIp($"static_ips-{range.Value}", new()
        {
            Project = projectId,
            CloudName = region,
        }));
    }
    var @default = new Aiven.Pg("default", new()
    {
        ServiceName = "postgres",
        Project = aivenProjectId,
        ProjectVpcId = aivenProjectVpcId,
        CloudName = region,
        Plan = plan,
        StaticIps = staticIps.Select(sip => 
        {
            return sip.StaticIpAddressId;
        }).ToList(),
        PgUserConfig = new Aiven.Inputs.PgPgUserConfigArgs
        {
            PgVersion = "13",
            StaticIps = true,
            PrivatelinkAccess = new Aiven.Inputs.PgPgUserConfigPrivatelinkAccessArgs
            {
                Pg = true,
                Pgbouncer = true,
            },
        },
    });

    var privatelink = new Aiven.AzurePrivatelink("privatelink", new()
    {
        Project = aivenProjectId,
        ServiceName = @default.Name,
        UserSubscriptionIds = new[]
        {
            azureSubscriptionId,
        },
    });

    var endpoint = new Azurerm.Index.PrivateEndpoint("endpoint", new()
    {
        Name = "postgres-endpoint",
        Location = region,
        ResourceGroupName = azureResourceGroup.Name,
        SubnetId = azureSubnetId,
        PrivateServiceConnection = new[]
        {
            
            {
                { "name", @default.Name },
                { "privateConnectionResourceId", privatelink.AzureServiceId },
                { "isManualConnection", true },
                { "requestMessage", @default.Name },
            },
        },
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            privatelink,
        },
    });

    var approval = new Aiven.AzurePrivatelinkConnectionApproval("approval", new()
    {
        Project = aivenProjectId,
        ServiceName = @default.ServiceName,
        EndpointIpAddress = endpoint.PrivateServiceConnection[0].PrivateIpAddress,
    });

});
Copy
Coming soon!
Coming soon!

Create AzurePrivatelinkConnectionApproval Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new AzurePrivatelinkConnectionApproval(name: string, args: AzurePrivatelinkConnectionApprovalArgs, opts?: CustomResourceOptions);
@overload
def AzurePrivatelinkConnectionApproval(resource_name: str,
                                       args: AzurePrivatelinkConnectionApprovalArgs,
                                       opts: Optional[ResourceOptions] = None)

@overload
def AzurePrivatelinkConnectionApproval(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       project: Optional[str] = None,
                                       service_name: Optional[str] = None,
                                       endpoint_ip_address: Optional[str] = None)
func NewAzurePrivatelinkConnectionApproval(ctx *Context, name string, args AzurePrivatelinkConnectionApprovalArgs, opts ...ResourceOption) (*AzurePrivatelinkConnectionApproval, error)
public AzurePrivatelinkConnectionApproval(string name, AzurePrivatelinkConnectionApprovalArgs args, CustomResourceOptions? opts = null)
public AzurePrivatelinkConnectionApproval(String name, AzurePrivatelinkConnectionApprovalArgs args)
public AzurePrivatelinkConnectionApproval(String name, AzurePrivatelinkConnectionApprovalArgs args, CustomResourceOptions options)
type: aiven:AzurePrivatelinkConnectionApproval
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AzurePrivatelinkConnectionApprovalArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AzurePrivatelinkConnectionApprovalArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AzurePrivatelinkConnectionApprovalArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AzurePrivatelinkConnectionApprovalArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AzurePrivatelinkConnectionApprovalArgs
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 azurePrivatelinkConnectionApprovalResource = new Aiven.AzurePrivatelinkConnectionApproval("azurePrivatelinkConnectionApprovalResource", new()
{
    Project = "string",
    ServiceName = "string",
    EndpointIpAddress = "string",
});
Copy
example, err := aiven.NewAzurePrivatelinkConnectionApproval(ctx, "azurePrivatelinkConnectionApprovalResource", &aiven.AzurePrivatelinkConnectionApprovalArgs{
	Project:           pulumi.String("string"),
	ServiceName:       pulumi.String("string"),
	EndpointIpAddress: pulumi.String("string"),
})
Copy
var azurePrivatelinkConnectionApprovalResource = new AzurePrivatelinkConnectionApproval("azurePrivatelinkConnectionApprovalResource", AzurePrivatelinkConnectionApprovalArgs.builder()
    .project("string")
    .serviceName("string")
    .endpointIpAddress("string")
    .build());
Copy
azure_privatelink_connection_approval_resource = aiven.AzurePrivatelinkConnectionApproval("azurePrivatelinkConnectionApprovalResource",
    project="string",
    service_name="string",
    endpoint_ip_address="string")
Copy
const azurePrivatelinkConnectionApprovalResource = new aiven.AzurePrivatelinkConnectionApproval("azurePrivatelinkConnectionApprovalResource", {
    project: "string",
    serviceName: "string",
    endpointIpAddress: "string",
});
Copy
type: aiven:AzurePrivatelinkConnectionApproval
properties:
    endpointIpAddress: string
    project: string
    serviceName: string
Copy

AzurePrivatelinkConnectionApproval 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 AzurePrivatelinkConnectionApproval resource accepts the following input properties:

Project
This property is required.
Changes to this property will trigger replacement.
string
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
EndpointIpAddress string
IP address of Azure private endpoint.
Project
This property is required.
Changes to this property will trigger replacement.
string
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
EndpointIpAddress string
IP address of Azure private endpoint.
project
This property is required.
Changes to this property will trigger replacement.
String
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
endpointIpAddress String
IP address of Azure private endpoint.
project
This property is required.
Changes to this property will trigger replacement.
string
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
endpointIpAddress string
IP address of Azure private endpoint.
project
This property is required.
Changes to this property will trigger replacement.
str
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
service_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
endpoint_ip_address str
IP address of Azure private endpoint.
project
This property is required.
Changes to this property will trigger replacement.
String
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
endpointIpAddress String
IP address of Azure private endpoint.

Outputs

All input properties are implicitly available as output properties. Additionally, the AzurePrivatelinkConnectionApproval resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
PrivatelinkConnectionId string
The ID of the Private Link connection.
State string
The state of the Private Link connection.
Id string
The provider-assigned unique ID for this managed resource.
PrivatelinkConnectionId string
The ID of the Private Link connection.
State string
The state of the Private Link connection.
id String
The provider-assigned unique ID for this managed resource.
privatelinkConnectionId String
The ID of the Private Link connection.
state String
The state of the Private Link connection.
id string
The provider-assigned unique ID for this managed resource.
privatelinkConnectionId string
The ID of the Private Link connection.
state string
The state of the Private Link connection.
id str
The provider-assigned unique ID for this managed resource.
privatelink_connection_id str
The ID of the Private Link connection.
state str
The state of the Private Link connection.
id String
The provider-assigned unique ID for this managed resource.
privatelinkConnectionId String
The ID of the Private Link connection.
state String
The state of the Private Link connection.

Look up Existing AzurePrivatelinkConnectionApproval Resource

Get an existing AzurePrivatelinkConnectionApproval 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?: AzurePrivatelinkConnectionApprovalState, opts?: CustomResourceOptions): AzurePrivatelinkConnectionApproval
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        endpoint_ip_address: Optional[str] = None,
        privatelink_connection_id: Optional[str] = None,
        project: Optional[str] = None,
        service_name: Optional[str] = None,
        state: Optional[str] = None) -> AzurePrivatelinkConnectionApproval
func GetAzurePrivatelinkConnectionApproval(ctx *Context, name string, id IDInput, state *AzurePrivatelinkConnectionApprovalState, opts ...ResourceOption) (*AzurePrivatelinkConnectionApproval, error)
public static AzurePrivatelinkConnectionApproval Get(string name, Input<string> id, AzurePrivatelinkConnectionApprovalState? state, CustomResourceOptions? opts = null)
public static AzurePrivatelinkConnectionApproval get(String name, Output<String> id, AzurePrivatelinkConnectionApprovalState state, CustomResourceOptions options)
resources:  _:    type: aiven:AzurePrivatelinkConnectionApproval    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
EndpointIpAddress string
IP address of Azure private endpoint.
PrivatelinkConnectionId string
The ID of the Private Link connection.
Project Changes to this property will trigger replacement. string
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
ServiceName Changes to this property will trigger replacement. string
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
State string
The state of the Private Link connection.
EndpointIpAddress string
IP address of Azure private endpoint.
PrivatelinkConnectionId string
The ID of the Private Link connection.
Project Changes to this property will trigger replacement. string
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
ServiceName Changes to this property will trigger replacement. string
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
State string
The state of the Private Link connection.
endpointIpAddress String
IP address of Azure private endpoint.
privatelinkConnectionId String
The ID of the Private Link connection.
project Changes to this property will trigger replacement. String
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
serviceName Changes to this property will trigger replacement. String
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
state String
The state of the Private Link connection.
endpointIpAddress string
IP address of Azure private endpoint.
privatelinkConnectionId string
The ID of the Private Link connection.
project Changes to this property will trigger replacement. string
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
serviceName Changes to this property will trigger replacement. string
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
state string
The state of the Private Link connection.
endpoint_ip_address str
IP address of Azure private endpoint.
privatelink_connection_id str
The ID of the Private Link connection.
project Changes to this property will trigger replacement. str
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
service_name Changes to this property will trigger replacement. str
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
state str
The state of the Private Link connection.
endpointIpAddress String
IP address of Azure private endpoint.
privatelinkConnectionId String
The ID of the Private Link connection.
project Changes to this property will trigger replacement. String
The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
serviceName Changes to this property will trigger replacement. String
The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
state String
The state of the Private Link connection.

Import

$ pulumi import aiven:index/azurePrivatelinkConnectionApproval:AzurePrivatelinkConnectionApproval approval PROJECT/SERVICE_NAME
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Aiven pulumi/pulumi-aiven
License
Apache-2.0
Notes
This Pulumi package is based on the aiven Terraform Provider.