1. Packages
  2. Datadog Provider
  3. API Docs
  4. IpAllowlist
Datadog v4.48.1 published on Saturday, Apr 5, 2025 by Pulumi

datadog.IpAllowlist

Explore with Pulumi AI

Provides the Datadog IP allowlist resource. This can be used to manage the Datadog IP allowlist

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

const example = new datadog.IpAllowlist("example", {
    enabled: false,
    entries: [
        {
            cidrBlock: "127.0.0.0/32",
            note: "1st Example IP Range",
        },
        {
            cidrBlock: "192.0.2.0/24",
            note: "2nd Example IP Range",
        },
    ],
});
Copy
import pulumi
import pulumi_datadog as datadog

example = datadog.IpAllowlist("example",
    enabled=False,
    entries=[
        {
            "cidr_block": "127.0.0.0/32",
            "note": "1st Example IP Range",
        },
        {
            "cidr_block": "192.0.2.0/24",
            "note": "2nd Example IP Range",
        },
    ])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datadog.NewIpAllowlist(ctx, "example", &datadog.IpAllowlistArgs{
			Enabled: pulumi.Bool(false),
			Entries: datadog.IpAllowlistEntryArray{
				&datadog.IpAllowlistEntryArgs{
					CidrBlock: pulumi.String("127.0.0.0/32"),
					Note:      pulumi.String("1st Example IP Range"),
				},
				&datadog.IpAllowlistEntryArgs{
					CidrBlock: pulumi.String("192.0.2.0/24"),
					Note:      pulumi.String("2nd Example IP Range"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;

return await Deployment.RunAsync(() => 
{
    var example = new Datadog.IpAllowlist("example", new()
    {
        Enabled = false,
        Entries = new[]
        {
            new Datadog.Inputs.IpAllowlistEntryArgs
            {
                CidrBlock = "127.0.0.0/32",
                Note = "1st Example IP Range",
            },
            new Datadog.Inputs.IpAllowlistEntryArgs
            {
                CidrBlock = "192.0.2.0/24",
                Note = "2nd Example IP Range",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.datadog.IpAllowlist;
import com.pulumi.datadog.IpAllowlistArgs;
import com.pulumi.datadog.inputs.IpAllowlistEntryArgs;
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 IpAllowlist("example", IpAllowlistArgs.builder()
            .enabled(false)
            .entries(            
                IpAllowlistEntryArgs.builder()
                    .cidrBlock("127.0.0.0/32")
                    .note("1st Example IP Range")
                    .build(),
                IpAllowlistEntryArgs.builder()
                    .cidrBlock("192.0.2.0/24")
                    .note("2nd Example IP Range")
                    .build())
            .build());

    }
}
Copy
resources:
  example:
    type: datadog:IpAllowlist
    properties:
      enabled: false
      entries:
        - cidrBlock: 127.0.0.0/32
          note: 1st Example IP Range
        - cidrBlock: 192.0.2.0/24
          note: 2nd Example IP Range
Copy

Create IpAllowlist Resource

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

Constructor syntax

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

@overload
def IpAllowlist(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                enabled: Optional[bool] = None,
                entries: Optional[Sequence[IpAllowlistEntryArgs]] = None)
func NewIpAllowlist(ctx *Context, name string, args IpAllowlistArgs, opts ...ResourceOption) (*IpAllowlist, error)
public IpAllowlist(string name, IpAllowlistArgs args, CustomResourceOptions? opts = null)
public IpAllowlist(String name, IpAllowlistArgs args)
public IpAllowlist(String name, IpAllowlistArgs args, CustomResourceOptions options)
type: datadog:IpAllowlist
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. IpAllowlistArgs
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. IpAllowlistArgs
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. IpAllowlistArgs
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. IpAllowlistArgs
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. IpAllowlistArgs
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 ipAllowlistResource = new Datadog.IpAllowlist("ipAllowlistResource", new()
{
    Enabled = false,
    Entries = new[]
    {
        new Datadog.Inputs.IpAllowlistEntryArgs
        {
            CidrBlock = "string",
            Note = "string",
        },
    },
});
Copy
example, err := datadog.NewIpAllowlist(ctx, "ipAllowlistResource", &datadog.IpAllowlistArgs{
	Enabled: pulumi.Bool(false),
	Entries: datadog.IpAllowlistEntryArray{
		&datadog.IpAllowlistEntryArgs{
			CidrBlock: pulumi.String("string"),
			Note:      pulumi.String("string"),
		},
	},
})
Copy
var ipAllowlistResource = new IpAllowlist("ipAllowlistResource", IpAllowlistArgs.builder()
    .enabled(false)
    .entries(IpAllowlistEntryArgs.builder()
        .cidrBlock("string")
        .note("string")
        .build())
    .build());
Copy
ip_allowlist_resource = datadog.IpAllowlist("ipAllowlistResource",
    enabled=False,
    entries=[{
        "cidr_block": "string",
        "note": "string",
    }])
Copy
const ipAllowlistResource = new datadog.IpAllowlist("ipAllowlistResource", {
    enabled: false,
    entries: [{
        cidrBlock: "string",
        note: "string",
    }],
});
Copy
type: datadog:IpAllowlist
properties:
    enabled: false
    entries:
        - cidrBlock: string
          note: string
Copy

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

Enabled This property is required. bool
Whether the IP Allowlist is enabled.
Entries List<IpAllowlistEntry>
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
Enabled This property is required. bool
Whether the IP Allowlist is enabled.
Entries []IpAllowlistEntryArgs
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
enabled This property is required. Boolean
Whether the IP Allowlist is enabled.
entries List<IpAllowlistEntry>
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
enabled This property is required. boolean
Whether the IP Allowlist is enabled.
entries IpAllowlistEntry[]
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
enabled This property is required. bool
Whether the IP Allowlist is enabled.
entries Sequence[IpAllowlistEntryArgs]
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
enabled This property is required. Boolean
Whether the IP Allowlist is enabled.
entries List<Property Map>
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.

Outputs

All input properties are implicitly available as output properties. Additionally, the IpAllowlist 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 IpAllowlist Resource

Get an existing IpAllowlist 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?: IpAllowlistState, opts?: CustomResourceOptions): IpAllowlist
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enabled: Optional[bool] = None,
        entries: Optional[Sequence[IpAllowlistEntryArgs]] = None) -> IpAllowlist
func GetIpAllowlist(ctx *Context, name string, id IDInput, state *IpAllowlistState, opts ...ResourceOption) (*IpAllowlist, error)
public static IpAllowlist Get(string name, Input<string> id, IpAllowlistState? state, CustomResourceOptions? opts = null)
public static IpAllowlist get(String name, Output<String> id, IpAllowlistState state, CustomResourceOptions options)
resources:  _:    type: datadog:IpAllowlist    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:
Enabled bool
Whether the IP Allowlist is enabled.
Entries List<IpAllowlistEntry>
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
Enabled bool
Whether the IP Allowlist is enabled.
Entries []IpAllowlistEntryArgs
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
enabled Boolean
Whether the IP Allowlist is enabled.
entries List<IpAllowlistEntry>
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
enabled boolean
Whether the IP Allowlist is enabled.
entries IpAllowlistEntry[]
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
enabled bool
Whether the IP Allowlist is enabled.
entries Sequence[IpAllowlistEntryArgs]
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.
enabled Boolean
Whether the IP Allowlist is enabled.
entries List<Property Map>
Set of objects containing an IP address or range of IP addresses in the allowlist and an accompanying note.

Supporting Types

IpAllowlistEntry
, IpAllowlistEntryArgs

CidrBlock This property is required. string
IP address or range of addresses. String must be a valid CIDR block or IP address.
Note string
Note accompanying IP address.
CidrBlock This property is required. string
IP address or range of addresses. String must be a valid CIDR block or IP address.
Note string
Note accompanying IP address.
cidrBlock This property is required. String
IP address or range of addresses. String must be a valid CIDR block or IP address.
note String
Note accompanying IP address.
cidrBlock This property is required. string
IP address or range of addresses. String must be a valid CIDR block or IP address.
note string
Note accompanying IP address.
cidr_block This property is required. str
IP address or range of addresses. String must be a valid CIDR block or IP address.
note str
Note accompanying IP address.
cidrBlock This property is required. String
IP address or range of addresses. String must be a valid CIDR block or IP address.
note String
Note accompanying IP address.

Package Details

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