1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. ContentScanningExpression
Cloudflare v6.0.0 published on Monday, Apr 14, 2025 by Pulumi

cloudflare.ContentScanningExpression

Explore with Pulumi AI

Example Usage

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

const exampleContentScanningExpression = new cloudflare.ContentScanningExpression("example_content_scanning_expression", {
    zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
    bodies: [{
        payload: "lookup_json_string(http.request.body.raw, \"file\")",
    }],
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_content_scanning_expression = cloudflare.ContentScanningExpression("example_content_scanning_expression",
    zone_id="023e105f4ecef8ad9ca31a8372d0c353",
    bodies=[{
        "payload": "lookup_json_string(http.request.body.raw, \"file\")",
    }])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewContentScanningExpression(ctx, "example_content_scanning_expression", &cloudflare.ContentScanningExpressionArgs{
			ZoneId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
			Bodies: cloudflare.ContentScanningExpressionBodyArray{
				&cloudflare.ContentScanningExpressionBodyArgs{
					Payload: pulumi.String("lookup_json_string(http.request.body.raw, \"file\")"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var exampleContentScanningExpression = new Cloudflare.ContentScanningExpression("example_content_scanning_expression", new()
    {
        ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
        Bodies = new[]
        {
            new Cloudflare.Inputs.ContentScanningExpressionBodyArgs
            {
                Payload = "lookup_json_string(http.request.body.raw, \"file\")",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.ContentScanningExpression;
import com.pulumi.cloudflare.ContentScanningExpressionArgs;
import com.pulumi.cloudflare.inputs.ContentScanningExpressionBodyArgs;
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 exampleContentScanningExpression = new ContentScanningExpression("exampleContentScanningExpression", ContentScanningExpressionArgs.builder()
            .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
            .bodies(ContentScanningExpressionBodyArgs.builder()
                .payload("lookup_json_string(http.request.body.raw, \"file\")")
                .build())
            .build());

    }
}
Copy
resources:
  exampleContentScanningExpression:
    type: cloudflare:ContentScanningExpression
    name: example_content_scanning_expression
    properties:
      zoneId: 023e105f4ecef8ad9ca31a8372d0c353
      bodies:
        - payload: lookup_json_string(http.request.body.raw, "file")
Copy

Create ContentScanningExpression Resource

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

Constructor syntax

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

@overload
def ContentScanningExpression(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              bodies: Optional[Sequence[ContentScanningExpressionBodyArgs]] = None,
                              zone_id: Optional[str] = None)
func NewContentScanningExpression(ctx *Context, name string, args ContentScanningExpressionArgs, opts ...ResourceOption) (*ContentScanningExpression, error)
public ContentScanningExpression(string name, ContentScanningExpressionArgs args, CustomResourceOptions? opts = null)
public ContentScanningExpression(String name, ContentScanningExpressionArgs args)
public ContentScanningExpression(String name, ContentScanningExpressionArgs args, CustomResourceOptions options)
type: cloudflare:ContentScanningExpression
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. ContentScanningExpressionArgs
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. ContentScanningExpressionArgs
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. ContentScanningExpressionArgs
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. ContentScanningExpressionArgs
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. ContentScanningExpressionArgs
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 contentScanningExpressionResource = new Cloudflare.ContentScanningExpression("contentScanningExpressionResource", new()
{
    Bodies = new[]
    {
        new Cloudflare.Inputs.ContentScanningExpressionBodyArgs
        {
            Payload = "string",
        },
    },
    ZoneId = "string",
});
Copy
example, err := cloudflare.NewContentScanningExpression(ctx, "contentScanningExpressionResource", &cloudflare.ContentScanningExpressionArgs{
	Bodies: cloudflare.ContentScanningExpressionBodyArray{
		&cloudflare.ContentScanningExpressionBodyArgs{
			Payload: pulumi.String("string"),
		},
	},
	ZoneId: pulumi.String("string"),
})
Copy
var contentScanningExpressionResource = new ContentScanningExpression("contentScanningExpressionResource", ContentScanningExpressionArgs.builder()
    .bodies(ContentScanningExpressionBodyArgs.builder()
        .payload("string")
        .build())
    .zoneId("string")
    .build());
Copy
content_scanning_expression_resource = cloudflare.ContentScanningExpression("contentScanningExpressionResource",
    bodies=[{
        "payload": "string",
    }],
    zone_id="string")
Copy
const contentScanningExpressionResource = new cloudflare.ContentScanningExpression("contentScanningExpressionResource", {
    bodies: [{
        payload: "string",
    }],
    zoneId: "string",
});
Copy
type: cloudflare:ContentScanningExpression
properties:
    bodies:
        - payload: string
    zoneId: string
Copy

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

Bodies This property is required. List<ContentScanningExpressionBody>
ZoneId This property is required. string
Identifier
Bodies This property is required. []ContentScanningExpressionBodyArgs
ZoneId This property is required. string
Identifier
bodies This property is required. List<ContentScanningExpressionBody>
zoneId This property is required. String
Identifier
bodies This property is required. ContentScanningExpressionBody[]
zoneId This property is required. string
Identifier
bodies This property is required. Sequence[ContentScanningExpressionBodyArgs]
zone_id This property is required. str
Identifier
bodies This property is required. List<Property Map>
zoneId This property is required. String
Identifier

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Payload string
Ruleset expression to use in matching content objects
Id string
The provider-assigned unique ID for this managed resource.
Payload string
Ruleset expression to use in matching content objects
id String
The provider-assigned unique ID for this managed resource.
payload String
Ruleset expression to use in matching content objects
id string
The provider-assigned unique ID for this managed resource.
payload string
Ruleset expression to use in matching content objects
id str
The provider-assigned unique ID for this managed resource.
payload str
Ruleset expression to use in matching content objects
id String
The provider-assigned unique ID for this managed resource.
payload String
Ruleset expression to use in matching content objects

Look up Existing ContentScanningExpression Resource

Get an existing ContentScanningExpression 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?: ContentScanningExpressionState, opts?: CustomResourceOptions): ContentScanningExpression
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bodies: Optional[Sequence[ContentScanningExpressionBodyArgs]] = None,
        payload: Optional[str] = None,
        zone_id: Optional[str] = None) -> ContentScanningExpression
func GetContentScanningExpression(ctx *Context, name string, id IDInput, state *ContentScanningExpressionState, opts ...ResourceOption) (*ContentScanningExpression, error)
public static ContentScanningExpression Get(string name, Input<string> id, ContentScanningExpressionState? state, CustomResourceOptions? opts = null)
public static ContentScanningExpression get(String name, Output<String> id, ContentScanningExpressionState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:ContentScanningExpression    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:
Bodies List<ContentScanningExpressionBody>
Payload string
Ruleset expression to use in matching content objects
ZoneId string
Identifier
Bodies []ContentScanningExpressionBodyArgs
Payload string
Ruleset expression to use in matching content objects
ZoneId string
Identifier
bodies List<ContentScanningExpressionBody>
payload String
Ruleset expression to use in matching content objects
zoneId String
Identifier
bodies ContentScanningExpressionBody[]
payload string
Ruleset expression to use in matching content objects
zoneId string
Identifier
bodies Sequence[ContentScanningExpressionBodyArgs]
payload str
Ruleset expression to use in matching content objects
zone_id str
Identifier
bodies List<Property Map>
payload String
Ruleset expression to use in matching content objects
zoneId String
Identifier

Supporting Types

ContentScanningExpressionBody
, ContentScanningExpressionBodyArgs

Payload This property is required. string
Ruleset expression to use in matching content objects
Payload This property is required. string
Ruleset expression to use in matching content objects
payload This property is required. String
Ruleset expression to use in matching content objects
payload This property is required. string
Ruleset expression to use in matching content objects
payload This property is required. str
Ruleset expression to use in matching content objects
payload This property is required. String
Ruleset expression to use in matching content objects

Package Details

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