cloudflare logo
Cloudflare v5.0.0, Mar 13 23

cloudflare.ManagedHeaders

Import

Import is not supported for this resource.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    // Enable security headers using Managed Meaders
    var example = new Cloudflare.ManagedHeaders("example", new()
    {
        ManagedRequestHeaders = new[]
        {
            new Cloudflare.Inputs.ManagedHeadersManagedRequestHeaderArgs
            {
                Enabled = true,
                Id = "add_true_client_ip_headers",
            },
        },
        ManagedResponseHeaders = new[]
        {
            new Cloudflare.Inputs.ManagedHeadersManagedResponseHeaderArgs
            {
                Enabled = true,
                Id = "remove_x-powered-by_header",
            },
        },
        ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
    });

});
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 {
		_, err := cloudflare.NewManagedHeaders(ctx, "example", &cloudflare.ManagedHeadersArgs{
			ManagedRequestHeaders: cloudflare.ManagedHeadersManagedRequestHeaderArray{
				&cloudflare.ManagedHeadersManagedRequestHeaderArgs{
					Enabled: pulumi.Bool(true),
					Id:      pulumi.String("add_true_client_ip_headers"),
				},
			},
			ManagedResponseHeaders: cloudflare.ManagedHeadersManagedResponseHeaderArray{
				&cloudflare.ManagedHeadersManagedResponseHeaderArgs{
					Enabled: pulumi.Bool(true),
					Id:      pulumi.String("remove_x-powered-by_header"),
				},
			},
			ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.ManagedHeaders;
import com.pulumi.cloudflare.ManagedHeadersArgs;
import com.pulumi.cloudflare.inputs.ManagedHeadersManagedRequestHeaderArgs;
import com.pulumi.cloudflare.inputs.ManagedHeadersManagedResponseHeaderArgs;
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 ManagedHeaders("example", ManagedHeadersArgs.builder()        
            .managedRequestHeaders(ManagedHeadersManagedRequestHeaderArgs.builder()
                .enabled(true)
                .id("add_true_client_ip_headers")
                .build())
            .managedResponseHeaders(ManagedHeadersManagedResponseHeaderArgs.builder()
                .enabled(true)
                .id("remove_x-powered-by_header")
                .build())
            .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
            .build());

    }
}
import pulumi
import pulumi_cloudflare as cloudflare

# Enable security headers using Managed Meaders
example = cloudflare.ManagedHeaders("example",
    managed_request_headers=[cloudflare.ManagedHeadersManagedRequestHeaderArgs(
        enabled=True,
        id="add_true_client_ip_headers",
    )],
    managed_response_headers=[cloudflare.ManagedHeadersManagedResponseHeaderArgs(
        enabled=True,
        id="remove_x-powered-by_header",
    )],
    zone_id="0da42c8d2132a9ddaf714f9e7c920711")
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

// Enable security headers using Managed Meaders
const example = new cloudflare.ManagedHeaders("example", {
    managedRequestHeaders: [{
        enabled: true,
        id: "add_true_client_ip_headers",
    }],
    managedResponseHeaders: [{
        enabled: true,
        id: "remove_x-powered-by_header",
    }],
    zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
});
resources:
  # Enable security headers using Managed Meaders
  example:
    type: cloudflare:ManagedHeaders
    properties:
      managedRequestHeaders:
        - enabled: true
          id: add_true_client_ip_headers
      managedResponseHeaders:
        - enabled: true
          id: remove_x-powered-by_header
      zoneId: 0da42c8d2132a9ddaf714f9e7c920711

Create ManagedHeaders Resource

new ManagedHeaders(name: string, args: ManagedHeadersArgs, opts?: CustomResourceOptions);
@overload
def ManagedHeaders(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   managed_request_headers: Optional[Sequence[ManagedHeadersManagedRequestHeaderArgs]] = None,
                   managed_response_headers: Optional[Sequence[ManagedHeadersManagedResponseHeaderArgs]] = None,
                   zone_id: Optional[str] = None)
@overload
def ManagedHeaders(resource_name: str,
                   args: ManagedHeadersArgs,
                   opts: Optional[ResourceOptions] = None)
func NewManagedHeaders(ctx *Context, name string, args ManagedHeadersArgs, opts ...ResourceOption) (*ManagedHeaders, error)
public ManagedHeaders(string name, ManagedHeadersArgs args, CustomResourceOptions? opts = null)
public ManagedHeaders(String name, ManagedHeadersArgs args)
public ManagedHeaders(String name, ManagedHeadersArgs args, CustomResourceOptions options)
type: cloudflare:ManagedHeaders
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ManagedHeadersArgs
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 ManagedHeadersArgs
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 ManagedHeadersArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ManagedHeadersArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ManagedHeadersArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

ZoneId string

The zone identifier to target for the resource.

ManagedRequestHeaders List<ManagedHeadersManagedRequestHeaderArgs>

The list of managed request headers.

ManagedResponseHeaders List<ManagedHeadersManagedResponseHeaderArgs>

The list of managed response headers.

ZoneId string

The zone identifier to target for the resource.

ManagedRequestHeaders []ManagedHeadersManagedRequestHeaderArgs

The list of managed request headers.

ManagedResponseHeaders []ManagedHeadersManagedResponseHeaderArgs

The list of managed response headers.

zoneId String

The zone identifier to target for the resource.

managedRequestHeaders List<ManagedHeadersManagedRequestHeaderArgs>

The list of managed request headers.

managedResponseHeaders List<ManagedHeadersManagedResponseHeaderArgs>

The list of managed response headers.

zoneId string

The zone identifier to target for the resource.

managedRequestHeaders ManagedHeadersManagedRequestHeaderArgs[]

The list of managed request headers.

managedResponseHeaders ManagedHeadersManagedResponseHeaderArgs[]

The list of managed response headers.

zone_id str

The zone identifier to target for the resource.

managed_request_headers Sequence[ManagedHeadersManagedRequestHeaderArgs]

The list of managed request headers.

managed_response_headers Sequence[ManagedHeadersManagedResponseHeaderArgs]

The list of managed response headers.

zoneId String

The zone identifier to target for the resource.

managedRequestHeaders List<Property Map>

The list of managed request headers.

managedResponseHeaders List<Property Map>

The list of managed response headers.

Outputs

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

Get an existing ManagedHeaders 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?: ManagedHeadersState, opts?: CustomResourceOptions): ManagedHeaders
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        managed_request_headers: Optional[Sequence[ManagedHeadersManagedRequestHeaderArgs]] = None,
        managed_response_headers: Optional[Sequence[ManagedHeadersManagedResponseHeaderArgs]] = None,
        zone_id: Optional[str] = None) -> ManagedHeaders
func GetManagedHeaders(ctx *Context, name string, id IDInput, state *ManagedHeadersState, opts ...ResourceOption) (*ManagedHeaders, error)
public static ManagedHeaders Get(string name, Input<string> id, ManagedHeadersState? state, CustomResourceOptions? opts = null)
public static ManagedHeaders get(String name, Output<String> id, ManagedHeadersState 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:
ManagedRequestHeaders List<ManagedHeadersManagedRequestHeaderArgs>

The list of managed request headers.

ManagedResponseHeaders List<ManagedHeadersManagedResponseHeaderArgs>

The list of managed response headers.

ZoneId string

The zone identifier to target for the resource.

ManagedRequestHeaders []ManagedHeadersManagedRequestHeaderArgs

The list of managed request headers.

ManagedResponseHeaders []ManagedHeadersManagedResponseHeaderArgs

The list of managed response headers.

ZoneId string

The zone identifier to target for the resource.

managedRequestHeaders List<ManagedHeadersManagedRequestHeaderArgs>

The list of managed request headers.

managedResponseHeaders List<ManagedHeadersManagedResponseHeaderArgs>

The list of managed response headers.

zoneId String

The zone identifier to target for the resource.

managedRequestHeaders ManagedHeadersManagedRequestHeaderArgs[]

The list of managed request headers.

managedResponseHeaders ManagedHeadersManagedResponseHeaderArgs[]

The list of managed response headers.

zoneId string

The zone identifier to target for the resource.

managed_request_headers Sequence[ManagedHeadersManagedRequestHeaderArgs]

The list of managed request headers.

managed_response_headers Sequence[ManagedHeadersManagedResponseHeaderArgs]

The list of managed response headers.

zone_id str

The zone identifier to target for the resource.

managedRequestHeaders List<Property Map>

The list of managed request headers.

managedResponseHeaders List<Property Map>

The list of managed response headers.

zoneId String

The zone identifier to target for the resource.

Supporting Types

ManagedHeadersManagedRequestHeader

Enabled bool

Whether the headers rule is active.

Id string

Unique headers rule identifier.

Enabled bool

Whether the headers rule is active.

Id string

Unique headers rule identifier.

enabled Boolean

Whether the headers rule is active.

id String

Unique headers rule identifier.

enabled boolean

Whether the headers rule is active.

id string

Unique headers rule identifier.

enabled bool

Whether the headers rule is active.

id str

Unique headers rule identifier.

enabled Boolean

Whether the headers rule is active.

id String

Unique headers rule identifier.

ManagedHeadersManagedResponseHeader

Enabled bool

Whether the headers rule is active.

Id string

Unique headers rule identifier.

Enabled bool

Whether the headers rule is active.

Id string

Unique headers rule identifier.

enabled Boolean

Whether the headers rule is active.

id String

Unique headers rule identifier.

enabled boolean

Whether the headers rule is active.

id string

Unique headers rule identifier.

enabled bool

Whether the headers rule is active.

id str

Unique headers rule identifier.

enabled Boolean

Whether the headers rule is active.

id String

Unique headers rule identifier.

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes

This Pulumi package is based on the cloudflare Terraform Provider.