Provides a Datadog RumRetentionFiltersOrder resource. This is used to manage the order of Datadog RUM retention filters. Please note that retention_filter_ids should contain all IDs of retention filters, including the default ones created internally for a given RUM application.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
import * as std from "@pulumi/std";
// Create a new rum_application resource.
const myRumApplication = new datadog.RumApplication("my_rum_application", {
name: "my-rum-application-test",
type: "browser",
});
// Retrieve rum_retention_filters for the rum_application created above.
const myRetentionFilters = datadog.getRumRetentionFilters({
applicationId: datadogRumApplication.myRumApplication.id,
});
// Create a new rum_retention_filter resource.
const newRumRetentionFilter = new datadog.RumRetentionFilter("new_rum_retention_filter", {
applicationId: datadogRumApplication.myRumApplication.id,
name: "testing.rum.retention_filter",
eventType: "action",
sampleRate: 60,
query: "@session.has_replay:true",
enabled: true,
});
// Create a new rum_retention_filters_order resource for reordering.
// Please note that the IDs of all default retention filters have the prefix 'default', and you need to populate the retention_filter_ids field with all retention filter IDs.
const myRumRetentionFiltersOrder = new datadog.RumRetentionFiltersOrder("my_rum_retention_filters_order", {
applicationId: datadogRumApplication.myRumApplication.id,
retentionFilterIds: std.index.concat({
input: [
myRetentionFilters.then(myRetentionFilters => .filter(rf => std.index.startswith({
input: rf.id,
prefix: "default",
}).result).map(rf => (rf.id))),
[newRumRetentionFilter.id],
pulumi.all([myRetentionFilters, newRumRetentionFilter.id]).apply(([myRetentionFilters, id]) => .filter(rf => !std.index.startswith({
input: rf.id,
prefix: "default",
}).result && rf.id != id).map(rf => (rf.id))),
],
}).result,
});
import pulumi
import pulumi_datadog as datadog
import pulumi_std as std
# Create a new rum_application resource.
my_rum_application = datadog.RumApplication("my_rum_application",
name="my-rum-application-test",
type="browser")
# Retrieve rum_retention_filters for the rum_application created above.
my_retention_filters = datadog.get_rum_retention_filters(application_id=datadog_rum_application["myRumApplication"]["id"])
# Create a new rum_retention_filter resource.
new_rum_retention_filter = datadog.RumRetentionFilter("new_rum_retention_filter",
application_id=datadog_rum_application["myRumApplication"]["id"],
name="testing.rum.retention_filter",
event_type="action",
sample_rate=60,
query="@session.has_replay:true",
enabled=True)
# Create a new rum_retention_filters_order resource for reordering.
# Please note that the IDs of all default retention filters have the prefix 'default', and you need to populate the retention_filter_ids field with all retention filter IDs.
my_rum_retention_filters_order = datadog.RumRetentionFiltersOrder("my_rum_retention_filters_order",
application_id=datadog_rum_application["myRumApplication"]["id"],
retention_filter_ids=std.index.concat(input=[
[rf.id for rf in my_retention_filters.retention_filters if std.index.startswith(input=rf.id,
prefix="default")["result"]],
[new_rum_retention_filter.id],
[rf.id for rf in my_retention_filters.retention_filters if not std.index.startswith(input=rf.id,
prefix="default")["result"] and rf.id != _arg0_],
])["result"])
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
// Create a new rum_application resource.
var myRumApplication = new Datadog.RumApplication("my_rum_application", new()
{
Name = "my-rum-application-test",
Type = "browser",
});
// Retrieve rum_retention_filters for the rum_application created above.
var myRetentionFilters = Datadog.GetRumRetentionFilters.Invoke(new()
{
ApplicationId = datadogRumApplication.MyRumApplication.Id,
});
// Create a new rum_retention_filter resource.
var newRumRetentionFilter = new Datadog.RumRetentionFilter("new_rum_retention_filter", new()
{
ApplicationId = datadogRumApplication.MyRumApplication.Id,
Name = "testing.rum.retention_filter",
EventType = "action",
SampleRate = 60,
Query = "@session.has_replay:true",
Enabled = true,
});
// Create a new rum_retention_filters_order resource for reordering.
// Please note that the IDs of all default retention filters have the prefix 'default', and you need to populate the retention_filter_ids field with all retention filter IDs.
var myRumRetentionFiltersOrder = new Datadog.RumRetentionFiltersOrder("my_rum_retention_filters_order", new()
{
ApplicationId = datadogRumApplication.MyRumApplication.Id,
RetentionFilterIds = Std.Index.Concat.Invoke(new()
{
Input = new[]
{
.Where(rf => Std.Index.Startswith.Invoke(new()
{
Input = rf.Id,
Prefix = "default",
}).Result).Select(rf =>
{
return rf.Id;
}).ToList(),
new[]
{
newRumRetentionFilter.Id,
},
Output.Tuple(myRetentionFilters, newRumRetentionFilter.Id).Apply(values =>
{
var myRetentionFilters = values.Item1;
var id = values.Item2;
return .Where(rf => !Std.Index.Startswith.Invoke(new()
{
Input = rf.Id,
Prefix = "default",
}).Result && rf.Id != id).Select(rf =>
{
return rf.Id;
}).ToList();
}),
},
}).Result,
});
});
Example coming soon!
Example coming soon!
Create RumRetentionFiltersOrder Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RumRetentionFiltersOrder(name: string, args: RumRetentionFiltersOrderArgs, opts?: CustomResourceOptions);@overload
def RumRetentionFiltersOrder(resource_name: str,
args: RumRetentionFiltersOrderArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RumRetentionFiltersOrder(resource_name: str,
opts: Optional[ResourceOptions] = None,
application_id: Optional[str] = None,
retention_filter_ids: Optional[Sequence[str]] = None)func NewRumRetentionFiltersOrder(ctx *Context, name string, args RumRetentionFiltersOrderArgs, opts ...ResourceOption) (*RumRetentionFiltersOrder, error)public RumRetentionFiltersOrder(string name, RumRetentionFiltersOrderArgs args, CustomResourceOptions? opts = null)
public RumRetentionFiltersOrder(String name, RumRetentionFiltersOrderArgs args)
public RumRetentionFiltersOrder(String name, RumRetentionFiltersOrderArgs args, CustomResourceOptions options)
type: datadog:RumRetentionFiltersOrder
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 RumRetentionFiltersOrderArgs
- 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 RumRetentionFiltersOrderArgs
- 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 RumRetentionFiltersOrderArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RumRetentionFiltersOrderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RumRetentionFiltersOrderArgs
- 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 rumRetentionFiltersOrderResource = new Datadog.RumRetentionFiltersOrder("rumRetentionFiltersOrderResource", new()
{
ApplicationId = "string",
RetentionFilterIds = new[]
{
"string",
},
});
example, err := datadog.NewRumRetentionFiltersOrder(ctx, "rumRetentionFiltersOrderResource", &datadog.RumRetentionFiltersOrderArgs{
ApplicationId: pulumi.String("string"),
RetentionFilterIds: pulumi.StringArray{
pulumi.String("string"),
},
})
var rumRetentionFiltersOrderResource = new RumRetentionFiltersOrder("rumRetentionFiltersOrderResource", RumRetentionFiltersOrderArgs.builder()
.applicationId("string")
.retentionFilterIds("string")
.build());
rum_retention_filters_order_resource = datadog.RumRetentionFiltersOrder("rumRetentionFiltersOrderResource",
application_id="string",
retention_filter_ids=["string"])
const rumRetentionFiltersOrderResource = new datadog.RumRetentionFiltersOrder("rumRetentionFiltersOrderResource", {
applicationId: "string",
retentionFilterIds: ["string"],
});
type: datadog:RumRetentionFiltersOrder
properties:
applicationId: string
retentionFilterIds:
- string
RumRetentionFiltersOrder 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 RumRetentionFiltersOrder resource accepts the following input properties:
- Application
Id string - RUM application ID.
- Retention
Filter List<string>Ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- Application
Id string - RUM application ID.
- Retention
Filter []stringIds - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- application
Id String - RUM application ID.
- retention
Filter List<String>Ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- application
Id string - RUM application ID.
- retention
Filter string[]Ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- application_
id str - RUM application ID.
- retention_
filter_ Sequence[str]ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- application
Id String - RUM application ID.
- retention
Filter List<String>Ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
Outputs
All input properties are implicitly available as output properties. Additionally, the RumRetentionFiltersOrder 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 RumRetentionFiltersOrder Resource
Get an existing RumRetentionFiltersOrder 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?: RumRetentionFiltersOrderState, opts?: CustomResourceOptions): RumRetentionFiltersOrder@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
application_id: Optional[str] = None,
retention_filter_ids: Optional[Sequence[str]] = None) -> RumRetentionFiltersOrderfunc GetRumRetentionFiltersOrder(ctx *Context, name string, id IDInput, state *RumRetentionFiltersOrderState, opts ...ResourceOption) (*RumRetentionFiltersOrder, error)public static RumRetentionFiltersOrder Get(string name, Input<string> id, RumRetentionFiltersOrderState? state, CustomResourceOptions? opts = null)public static RumRetentionFiltersOrder get(String name, Output<String> id, RumRetentionFiltersOrderState state, CustomResourceOptions options)resources: _: type: datadog:RumRetentionFiltersOrder get: id: ${id}- 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.
- Application
Id string - RUM application ID.
- Retention
Filter List<string>Ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- Application
Id string - RUM application ID.
- Retention
Filter []stringIds - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- application
Id String - RUM application ID.
- retention
Filter List<String>Ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- application
Id string - RUM application ID.
- retention
Filter string[]Ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- application_
id str - RUM application ID.
- retention_
filter_ Sequence[str]ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
- application
Id String - RUM application ID.
- retention
Filter List<String>Ids - RUM retention filter ID list. The order of IDs in this attribute defines the order of RUM retention filters.
Import
The pulumi import command can be used, for example:
$ pulumi import datadog:index/rumRetentionFiltersOrder:RumRetentionFiltersOrder testing_rum_retention_filters_order "<application_id>"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Datadog pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
datadogTerraform Provider.
