Akamai

Pulumi Official
Package maintained by Pulumi
v3.0.0 published on Monday, Jul 25, 2022 by Pulumi

AppSecAdvancedSettingsPragmaHeader

Scopes: Security configuration; security policy

Specifies the headers you can exclude from inspection when you are working with a Pragma debug header, a header that provides information about such things as: the edge routers used in a transaction; the Akamai IP addresses involved; whether a request was cached or not; etc. By default, pragma headers are removed from all responses.

This operation can be applied at the security configuration level (in which case it applies to all the security policies in the configuration), or can be customized for an individual security policy.

Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/advanced-settings/pragma-header

Example Usage

using System.IO;
using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var configuration = Output.Create(Akamai.GetAppSecConfiguration.InvokeAsync(new Akamai.GetAppSecConfigurationArgs
        {
            Name = "Documentation",
        }));
        var pragmaHeader = new Akamai.AppSecAdvancedSettingsPragmaHeader("pragmaHeader", new Akamai.AppSecAdvancedSettingsPragmaHeaderArgs
        {
            ConfigId = configuration.Apply(configuration => configuration.ConfigId),
            SecurityPolicyId = "gms1_134637",
            PragmaHeader = File.ReadAllText($"{path.Module}/pragma_header.json"),
        });
    }

}
package main

import (
	"fmt"
	"io/ioutil"

	"github.com/pulumi/pulumi-akamai/sdk/v3/go/akamai"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		configuration, err := akamai.LookupAppSecConfiguration(ctx, &GetAppSecConfigurationArgs{
			Name: pulumi.StringRef("Documentation"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = akamai.NewAppSecAdvancedSettingsPragmaHeader(ctx, "pragmaHeader", &akamai.AppSecAdvancedSettingsPragmaHeaderArgs{
			ConfigId:         pulumi.Int(configuration.ConfigId),
			SecurityPolicyId: pulumi.String("gms1_134637"),
			PragmaHeader:     readFileOrPanic(fmt.Sprintf("%v/pragma_header.json", path.Module)),
		})
		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.akamai.AkamaiFunctions;
import com.pulumi.akamai.inputs.GetAppSecConfigurationArgs;
import com.pulumi.akamai.AppSecAdvancedSettingsPragmaHeader;
import com.pulumi.akamai.AppSecAdvancedSettingsPragmaHeaderArgs;
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) {
        final var configuration = AkamaiFunctions.getAppSecConfiguration(GetAppSecConfigurationArgs.builder()
            .name("Documentation")
            .build());

        var pragmaHeader = new AppSecAdvancedSettingsPragmaHeader("pragmaHeader", AppSecAdvancedSettingsPragmaHeaderArgs.builder()        
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .securityPolicyId("gms1_134637")
            .pragmaHeader(Files.readString(Paths.get(String.format("%s/pragma_header.json", path.module()))))
            .build());

    }
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
pragma_header = akamai.AppSecAdvancedSettingsPragmaHeader("pragmaHeader",
    config_id=configuration.config_id,
    security_policy_id="gms1_134637",
    pragma_header=(lambda path: open(path).read())(f"{path['module']}/pragma_header.json"))
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
import * as fs from "fs";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const pragmaHeader = new akamai.AppSecAdvancedSettingsPragmaHeader("pragmaHeader", {
    configId: configuration.then(configuration => configuration.configId),
    securityPolicyId: "gms1_134637",
    pragmaHeader: fs.readFileSync(`${path.module}/pragma_header.json`),
});

Coming soon!

Create a AppSecAdvancedSettingsPragmaHeader Resource

new AppSecAdvancedSettingsPragmaHeader(name: string, args: AppSecAdvancedSettingsPragmaHeaderArgs, opts?: CustomResourceOptions);
@overload
def AppSecAdvancedSettingsPragmaHeader(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       config_id: Optional[int] = None,
                                       pragma_header: Optional[str] = None,
                                       security_policy_id: Optional[str] = None)
@overload
def AppSecAdvancedSettingsPragmaHeader(resource_name: str,
                                       args: AppSecAdvancedSettingsPragmaHeaderArgs,
                                       opts: Optional[ResourceOptions] = None)
func NewAppSecAdvancedSettingsPragmaHeader(ctx *Context, name string, args AppSecAdvancedSettingsPragmaHeaderArgs, opts ...ResourceOption) (*AppSecAdvancedSettingsPragmaHeader, error)
public AppSecAdvancedSettingsPragmaHeader(string name, AppSecAdvancedSettingsPragmaHeaderArgs args, CustomResourceOptions? opts = null)
public AppSecAdvancedSettingsPragmaHeader(String name, AppSecAdvancedSettingsPragmaHeaderArgs args)
public AppSecAdvancedSettingsPragmaHeader(String name, AppSecAdvancedSettingsPragmaHeaderArgs args, CustomResourceOptions options)
type: akamai:AppSecAdvancedSettingsPragmaHeader
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

ConfigId int

. Unique identifier of the security configuration associated with the pragma header settings being modified.

PragmaHeader string

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

SecurityPolicyId string

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

ConfigId int

. Unique identifier of the security configuration associated with the pragma header settings being modified.

PragmaHeader string

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

SecurityPolicyId string

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

configId Integer

. Unique identifier of the security configuration associated with the pragma header settings being modified.

pragmaHeader String

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

securityPolicyId String

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

configId number

. Unique identifier of the security configuration associated with the pragma header settings being modified.

pragmaHeader string

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

securityPolicyId string

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

config_id int

. Unique identifier of the security configuration associated with the pragma header settings being modified.

pragma_header str

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

security_policy_id str

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

configId Number

. Unique identifier of the security configuration associated with the pragma header settings being modified.

pragmaHeader String

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

securityPolicyId String

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

Outputs

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

Get an existing AppSecAdvancedSettingsPragmaHeader 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?: AppSecAdvancedSettingsPragmaHeaderState, opts?: CustomResourceOptions): AppSecAdvancedSettingsPragmaHeader
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config_id: Optional[int] = None,
        pragma_header: Optional[str] = None,
        security_policy_id: Optional[str] = None) -> AppSecAdvancedSettingsPragmaHeader
func GetAppSecAdvancedSettingsPragmaHeader(ctx *Context, name string, id IDInput, state *AppSecAdvancedSettingsPragmaHeaderState, opts ...ResourceOption) (*AppSecAdvancedSettingsPragmaHeader, error)
public static AppSecAdvancedSettingsPragmaHeader Get(string name, Input<string> id, AppSecAdvancedSettingsPragmaHeaderState? state, CustomResourceOptions? opts = null)
public static AppSecAdvancedSettingsPragmaHeader get(String name, Output<String> id, AppSecAdvancedSettingsPragmaHeaderState 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:
ConfigId int

. Unique identifier of the security configuration associated with the pragma header settings being modified.

PragmaHeader string

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

SecurityPolicyId string

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

ConfigId int

. Unique identifier of the security configuration associated with the pragma header settings being modified.

PragmaHeader string

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

SecurityPolicyId string

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

configId Integer

. Unique identifier of the security configuration associated with the pragma header settings being modified.

pragmaHeader String

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

securityPolicyId String

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

configId number

. Unique identifier of the security configuration associated with the pragma header settings being modified.

pragmaHeader string

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

securityPolicyId string

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

config_id int

. Unique identifier of the security configuration associated with the pragma header settings being modified.

pragma_header str

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

security_policy_id str

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

configId Number

. Unique identifier of the security configuration associated with the pragma header settings being modified.

pragmaHeader String

. Path to a JSON file containing information about the conditions to exclude from the default remove action. By default, the Pragma header debugging information is stripped from an operation's response except in cases where you set excludeCondition. You can view a sample JSON file in the Modify pragma settings for a security setting section of the Application Security API documentation.

securityPolicyId String

. Unique identifier of the security policy associated with the pragma header settings being modified. If not included, pragma header settings are modified at the configuration scope and, as a result, apply to all the security policies associated with the configuration.

Package Details

Repository
https://github.com/pulumi/pulumi-akamai
License
Apache-2.0
Notes

This Pulumi package is based on the akamai Terraform Provider.