alicloud.esa.HttpRequestHeaderModificationRule
Explore with Pulumi AI
Provides a ESA Http Request Header Modification Rule resource.
For information about ESA Http Request Header Modification Rule and how to use it, see What is Http Request Header Modification Rule.
NOTE: Available since v1.242.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const instance = new alicloud.esa.RatePlanInstance("instance", {
type: "NS",
autoRenew: false,
period: 1,
paymentType: "Subscription",
coverage: "overseas",
autoPay: true,
planName: "high",
});
const site = new alicloud.esa.Site("site", {
siteName: "gositecdn.cn",
instanceId: instance.id,
coverage: "overseas",
accessType: "NS",
});
const _default = new alicloud.esa.HttpRequestHeaderModificationRule("default", {
ruleName: "example_modify",
requestHeaderModifications: [{
value: "modify1",
operation: "modify",
name: "example_modify1",
}],
siteId: site.id,
ruleEnable: "off",
rule: "(http.request.uri eq \"/content?page=1234\")",
siteVersion: 0,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
instance = alicloud.esa.RatePlanInstance("instance",
type="NS",
auto_renew=False,
period=1,
payment_type="Subscription",
coverage="overseas",
auto_pay=True,
plan_name="high")
site = alicloud.esa.Site("site",
site_name="gositecdn.cn",
instance_id=instance.id,
coverage="overseas",
access_type="NS")
default = alicloud.esa.HttpRequestHeaderModificationRule("default",
rule_name="example_modify",
request_header_modifications=[{
"value": "modify1",
"operation": "modify",
"name": "example_modify1",
}],
site_id=site.id,
rule_enable="off",
rule="(http.request.uri eq \"/content?page=1234\")",
site_version=0)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
instance, err := esa.NewRatePlanInstance(ctx, "instance", &esa.RatePlanInstanceArgs{
Type: pulumi.String("NS"),
AutoRenew: pulumi.Bool(false),
Period: pulumi.Int(1),
PaymentType: pulumi.String("Subscription"),
Coverage: pulumi.String("overseas"),
AutoPay: pulumi.Bool(true),
PlanName: pulumi.String("high"),
})
if err != nil {
return err
}
site, err := esa.NewSite(ctx, "site", &esa.SiteArgs{
SiteName: pulumi.String("gositecdn.cn"),
InstanceId: instance.ID(),
Coverage: pulumi.String("overseas"),
AccessType: pulumi.String("NS"),
})
if err != nil {
return err
}
_, err = esa.NewHttpRequestHeaderModificationRule(ctx, "default", &esa.HttpRequestHeaderModificationRuleArgs{
RuleName: pulumi.String("example_modify"),
RequestHeaderModifications: esa.HttpRequestHeaderModificationRuleRequestHeaderModificationArray{
&esa.HttpRequestHeaderModificationRuleRequestHeaderModificationArgs{
Value: pulumi.String("modify1"),
Operation: pulumi.String("modify"),
Name: pulumi.String("example_modify1"),
},
},
SiteId: site.ID(),
RuleEnable: pulumi.String("off"),
Rule: pulumi.String("(http.request.uri eq \"/content?page=1234\")"),
SiteVersion: pulumi.Int(0),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var instance = new AliCloud.Esa.RatePlanInstance("instance", new()
{
Type = "NS",
AutoRenew = false,
Period = 1,
PaymentType = "Subscription",
Coverage = "overseas",
AutoPay = true,
PlanName = "high",
});
var site = new AliCloud.Esa.Site("site", new()
{
SiteName = "gositecdn.cn",
InstanceId = instance.Id,
Coverage = "overseas",
AccessType = "NS",
});
var @default = new AliCloud.Esa.HttpRequestHeaderModificationRule("default", new()
{
RuleName = "example_modify",
RequestHeaderModifications = new[]
{
new AliCloud.Esa.Inputs.HttpRequestHeaderModificationRuleRequestHeaderModificationArgs
{
Value = "modify1",
Operation = "modify",
Name = "example_modify1",
},
},
SiteId = site.Id,
RuleEnable = "off",
Rule = "(http.request.uri eq \"/content?page=1234\")",
SiteVersion = 0,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.esa.RatePlanInstance;
import com.pulumi.alicloud.esa.RatePlanInstanceArgs;
import com.pulumi.alicloud.esa.Site;
import com.pulumi.alicloud.esa.SiteArgs;
import com.pulumi.alicloud.esa.HttpRequestHeaderModificationRule;
import com.pulumi.alicloud.esa.HttpRequestHeaderModificationRuleArgs;
import com.pulumi.alicloud.esa.inputs.HttpRequestHeaderModificationRuleRequestHeaderModificationArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var instance = new RatePlanInstance("instance", RatePlanInstanceArgs.builder()
.type("NS")
.autoRenew("false")
.period("1")
.paymentType("Subscription")
.coverage("overseas")
.autoPay("true")
.planName("high")
.build());
var site = new Site("site", SiteArgs.builder()
.siteName("gositecdn.cn")
.instanceId(instance.id())
.coverage("overseas")
.accessType("NS")
.build());
var default_ = new HttpRequestHeaderModificationRule("default", HttpRequestHeaderModificationRuleArgs.builder()
.ruleName("example_modify")
.requestHeaderModifications(HttpRequestHeaderModificationRuleRequestHeaderModificationArgs.builder()
.value("modify1")
.operation("modify")
.name("example_modify1")
.build())
.siteId(site.id())
.ruleEnable("off")
.rule("(http.request.uri eq \"/content?page=1234\")")
.siteVersion("0")
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
instance:
type: alicloud:esa:RatePlanInstance
properties:
type: NS
autoRenew: 'false'
period: '1'
paymentType: Subscription
coverage: overseas
autoPay: 'true'
planName: high
site:
type: alicloud:esa:Site
properties:
siteName: gositecdn.cn
instanceId: ${instance.id}
coverage: overseas
accessType: NS
default:
type: alicloud:esa:HttpRequestHeaderModificationRule
properties:
ruleName: example_modify
requestHeaderModifications:
- value: modify1
operation: modify
name: example_modify1
siteId: ${site.id}
ruleEnable: off
rule: (http.request.uri eq "/content?page=1234")
siteVersion: '0'
Create HttpRequestHeaderModificationRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new HttpRequestHeaderModificationRule(name: string, args: HttpRequestHeaderModificationRuleArgs, opts?: CustomResourceOptions);
@overload
def HttpRequestHeaderModificationRule(resource_name: str,
args: HttpRequestHeaderModificationRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def HttpRequestHeaderModificationRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
request_header_modifications: Optional[Sequence[HttpRequestHeaderModificationRuleRequestHeaderModificationArgs]] = None,
site_id: Optional[int] = None,
rule: Optional[str] = None,
rule_enable: Optional[str] = None,
rule_name: Optional[str] = None,
site_version: Optional[int] = None)
func NewHttpRequestHeaderModificationRule(ctx *Context, name string, args HttpRequestHeaderModificationRuleArgs, opts ...ResourceOption) (*HttpRequestHeaderModificationRule, error)
public HttpRequestHeaderModificationRule(string name, HttpRequestHeaderModificationRuleArgs args, CustomResourceOptions? opts = null)
public HttpRequestHeaderModificationRule(String name, HttpRequestHeaderModificationRuleArgs args)
public HttpRequestHeaderModificationRule(String name, HttpRequestHeaderModificationRuleArgs args, CustomResourceOptions options)
type: alicloud:esa:HttpRequestHeaderModificationRule
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 HttpRequestHeaderModificationRuleArgs
- 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 HttpRequestHeaderModificationRuleArgs
- 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 HttpRequestHeaderModificationRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HttpRequestHeaderModificationRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HttpRequestHeaderModificationRuleArgs
- 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 httpRequestHeaderModificationRuleResource = new AliCloud.Esa.HttpRequestHeaderModificationRule("httpRequestHeaderModificationRuleResource", new()
{
RequestHeaderModifications = new[]
{
new AliCloud.Esa.Inputs.HttpRequestHeaderModificationRuleRequestHeaderModificationArgs
{
Name = "string",
Operation = "string",
Value = "string",
},
},
SiteId = 0,
Rule = "string",
RuleEnable = "string",
RuleName = "string",
SiteVersion = 0,
});
example, err := esa.NewHttpRequestHeaderModificationRule(ctx, "httpRequestHeaderModificationRuleResource", &esa.HttpRequestHeaderModificationRuleArgs{
RequestHeaderModifications: esa.HttpRequestHeaderModificationRuleRequestHeaderModificationArray{
&esa.HttpRequestHeaderModificationRuleRequestHeaderModificationArgs{
Name: pulumi.String("string"),
Operation: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
SiteId: pulumi.Int(0),
Rule: pulumi.String("string"),
RuleEnable: pulumi.String("string"),
RuleName: pulumi.String("string"),
SiteVersion: pulumi.Int(0),
})
var httpRequestHeaderModificationRuleResource = new HttpRequestHeaderModificationRule("httpRequestHeaderModificationRuleResource", HttpRequestHeaderModificationRuleArgs.builder()
.requestHeaderModifications(HttpRequestHeaderModificationRuleRequestHeaderModificationArgs.builder()
.name("string")
.operation("string")
.value("string")
.build())
.siteId(0)
.rule("string")
.ruleEnable("string")
.ruleName("string")
.siteVersion(0)
.build());
http_request_header_modification_rule_resource = alicloud.esa.HttpRequestHeaderModificationRule("httpRequestHeaderModificationRuleResource",
request_header_modifications=[{
"name": "string",
"operation": "string",
"value": "string",
}],
site_id=0,
rule="string",
rule_enable="string",
rule_name="string",
site_version=0)
const httpRequestHeaderModificationRuleResource = new alicloud.esa.HttpRequestHeaderModificationRule("httpRequestHeaderModificationRuleResource", {
requestHeaderModifications: [{
name: "string",
operation: "string",
value: "string",
}],
siteId: 0,
rule: "string",
ruleEnable: "string",
ruleName: "string",
siteVersion: 0,
});
type: alicloud:esa:HttpRequestHeaderModificationRule
properties:
requestHeaderModifications:
- name: string
operation: string
value: string
rule: string
ruleEnable: string
ruleName: string
siteId: 0
siteVersion: 0
HttpRequestHeaderModificationRule 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 HttpRequestHeaderModificationRule resource accepts the following input properties:
- Request
Header List<Pulumi.Modifications Ali Cloud. Esa. Inputs. Http Request Header Modification Rule Request Header Modification> - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - Site
Id int - The site ID, which can be obtained by calling the ListSites API.
- Rule string
- The rule content.
- Rule
Enable string - Rule switch. Value range: on: Open. off: off.
- Rule
Name string - Rule Name.
- Site
Version int - The version number of the website configurations.
- Request
Header []HttpModifications Request Header Modification Rule Request Header Modification Args - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - Site
Id int - The site ID, which can be obtained by calling the ListSites API.
- Rule string
- The rule content.
- Rule
Enable string - Rule switch. Value range: on: Open. off: off.
- Rule
Name string - Rule Name.
- Site
Version int - The version number of the website configurations.
- request
Header List<HttpModifications Request Header Modification Rule Request Header Modification> - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - site
Id Integer - The site ID, which can be obtained by calling the ListSites API.
- rule String
- The rule content.
- rule
Enable String - Rule switch. Value range: on: Open. off: off.
- rule
Name String - Rule Name.
- site
Version Integer - The version number of the website configurations.
- request
Header HttpModifications Request Header Modification Rule Request Header Modification[] - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - site
Id number - The site ID, which can be obtained by calling the ListSites API.
- rule string
- The rule content.
- rule
Enable string - Rule switch. Value range: on: Open. off: off.
- rule
Name string - Rule Name.
- site
Version number - The version number of the website configurations.
- request_
header_ Sequence[Httpmodifications Request Header Modification Rule Request Header Modification Args] - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - site_
id int - The site ID, which can be obtained by calling the ListSites API.
- rule str
- The rule content.
- rule_
enable str - Rule switch. Value range: on: Open. off: off.
- rule_
name str - Rule Name.
- site_
version int - The version number of the website configurations.
- request
Header List<Property Map>Modifications - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - site
Id Number - The site ID, which can be obtained by calling the ListSites API.
- rule String
- The rule content.
- rule
Enable String - Rule switch. Value range: on: Open. off: off.
- rule
Name String - Rule Name.
- site
Version Number - The version number of the website configurations.
Outputs
All input properties are implicitly available as output properties. Additionally, the HttpRequestHeaderModificationRule resource produces the following output properties:
Look up Existing HttpRequestHeaderModificationRule Resource
Get an existing HttpRequestHeaderModificationRule 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?: HttpRequestHeaderModificationRuleState, opts?: CustomResourceOptions): HttpRequestHeaderModificationRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[int] = None,
request_header_modifications: Optional[Sequence[HttpRequestHeaderModificationRuleRequestHeaderModificationArgs]] = None,
rule: Optional[str] = None,
rule_enable: Optional[str] = None,
rule_name: Optional[str] = None,
site_id: Optional[int] = None,
site_version: Optional[int] = None) -> HttpRequestHeaderModificationRule
func GetHttpRequestHeaderModificationRule(ctx *Context, name string, id IDInput, state *HttpRequestHeaderModificationRuleState, opts ...ResourceOption) (*HttpRequestHeaderModificationRule, error)
public static HttpRequestHeaderModificationRule Get(string name, Input<string> id, HttpRequestHeaderModificationRuleState? state, CustomResourceOptions? opts = null)
public static HttpRequestHeaderModificationRule get(String name, Output<String> id, HttpRequestHeaderModificationRuleState state, CustomResourceOptions options)
resources: _: type: alicloud:esa:HttpRequestHeaderModificationRule 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.
- Config
Id int - Config Id
- Request
Header List<Pulumi.Modifications Ali Cloud. Esa. Inputs. Http Request Header Modification Rule Request Header Modification> - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - Rule string
- The rule content.
- Rule
Enable string - Rule switch. Value range: on: Open. off: off.
- Rule
Name string - Rule Name.
- Site
Id int - The site ID, which can be obtained by calling the ListSites API.
- Site
Version int - The version number of the website configurations.
- Config
Id int - Config Id
- Request
Header []HttpModifications Request Header Modification Rule Request Header Modification Args - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - Rule string
- The rule content.
- Rule
Enable string - Rule switch. Value range: on: Open. off: off.
- Rule
Name string - Rule Name.
- Site
Id int - The site ID, which can be obtained by calling the ListSites API.
- Site
Version int - The version number of the website configurations.
- config
Id Integer - Config Id
- request
Header List<HttpModifications Request Header Modification Rule Request Header Modification> - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - rule String
- The rule content.
- rule
Enable String - Rule switch. Value range: on: Open. off: off.
- rule
Name String - Rule Name.
- site
Id Integer - The site ID, which can be obtained by calling the ListSites API.
- site
Version Integer - The version number of the website configurations.
- config
Id number - Config Id
- request
Header HttpModifications Request Header Modification Rule Request Header Modification[] - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - rule string
- The rule content.
- rule
Enable string - Rule switch. Value range: on: Open. off: off.
- rule
Name string - Rule Name.
- site
Id number - The site ID, which can be obtained by calling the ListSites API.
- site
Version number - The version number of the website configurations.
- config_
id int - Config Id
- request_
header_ Sequence[Httpmodifications Request Header Modification Rule Request Header Modification Args] - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - rule str
- The rule content.
- rule_
enable str - Rule switch. Value range: on: Open. off: off.
- rule_
name str - Rule Name.
- site_
id int - The site ID, which can be obtained by calling the ListSites API.
- site_
version int - The version number of the website configurations.
- config
Id Number - Config Id
- request
Header List<Property Map>Modifications - The configurations of modifying request headers. You can add, delete, or modify a request header. See
request_header_modification
below. - rule String
- The rule content.
- rule
Enable String - Rule switch. Value range: on: Open. off: off.
- rule
Name String - Rule Name.
- site
Id Number - The site ID, which can be obtained by calling the ListSites API.
- site
Version Number - The version number of the website configurations.
Supporting Types
HttpRequestHeaderModificationRuleRequestHeaderModification, HttpRequestHeaderModificationRuleRequestHeaderModificationArgs
Import
ESA Http Request Header Modification Rule can be imported using the id, e.g.
$ pulumi import alicloud:esa/httpRequestHeaderModificationRule:HttpRequestHeaderModificationRule example <site_id>:<config_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.