1. Packages
  2. MongoDB Atlas
  3. API Docs
  4. AccessListApiKey
MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 by Pulumi

mongodbatlas.AccessListApiKey

Explore with Pulumi AI

mongodbatlas logo
MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 by Pulumi

    Example Usage

    Using CIDR Block

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const test = new mongodbatlas.AccessListApiKey("test", {
        orgId: "<ORG-ID>",
        cidrBlock: "1.2.3.4/32",
        apiKeyId: "a29120e123cd",
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    test = mongodbatlas.AccessListApiKey("test",
        org_id="<ORG-ID>",
        cidr_block="1.2.3.4/32",
        api_key_id="a29120e123cd")
    
    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{
    			OrgId:     pulumi.String("<ORG-ID>"),
    			CidrBlock: pulumi.String("1.2.3.4/32"),
    			ApiKeyId:  pulumi.String("a29120e123cd"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Mongodbatlas.AccessListApiKey("test", new()
        {
            OrgId = "<ORG-ID>",
            CidrBlock = "1.2.3.4/32",
            ApiKeyId = "a29120e123cd",
        });
    
    });
    
    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()
                .orgId("<ORG-ID>")
                .cidrBlock("1.2.3.4/32")
                .apiKeyId("a29120e123cd")
                .build());
    
        }
    }
    
    resources:
      test:
        type: mongodbatlas:AccessListApiKey
        properties:
          orgId: <ORG-ID>
          cidrBlock: 1.2.3.4/32
          apiKeyId: a29120e123cd
    

    Using IP Address

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const test = new mongodbatlas.AccessListApiKey("test", {
        orgId: "<ORG-ID>",
        ipAddress: "2.3.4.5",
        apiKeyId: "a29120e123cd",
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    test = mongodbatlas.AccessListApiKey("test",
        org_id="<ORG-ID>",
        ip_address="2.3.4.5",
        api_key_id="a29120e123cd")
    
    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{
    			OrgId:     pulumi.String("<ORG-ID>"),
    			IpAddress: pulumi.String("2.3.4.5"),
    			ApiKeyId:  pulumi.String("a29120e123cd"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Mongodbatlas.AccessListApiKey("test", new()
        {
            OrgId = "<ORG-ID>",
            IpAddress = "2.3.4.5",
            ApiKeyId = "a29120e123cd",
        });
    
    });
    
    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()
                .orgId("<ORG-ID>")
                .ipAddress("2.3.4.5")
                .apiKeyId("a29120e123cd")
                .build());
    
        }
    }
    
    resources:
      test:
        type: mongodbatlas:AccessListApiKey
        properties:
          orgId: <ORG-ID>
          ipAddress: 2.3.4.5
          apiKeyId: a29120e123cd
    

    Create AccessListApiKey Resource

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

    Constructor syntax

    new AccessListApiKey(name: string, args: AccessListApiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def AccessListApiKey(resource_name: str,
                         args: AccessListApiKeyArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccessListApiKey(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         api_key_id: Optional[str] = None,
                         org_id: Optional[str] = None,
                         cidr_block: Optional[str] = None,
                         ip_address: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var accessListApiKeyResource = new Mongodbatlas.AccessListApiKey("accessListApiKeyResource", new()
    {
        ApiKeyId = "string",
        OrgId = "string",
        CidrBlock = "string",
        IpAddress = "string",
    });
    
    example, err := mongodbatlas.NewAccessListApiKey(ctx, "accessListApiKeyResource", &mongodbatlas.AccessListApiKeyArgs{
    	ApiKeyId:  pulumi.String("string"),
    	OrgId:     pulumi.String("string"),
    	CidrBlock: pulumi.String("string"),
    	IpAddress: pulumi.String("string"),
    })
    
    var accessListApiKeyResource = new AccessListApiKey("accessListApiKeyResource", AccessListApiKeyArgs.builder()
        .apiKeyId("string")
        .orgId("string")
        .cidrBlock("string")
        .ipAddress("string")
        .build());
    
    access_list_api_key_resource = mongodbatlas.AccessListApiKey("accessListApiKeyResource",
        api_key_id="string",
        org_id="string",
        cidr_block="string",
        ip_address="string")
    
    const accessListApiKeyResource = new mongodbatlas.AccessListApiKey("accessListApiKeyResource", {
        apiKeyId: "string",
        orgId: "string",
        cidrBlock: "string",
        ipAddress: "string",
    });
    
    type: mongodbatlas:AccessListApiKey
    properties:
        apiKeyId: string
        cidrBlock: string
        ipAddress: string
        orgId: string
    

    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.

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    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.

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    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.

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    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.

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    orgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    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.

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    org_id str
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    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.

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    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.

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    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 24-hexadecimal digit string that identifies the organization that contains your projects.
    ApiKeyId string

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

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    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 24-hexadecimal digit string that identifies the organization that contains your projects.
    apiKeyId String

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

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    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 24-hexadecimal digit string that identifies the organization that contains your projects.
    apiKeyId string

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

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    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 24-hexadecimal digit string that identifies the organization that contains your projects.
    api_key_id str

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

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    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 24-hexadecimal digit string that identifies the organization that contains your projects.
    apiKeyId String

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

    NOTE: One of the following attributes must set: cidr_block or ip_address but not both.

    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 24-hexadecimal digit string that identifies the organization that contains your projects.

    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 see: MongoDB Atlas API Reference.

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

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo
    MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 by Pulumi