1. Packages
  2. Astra DB
  3. API Docs
  4. PrivateLink
Astra DB v1.0.42 published on Tuesday, Jun 6, 2023 by pulumiverse

astra.PrivateLink

Explore with Pulumi AI

astra.PrivateLink provides a private link resource. Private Link is a private network endpoint that can be created to connect from your vpc to Astra without using a publicly routable IP address. astra.PrivateLink resources are associated with a database id. Once the private_link resource is created in Astra it must be linked to an endpoint within your vpc, use astra.PrivateLinkEndpoint to do this.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Astra = Pulumiverse.Astra;

return await Deployment.RunAsync(() => 
{
    var example = new Astra.PrivateLink("example", new()
    {
        AllowedPrincipals = new[]
        {
            "arn:aws:iam::111708290731:user/sebastian.estevez",
        },
        DatabaseId = "a6bc9c26-e7ce-424f-84c7-0a00afb12588",
        DatacenterId = "a6bc9c26-e7ce-424f-84c7-0a00afb12588-1",
    });

});
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-astra/sdk/go/astra"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := astra.NewPrivateLink(ctx, "example", &astra.PrivateLinkArgs{
			AllowedPrincipals: pulumi.StringArray{
				pulumi.String("arn:aws:iam::111708290731:user/sebastian.estevez"),
			},
			DatabaseId:   pulumi.String("a6bc9c26-e7ce-424f-84c7-0a00afb12588"),
			DatacenterId: pulumi.String("a6bc9c26-e7ce-424f-84c7-0a00afb12588-1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.astra.PrivateLink;
import com.pulumi.astra.PrivateLinkArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new PrivateLink("example", PrivateLinkArgs.builder()        
            .allowedPrincipals("arn:aws:iam::111708290731:user/sebastian.estevez")
            .databaseId("a6bc9c26-e7ce-424f-84c7-0a00afb12588")
            .datacenterId("a6bc9c26-e7ce-424f-84c7-0a00afb12588-1")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as astra from "@pulumi/astra";

const example = new astra.PrivateLink("example", {
    allowedPrincipals: ["arn:aws:iam::111708290731:user/sebastian.estevez"],
    databaseId: "a6bc9c26-e7ce-424f-84c7-0a00afb12588",
    datacenterId: "a6bc9c26-e7ce-424f-84c7-0a00afb12588-1",
});
Copy
import pulumi
import pulumiverse_astra as astra

example = astra.PrivateLink("example",
    allowed_principals=["arn:aws:iam::111708290731:user/sebastian.estevez"],
    database_id="a6bc9c26-e7ce-424f-84c7-0a00afb12588",
    datacenter_id="a6bc9c26-e7ce-424f-84c7-0a00afb12588-1")
Copy
resources:
  example:
    type: astra:PrivateLink
    properties:
      allowedPrincipals:
        - arn:aws:iam::111708290731:user/sebastian.estevez
      databaseId: a6bc9c26-e7ce-424f-84c7-0a00afb12588
      datacenterId: a6bc9c26-e7ce-424f-84c7-0a00afb12588-1
Copy

Create PrivateLink Resource

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

Constructor syntax

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

@overload
def PrivateLink(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                allowed_principals: Optional[Sequence[str]] = None,
                database_id: Optional[str] = None,
                datacenter_id: Optional[str] = None)
func NewPrivateLink(ctx *Context, name string, args PrivateLinkArgs, opts ...ResourceOption) (*PrivateLink, error)
public PrivateLink(string name, PrivateLinkArgs args, CustomResourceOptions? opts = null)
public PrivateLink(String name, PrivateLinkArgs args)
public PrivateLink(String name, PrivateLinkArgs args, CustomResourceOptions options)
type: astra:PrivateLink
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. PrivateLinkArgs
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. PrivateLinkArgs
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. PrivateLinkArgs
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. PrivateLinkArgs
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. PrivateLinkArgs
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 privateLinkResource = new Astra.PrivateLink("privateLinkResource", new()
{
    AllowedPrincipals = new[]
    {
        "string",
    },
    DatabaseId = "string",
    DatacenterId = "string",
});
Copy
example, err := astra.NewPrivateLink(ctx, "privateLinkResource", &astra.PrivateLinkArgs{
	AllowedPrincipals: pulumi.StringArray{
		pulumi.String("string"),
	},
	DatabaseId:   pulumi.String("string"),
	DatacenterId: pulumi.String("string"),
})
Copy
var privateLinkResource = new PrivateLink("privateLinkResource", PrivateLinkArgs.builder()
    .allowedPrincipals("string")
    .databaseId("string")
    .datacenterId("string")
    .build());
Copy
private_link_resource = astra.PrivateLink("privateLinkResource",
    allowed_principals=["string"],
    database_id="string",
    datacenter_id="string")
Copy
const privateLinkResource = new astra.PrivateLink("privateLinkResource", {
    allowedPrincipals: ["string"],
    databaseId: "string",
    datacenterId: "string",
});
Copy
type: astra:PrivateLink
properties:
    allowedPrincipals:
        - string
    databaseId: string
    datacenterId: string
Copy

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

AllowedPrincipals
This property is required.
Changes to this property will trigger replacement.
List<string>
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
DatabaseId
This property is required.
Changes to this property will trigger replacement.
string
Astra database where private link will be enabled.
DatacenterId
This property is required.
Changes to this property will trigger replacement.
string
Astra datacenter in the region where the private link will be created.
AllowedPrincipals
This property is required.
Changes to this property will trigger replacement.
[]string
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
DatabaseId
This property is required.
Changes to this property will trigger replacement.
string
Astra database where private link will be enabled.
DatacenterId
This property is required.
Changes to this property will trigger replacement.
string
Astra datacenter in the region where the private link will be created.
allowedPrincipals
This property is required.
Changes to this property will trigger replacement.
List<String>
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
databaseId
This property is required.
Changes to this property will trigger replacement.
String
Astra database where private link will be enabled.
datacenterId
This property is required.
Changes to this property will trigger replacement.
String
Astra datacenter in the region where the private link will be created.
allowedPrincipals
This property is required.
Changes to this property will trigger replacement.
string[]
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
databaseId
This property is required.
Changes to this property will trigger replacement.
string
Astra database where private link will be enabled.
datacenterId
This property is required.
Changes to this property will trigger replacement.
string
Astra datacenter in the region where the private link will be created.
allowed_principals
This property is required.
Changes to this property will trigger replacement.
Sequence[str]
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
database_id
This property is required.
Changes to this property will trigger replacement.
str
Astra database where private link will be enabled.
datacenter_id
This property is required.
Changes to this property will trigger replacement.
str
Astra datacenter in the region where the private link will be created.
allowedPrincipals
This property is required.
Changes to this property will trigger replacement.
List<String>
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
databaseId
This property is required.
Changes to this property will trigger replacement.
String
Astra database where private link will be enabled.
datacenterId
This property is required.
Changes to this property will trigger replacement.
String
Astra datacenter in the region where the private link will be created.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
ServiceName string
Name of the endpoint service for private link generated by the cloud provider.
Id string
The provider-assigned unique ID for this managed resource.
ServiceName string
Name of the endpoint service for private link generated by the cloud provider.
id String
The provider-assigned unique ID for this managed resource.
serviceName String
Name of the endpoint service for private link generated by the cloud provider.
id string
The provider-assigned unique ID for this managed resource.
serviceName string
Name of the endpoint service for private link generated by the cloud provider.
id str
The provider-assigned unique ID for this managed resource.
service_name str
Name of the endpoint service for private link generated by the cloud provider.
id String
The provider-assigned unique ID for this managed resource.
serviceName String
Name of the endpoint service for private link generated by the cloud provider.

Look up Existing PrivateLink Resource

Get an existing PrivateLink 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?: PrivateLinkState, opts?: CustomResourceOptions): PrivateLink
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allowed_principals: Optional[Sequence[str]] = None,
        database_id: Optional[str] = None,
        datacenter_id: Optional[str] = None,
        service_name: Optional[str] = None) -> PrivateLink
func GetPrivateLink(ctx *Context, name string, id IDInput, state *PrivateLinkState, opts ...ResourceOption) (*PrivateLink, error)
public static PrivateLink Get(string name, Input<string> id, PrivateLinkState? state, CustomResourceOptions? opts = null)
public static PrivateLink get(String name, Output<String> id, PrivateLinkState state, CustomResourceOptions options)
resources:  _:    type: astra:PrivateLink    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:
AllowedPrincipals Changes to this property will trigger replacement. List<string>
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
DatabaseId Changes to this property will trigger replacement. string
Astra database where private link will be enabled.
DatacenterId Changes to this property will trigger replacement. string
Astra datacenter in the region where the private link will be created.
ServiceName string
Name of the endpoint service for private link generated by the cloud provider.
AllowedPrincipals Changes to this property will trigger replacement. []string
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
DatabaseId Changes to this property will trigger replacement. string
Astra database where private link will be enabled.
DatacenterId Changes to this property will trigger replacement. string
Astra datacenter in the region where the private link will be created.
ServiceName string
Name of the endpoint service for private link generated by the cloud provider.
allowedPrincipals Changes to this property will trigger replacement. List<String>
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
databaseId Changes to this property will trigger replacement. String
Astra database where private link will be enabled.
datacenterId Changes to this property will trigger replacement. String
Astra datacenter in the region where the private link will be created.
serviceName String
Name of the endpoint service for private link generated by the cloud provider.
allowedPrincipals Changes to this property will trigger replacement. string[]
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
databaseId Changes to this property will trigger replacement. string
Astra database where private link will be enabled.
datacenterId Changes to this property will trigger replacement. string
Astra datacenter in the region where the private link will be created.
serviceName string
Name of the endpoint service for private link generated by the cloud provider.
allowed_principals Changes to this property will trigger replacement. Sequence[str]
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
database_id Changes to this property will trigger replacement. str
Astra database where private link will be enabled.
datacenter_id Changes to this property will trigger replacement. str
Astra datacenter in the region where the private link will be created.
service_name str
Name of the endpoint service for private link generated by the cloud provider.
allowedPrincipals Changes to this property will trigger replacement. List<String>
List of service principals to apply to the Private Link (i.e. arn:aws:iam::123456789012:role/admin).
databaseId Changes to this property will trigger replacement. String
Astra database where private link will be enabled.
datacenterId Changes to this property will trigger replacement. String
Astra datacenter in the region where the private link will be created.
serviceName String
Name of the endpoint service for private link generated by the cloud provider.

Import

 $ pulumi import astra:index/privateLink:PrivateLink example a6bc9c26-e7ce-424f-84c7-0a00afb12588/datacenter/a6bc9c26-e7ce-424f-84c7-0a00afb12588/serviceNames/svc-name-here
Copy

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

Package Details

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