mongodbatlas logo
MongoDB Atlas v3.7.1, Mar 10 23

mongodbatlas.AccessListApiKey

Import

IP Access List entries can be imported using the org_id , api_key_id and cidr_block or ip_address, e.g.

 $ pulumi import mongodbatlas:index/accessListApiKey:AccessListApiKey test 5d0f1f74cf09a29120e123cd-a29120e123cd-10.242.88.0/21

For more information seeMongoDB Atlas API Reference.

Example Usage

Using CIDR Block

using System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = new Mongodbatlas.AccessListApiKey("test", new()
    {
        ApiKeyId = "a29120e123cd",
        CidrBlock = "1.2.3.4/32",
        OrgId = "<ORG-ID>",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := mongodbatlas.NewAccessListApiKey(ctx, "test", &mongodbatlas.AccessListApiKeyArgs{
			ApiKeyId:  pulumi.String("a29120e123cd"),
			CidrBlock: pulumi.String("1.2.3.4/32"),
			OrgId:     pulumi.String("<ORG-ID>"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.AccessListApiKey;
import com.pulumi.mongodbatlas.AccessListApiKeyArgs;
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 test = new AccessListApiKey("test", AccessListApiKeyArgs.builder()        
            .apiKeyId("a29120e123cd")
            .cidrBlock("1.2.3.4/32")
            .orgId("<ORG-ID>")
            .build());

    }
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.AccessListApiKey("test",
    api_key_id="a29120e123cd",
    cidr_block="1.2.3.4/32",
    org_id="<ORG-ID>")
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.AccessListApiKey("test", {
    apiKeyId: "a29120e123cd",
    cidrBlock: "1.2.3.4/32",
    orgId: "<ORG-ID>",
});
resources:
  test:
    type: mongodbatlas:AccessListApiKey
    properties:
      apiKeyId: a29120e123cd
      cidrBlock: 1.2.3.4/32
      orgId: <ORG-ID>

Using IP Address

using System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = new Mongodbatlas.AccessListApiKey("test", new()
    {
        ApiKeyId = "a29120e123cd",
        IpAddress = "2.3.4.5",
        OrgId = "<ORG-ID>",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := mongodbatlas.NewAccessListApiKey(ctx, "test", &mongodbatlas.AccessListApiKeyArgs{
			ApiKeyId:  pulumi.String("a29120e123cd"),
			IpAddress: pulumi.String("2.3.4.5"),
			OrgId:     pulumi.String("<ORG-ID>"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.AccessListApiKey;
import com.pulumi.mongodbatlas.AccessListApiKeyArgs;
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 test = new AccessListApiKey("test", AccessListApiKeyArgs.builder()        
            .apiKeyId("a29120e123cd")
            .ipAddress("2.3.4.5")
            .orgId("<ORG-ID>")
            .build());

    }
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.AccessListApiKey("test",
    api_key_id="a29120e123cd",
    ip_address="2.3.4.5",
    org_id="<ORG-ID>")
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.AccessListApiKey("test", {
    apiKeyId: "a29120e123cd",
    ipAddress: "2.3.4.5",
    orgId: "<ORG-ID>",
});
resources:
  test:
    type: mongodbatlas:AccessListApiKey
    properties:
      apiKeyId: a29120e123cd
      ipAddress: 2.3.4.5
      orgId: <ORG-ID>

Create AccessListApiKey Resource

new AccessListApiKey(name: string, args: AccessListApiKeyArgs, opts?: CustomResourceOptions);
@overload
def AccessListApiKey(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     api_key_id: Optional[str] = None,
                     cidr_block: Optional[str] = None,
                     ip_address: Optional[str] = None,
                     org_id: Optional[str] = None)
@overload
def AccessListApiKey(resource_name: str,
                     args: AccessListApiKeyArgs,
                     opts: Optional[ResourceOptions] = None)
func NewAccessListApiKey(ctx *Context, name string, args AccessListApiKeyArgs, opts ...ResourceOption) (*AccessListApiKey, error)
public AccessListApiKey(string name, AccessListApiKeyArgs args, CustomResourceOptions? opts = null)
public AccessListApiKey(String name, AccessListApiKeyArgs args)
public AccessListApiKey(String name, AccessListApiKeyArgs args, CustomResourceOptions options)
type: mongodbatlas:AccessListApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AccessListApiKeyArgs
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 AccessListApiKeyArgs
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 AccessListApiKeyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AccessListApiKeyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AccessListApiKeyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AccessListApiKey Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AccessListApiKey resource accepts the following input properties:

ApiKeyId string

Unique identifier for the Organization API Key for which you want to create a new access list entry.

OrgId string

Unique identifier for the organinzation to which you want to add one or more access list entries.

CidrBlock string

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

IpAddress string

Single IP address to be added to the access list.

ApiKeyId string

Unique identifier for the Organization API Key for which you want to create a new access list entry.

OrgId string

Unique identifier for the organinzation to which you want to add one or more access list entries.

CidrBlock string

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

IpAddress string

Single IP address to be added to the access list.

apiKeyId String

Unique identifier for the Organization API Key for which you want to create a new access list entry.

orgId String

Unique identifier for the organinzation to which you want to add one or more access list entries.

cidrBlock String

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

ipAddress String

Single IP address to be added to the access list.

apiKeyId string

Unique identifier for the Organization API Key for which you want to create a new access list entry.

orgId string

Unique identifier for the organinzation to which you want to add one or more access list entries.

cidrBlock string

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

ipAddress string

Single IP address to be added to the access list.

api_key_id str

Unique identifier for the Organization API Key for which you want to create a new access list entry.

org_id str

Unique identifier for the organinzation to which you want to add one or more access list entries.

cidr_block str

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

ip_address str

Single IP address to be added to the access list.

apiKeyId String

Unique identifier for the Organization API Key for which you want to create a new access list entry.

orgId String

Unique identifier for the organinzation to which you want to add one or more access list entries.

cidrBlock String

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

ipAddress String

Single IP address to be added to the access list.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing AccessListApiKey Resource

Get an existing AccessListApiKey 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?: AccessListApiKeyState, opts?: CustomResourceOptions): AccessListApiKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_key_id: Optional[str] = None,
        cidr_block: Optional[str] = None,
        ip_address: Optional[str] = None,
        org_id: Optional[str] = None) -> AccessListApiKey
func GetAccessListApiKey(ctx *Context, name string, id IDInput, state *AccessListApiKeyState, opts ...ResourceOption) (*AccessListApiKey, error)
public static AccessListApiKey Get(string name, Input<string> id, AccessListApiKeyState? state, CustomResourceOptions? opts = null)
public static AccessListApiKey get(String name, Output<String> id, AccessListApiKeyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
ApiKeyId string

Unique identifier for the Organization API Key for which you want to create a new access list entry.

CidrBlock string

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

IpAddress string

Single IP address to be added to the access list.

OrgId string

Unique identifier for the organinzation to which you want to add one or more access list entries.

ApiKeyId string

Unique identifier for the Organization API Key for which you want to create a new access list entry.

CidrBlock string

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

IpAddress string

Single IP address to be added to the access list.

OrgId string

Unique identifier for the organinzation to which you want to add one or more access list entries.

apiKeyId String

Unique identifier for the Organization API Key for which you want to create a new access list entry.

cidrBlock String

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

ipAddress String

Single IP address to be added to the access list.

orgId String

Unique identifier for the organinzation to which you want to add one or more access list entries.

apiKeyId string

Unique identifier for the Organization API Key for which you want to create a new access list entry.

cidrBlock string

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

ipAddress string

Single IP address to be added to the access list.

orgId string

Unique identifier for the organinzation to which you want to add one or more access list entries.

api_key_id str

Unique identifier for the Organization API Key for which you want to create a new access list entry.

cidr_block str

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

ip_address str

Single IP address to be added to the access list.

org_id str

Unique identifier for the organinzation to which you want to add one or more access list entries.

apiKeyId String

Unique identifier for the Organization API Key for which you want to create a new access list entry.

cidrBlock String

Range of IP addresses in CIDR notation to be added to the access list. Your access list entry can include only one cidrBlock, or one ipAddress.

ipAddress String

Single IP address to be added to the access list.

orgId String

Unique identifier for the organinzation to which you want to add one or more access list entries.

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes

This Pulumi package is based on the mongodbatlas Terraform Provider.