Content Scanning Expression Args
data class ContentScanningExpressionArgs(val payload: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<ContentScanningExpressionArgs>
Provides a Cloudflare Content Scanning Expression resource for managing custom scan expression within a specific zone.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
// Enable Content Scanning before trying to add custom scan expressions
const example = new cloudflare.ContentScanning("example", {
zoneId: "399c6f4950c01a5a141b99ff7fbcbd8b",
enabled: true,
});
const firstExample = new cloudflare.ContentScanningExpression("first_example", {
zoneId: example.zoneId,
payload: "lookup_json_string(http.request.body.raw, \"file\")",
});
const secondExample = new cloudflare.ContentScanningExpression("second_example", {
zoneId: example.zoneId,
payload: "lookup_json_string(http.request.body.raw, \"document\")",
});
Content copied to clipboard
import pulumi
import pulumi_cloudflare as cloudflare
# Enable Content Scanning before trying to add custom scan expressions
example = cloudflare.ContentScanning("example",
zone_id="399c6f4950c01a5a141b99ff7fbcbd8b",
enabled=True)
first_example = cloudflare.ContentScanningExpression("first_example",
zone_id=example.zone_id,
payload="lookup_json_string(http.request.body.raw, \"file\")")
second_example = cloudflare.ContentScanningExpression("second_example",
zone_id=example.zone_id,
payload="lookup_json_string(http.request.body.raw, \"document\")")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
// Enable Content Scanning before trying to add custom scan expressions
var example = new Cloudflare.ContentScanning("example", new()
{
ZoneId = "399c6f4950c01a5a141b99ff7fbcbd8b",
Enabled = true,
});
var firstExample = new Cloudflare.ContentScanningExpression("first_example", new()
{
ZoneId = example.ZoneId,
Payload = "lookup_json_string(http.request.body.raw, \"file\")",
});
var secondExample = new Cloudflare.ContentScanningExpression("second_example", new()
{
ZoneId = example.ZoneId,
Payload = "lookup_json_string(http.request.body.raw, \"document\")",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Enable Content Scanning before trying to add custom scan expressions
example, err := cloudflare.NewContentScanning(ctx, "example", &cloudflare.ContentScanningArgs{
ZoneId: pulumi.String("399c6f4950c01a5a141b99ff7fbcbd8b"),
Enabled: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = cloudflare.NewContentScanningExpression(ctx, "first_example", &cloudflare.ContentScanningExpressionArgs{
ZoneId: example.ZoneId,
Payload: pulumi.String("lookup_json_string(http.request.body.raw, \"file\")"),
})
if err != nil {
return err
}
_, err = cloudflare.NewContentScanningExpression(ctx, "second_example", &cloudflare.ContentScanningExpressionArgs{
ZoneId: example.ZoneId,
Payload: pulumi.String("lookup_json_string(http.request.body.raw, \"document\")"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.ContentScanning;
import com.pulumi.cloudflare.ContentScanningArgs;
import com.pulumi.cloudflare.ContentScanningExpression;
import com.pulumi.cloudflare.ContentScanningExpressionArgs;
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) {
// Enable Content Scanning before trying to add custom scan expressions
var example = new ContentScanning("example", ContentScanningArgs.builder()
.zoneId("399c6f4950c01a5a141b99ff7fbcbd8b")
.enabled(true)
.build());
var firstExample = new ContentScanningExpression("firstExample", ContentScanningExpressionArgs.builder()
.zoneId(example.zoneId())
.payload("lookup_json_string(http.request.body.raw, \"file\")")
.build());
var secondExample = new ContentScanningExpression("secondExample", ContentScanningExpressionArgs.builder()
.zoneId(example.zoneId())
.payload("lookup_json_string(http.request.body.raw, \"document\")")
.build());
}
}
Content copied to clipboard
resources:
# Enable Content Scanning before trying to add custom scan expressions
example:
type: cloudflare:ContentScanning
properties:
zoneId: 399c6f4950c01a5a141b99ff7fbcbd8b
enabled: true
firstExample:
type: cloudflare:ContentScanningExpression
name: first_example
properties:
zoneId: ${example.zoneId}
payload: lookup_json_string(http.request.body.raw, "file")
secondExample:
type: cloudflare:ContentScanningExpression
name: second_example
properties:
zoneId: ${example.zoneId}
payload: lookup_json_string(http.request.body.raw, "document")
Content copied to clipboard
Import
$ pulumi import cloudflare:index/contentScanningExpression:ContentScanningExpression example <zone_id>/<resource_id>
Content copied to clipboard