Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi
published on Thursday, Jul 16, 2026 by Pulumi
Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi
published on Thursday, Jul 16, 2026 by Pulumi
This data source provides the Esa Network Optimizations of the current Alibaba Cloud user.
NOTE: Available since v1.279.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 _default = alicloud.esa.getSites({
planSubscribeType: "enterpriseplan",
});
const defaultNetworkOptimization = new alicloud.esa.NetworkOptimization("default", {
siteId: output(_default.then(_default => _default.sites?.[0]?.id)).apply(x =>String(x)),
siteVersion: 0,
ruleEnable: "on",
ruleName: name,
rule: "true",
sequence: 1,
smartRouting: "on",
websocket: "on",
http2Origin: "on",
grpc: "on",
uploadMaxFilesize: "100",
});
const ids = alicloud.esa.getNetworkOptimizationsOutput({
ids: [defaultNetworkOptimization.id],
siteId: defaultNetworkOptimization.siteId,
});
export const esaNetworkOptimizationsId0 = ids.apply(ids => ids.optimizations?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.esa.get_sites(plan_subscribe_type="enterpriseplan")
default_network_optimization = alicloud.esa.NetworkOptimization("default",
site_id=output(default.sites[0].id).apply(lambda x: str(x)),
site_version=0,
rule_enable="on",
rule_name=name,
rule="true",
sequence=1,
smart_routing="on",
websocket="on",
http2_origin="on",
grpc="on",
upload_max_filesize="100")
ids = alicloud.esa.get_network_optimizations_output(ids=[default_network_optimization.id],
site_id=default_network_optimization.site_id)
pulumi.export("esaNetworkOptimizationsId0", ids.optimizations[0].id)
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
}
_default, err := esa.GetSites(ctx, &esa.GetSitesArgs{
PlanSubscribeType: pulumi.StringRef("enterpriseplan"),
}, nil)
if err != nil {
return err
}
defaultNetworkOptimization, err := esa.NewNetworkOptimization(ctx, "default", &esa.NetworkOptimizationArgs{
SiteId: pulumi.Int(_default.Sites[0].Id),
SiteVersion: pulumi.Int(0),
RuleEnable: pulumi.String("on"),
RuleName: pulumi.String(name),
Rule: pulumi.String("true"),
Sequence: pulumi.Int(1),
SmartRouting: pulumi.String("on"),
Websocket: pulumi.String("on"),
Http2Origin: pulumi.String("on"),
Grpc: pulumi.String("on"),
UploadMaxFilesize: pulumi.String("100"),
})
if err != nil {
return err
}
ids := esa.GetNetworkOptimizationsOutput(ctx, esa.GetNetworkOptimizationsOutputArgs{
Ids: pulumi.StringArray{
defaultNetworkOptimization.ID(),
},
SiteId: defaultNetworkOptimization.SiteId,
}, nil)
ctx.Export("esaNetworkOptimizationsId0", ids.ApplyT(func(ids esa.GetNetworkOptimizationsResult) (*string, error) {
return ids.Optimizations[0].Id, nil
}).(pulumi.StringPtrOutput))
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 @default = AliCloud.Esa.GetSites.Invoke(new()
{
PlanSubscribeType = "enterpriseplan",
});
var defaultNetworkOptimization = new AliCloud.Esa.NetworkOptimization("default", new()
{
SiteId = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.Id)),
SiteVersion = 0,
RuleEnable = "on",
RuleName = name,
Rule = "true",
Sequence = 1,
SmartRouting = "on",
Websocket = "on",
Http2Origin = "on",
Grpc = "on",
UploadMaxFilesize = "100",
});
var ids = AliCloud.Esa.GetNetworkOptimizations.Invoke(new()
{
Ids = new[]
{
defaultNetworkOptimization.Id,
},
SiteId = defaultNetworkOptimization.SiteId,
});
return new Dictionary<string, object?>
{
["esaNetworkOptimizationsId0"] = ids.Apply(getNetworkOptimizationsResult => getNetworkOptimizationsResult.Optimizations[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.esa.EsaFunctions;
import com.pulumi.alicloud.esa.inputs.GetSitesArgs;
import com.pulumi.alicloud.esa.NetworkOptimization;
import com.pulumi.alicloud.esa.NetworkOptimizationArgs;
import com.pulumi.alicloud.esa.inputs.GetNetworkOptimizationsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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");
final var default = EsaFunctions.getSites(GetSitesArgs.builder()
.planSubscribeType("enterpriseplan")
.build());
var defaultNetworkOptimization = new NetworkOptimization("defaultNetworkOptimization", NetworkOptimizationArgs.builder()
.siteId(default_.sites()[0].id())
.siteVersion(0)
.ruleEnable("on")
.ruleName(name)
.rule("true")
.sequence(1)
.smartRouting("on")
.websocket("on")
.http2Origin("on")
.grpc("on")
.uploadMaxFilesize("100")
.build());
final var ids = EsaFunctions.getNetworkOptimizations(GetNetworkOptimizationsArgs.builder()
.ids(defaultNetworkOptimization.id())
.siteId(defaultNetworkOptimization.siteId())
.build());
ctx.export("esaNetworkOptimizationsId0", ids.applyValue(_ids -> _ids.optimizations()[0].id()));
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultNetworkOptimization:
type: alicloud:esa:NetworkOptimization
name: default
properties:
siteId: ${default.sites[0].id}
siteVersion: 0
ruleEnable: on
ruleName: ${name}
rule: 'true'
sequence: 1
smartRouting: on
websocket: on
http2Origin: on
grpc: on
uploadMaxFilesize: '100'
variables:
default:
fn::invoke:
function: alicloud:esa:getSites
arguments:
planSubscribeType: enterpriseplan
ids:
fn::invoke:
function: alicloud:esa:getNetworkOptimizations
arguments:
ids:
- ${defaultNetworkOptimization.id}
siteId: ${defaultNetworkOptimization.siteId}
outputs:
esaNetworkOptimizationsId0: ${ids.optimizations[0].id}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_esa_getsites" "default" {
plan_subscribe_type = "enterpriseplan"
}
data "alicloud_esa_getnetworkoptimizations" "ids" {
ids = [alicloud_esa_networkoptimization.default.id]
site_id = alicloud_esa_networkoptimization.default.site_id
}
resource "alicloud_esa_networkoptimization" "default" {
site_id = data.alicloud_esa_getsites.default.sites[0].id
site_version = 0
rule_enable = "on"
rule_name = var.name
rule = "true"
sequence = 1
smart_routing = "on"
websocket = "on"
http2_origin = "on"
grpc = "on"
upload_max_filesize = "100"
}
variable "name" {
type = string
default = "terraform-example"
}
output "esaNetworkOptimizationsId0" {
value = data.alicloud_esa_getnetworkoptimizations.ids.optimizations[0].id
}
Using getNetworkOptimizations
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNetworkOptimizations(args: GetNetworkOptimizationsArgs, opts?: InvokeOptions): Promise<GetNetworkOptimizationsResult>
function getNetworkOptimizationsOutput(args: GetNetworkOptimizationsOutputArgs, opts?: InvokeOptions): Output<GetNetworkOptimizationsResult>def get_network_optimizations(config_id: Optional[str] = None,
config_type: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
rule_name: Optional[str] = None,
site_id: Optional[str] = None,
site_version: Optional[int] = None,
opts: Optional[InvokeOptions] = None) -> GetNetworkOptimizationsResult
def get_network_optimizations_output(config_id: pulumi.Input[Optional[str]] = None,
config_type: pulumi.Input[Optional[str]] = None,
ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
name_regex: pulumi.Input[Optional[str]] = None,
output_file: pulumi.Input[Optional[str]] = None,
rule_name: pulumi.Input[Optional[str]] = None,
site_id: pulumi.Input[Optional[str]] = None,
site_version: pulumi.Input[Optional[int]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNetworkOptimizationsResult]func GetNetworkOptimizations(ctx *Context, args *GetNetworkOptimizationsArgs, opts ...InvokeOption) (*GetNetworkOptimizationsResult, error)
func GetNetworkOptimizationsOutput(ctx *Context, args *GetNetworkOptimizationsOutputArgs, opts ...InvokeOption) GetNetworkOptimizationsResultOutput> Note: This function is named GetNetworkOptimizations in the Go SDK.
public static class GetNetworkOptimizations
{
public static Task<GetNetworkOptimizationsResult> InvokeAsync(GetNetworkOptimizationsArgs args, InvokeOptions? opts = null)
public static Output<GetNetworkOptimizationsResult> Invoke(GetNetworkOptimizationsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNetworkOptimizationsResult> getNetworkOptimizations(GetNetworkOptimizationsArgs args, InvokeOptions options)
public static Output<GetNetworkOptimizationsResult> getNetworkOptimizations(GetNetworkOptimizationsArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:esa/getNetworkOptimizations:getNetworkOptimizations
arguments:
# arguments dictionarydata "alicloud_esa_getnetworkoptimizations" "name" {
# arguments
}The following arguments are supported:
- Site
Id string - The ID of the Site.
- Config
Id string - The ID of the Configuration.
- Config
Type string - The type of the Configuration. Valid values:
global,rule. - Ids List<string>
- A list of Network Optimization IDs. It formats as
<site_id>:<config_id>. - Name
Regex string - A regex string to filter results by Network Optimization name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Rule
Name string - The name of the rule.
- Site
Version int - The version of the site.
- Site
Id string - The ID of the Site.
- Config
Id string - The ID of the Configuration.
- Config
Type string - The type of the Configuration. Valid values:
global,rule. - Ids []string
- A list of Network Optimization IDs. It formats as
<site_id>:<config_id>. - Name
Regex string - A regex string to filter results by Network Optimization name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Rule
Name string - The name of the rule.
- Site
Version int - The version of the site.
- site_
id string - The ID of the Site.
- config_
id string - The ID of the Configuration.
- config_
type string - The type of the Configuration. Valid values:
global,rule. - ids list(string)
- A list of Network Optimization IDs. It formats as
<site_id>:<config_id>. - name_
regex string - A regex string to filter results by Network Optimization name.
- output_
file string - File name where to save data source results (after running
pulumi preview). - rule_
name string - The name of the rule.
- site_
version number - The version of the site.
- site
Id String - The ID of the Site.
- config
Id String - The ID of the Configuration.
- config
Type String - The type of the Configuration. Valid values:
global,rule. - ids List<String>
- A list of Network Optimization IDs. It formats as
<site_id>:<config_id>. - name
Regex String - A regex string to filter results by Network Optimization name.
- output
File String - File name where to save data source results (after running
pulumi preview). - rule
Name String - The name of the rule.
- site
Version Integer - The version of the site.
- site
Id string - The ID of the Site.
- config
Id string - The ID of the Configuration.
- config
Type string - The type of the Configuration. Valid values:
global,rule. - ids string[]
- A list of Network Optimization IDs. It formats as
<site_id>:<config_id>. - name
Regex string - A regex string to filter results by Network Optimization name.
- output
File string - File name where to save data source results (after running
pulumi preview). - rule
Name string - The name of the rule.
- site
Version number - The version of the site.
- site_
id str - The ID of the Site.
- config_
id str - The ID of the Configuration.
- config_
type str - The type of the Configuration. Valid values:
global,rule. - ids Sequence[str]
- A list of Network Optimization IDs. It formats as
<site_id>:<config_id>. - name_
regex str - A regex string to filter results by Network Optimization name.
- output_
file str - File name where to save data source results (after running
pulumi preview). - rule_
name str - The name of the rule.
- site_
version int - The version of the site.
- site
Id String - The ID of the Site.
- config
Id String - The ID of the Configuration.
- config
Type String - The type of the Configuration. Valid values:
global,rule. - ids List<String>
- A list of Network Optimization IDs. It formats as
<site_id>:<config_id>. - name
Regex String - A regex string to filter results by Network Optimization name.
- output
File String - File name where to save data source results (after running
pulumi preview). - rule
Name String - The name of the rule.
- site
Version Number - The version of the site.
getNetworkOptimizations Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- A list of Network Optimization names.
- Optimizations
List<Pulumi.
Ali Cloud. Esa. Outputs. Get Network Optimizations Optimization> - A list of Network Optimizations. Each element contains the following attributes:
- Site
Id string - Config
Id string - The ID of the Configuration.
- Config
Type string - The type of the Configuration.
- Name
Regex string - Output
File string - Rule
Name string - Rule name.
- Site
Version int - The version of the site.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- A list of Network Optimization names.
- Optimizations
[]Get
Network Optimizations Optimization - A list of Network Optimizations. Each element contains the following attributes:
- Site
Id string - Config
Id string - The ID of the Configuration.
- Config
Type string - The type of the Configuration.
- Name
Regex string - Output
File string - Rule
Name string - Rule name.
- Site
Version int - The version of the site.
- id string
- The provider-assigned unique ID for this managed resource.
- ids list(string)
- names list(string)
- A list of Network Optimization names.
- optimizations list(object)
- A list of Network Optimizations. Each element contains the following attributes:
- site_
id string - config_
id string - The ID of the Configuration.
- config_
type string - The type of the Configuration.
- name_
regex string - output_
file string - rule_
name string - Rule name.
- site_
version number - The version of the site.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Network Optimization names.
- optimizations
List<Get
Network Optimizations Optimization> - A list of Network Optimizations. Each element contains the following attributes:
- site
Id String - config
Id String - The ID of the Configuration.
- config
Type String - The type of the Configuration.
- name
Regex String - output
File String - rule
Name String - Rule name.
- site
Version Integer - The version of the site.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- A list of Network Optimization names.
- optimizations
Get
Network Optimizations Optimization[] - A list of Network Optimizations. Each element contains the following attributes:
- site
Id string - config
Id string - The ID of the Configuration.
- config
Type string - The type of the Configuration.
- name
Regex string - output
File string - rule
Name string - Rule name.
- site
Version number - The version of the site.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- A list of Network Optimization names.
- optimizations
Sequence[Get
Network Optimizations Optimization] - A list of Network Optimizations. Each element contains the following attributes:
- site_
id str - config_
id str - The ID of the Configuration.
- config_
type str - The type of the Configuration.
- name_
regex str - output_
file str - rule_
name str - Rule name.
- site_
version int - The version of the site.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Network Optimization names.
- optimizations List<Property Map>
- A list of Network Optimizations. Each element contains the following attributes:
- site
Id String - config
Id String - The ID of the Configuration.
- config
Type String - The type of the Configuration.
- name
Regex String - output
File String - rule
Name String - Rule name.
- site
Version Number - The version of the site.
Supporting Types
GetNetworkOptimizationsOptimization
- Config
Id string - The ID of the Configuration.
- Config
Type string - The type of the Configuration. Valid values:
global,rule. - Grpc string
- Whether to enable GRPC.
- Http2Origin string
- Whether to enable HTTP2 origin.
- Id string
- The ID of the Network Optimization.
- Rule string
- Rule content.
- Rule
Enable string - Rule switch.
- Rule
Name string - The name of the rule.
- Sequence int
- The rule execution order prioritizes lower numerical values.
- Site
Version int - The version of the site.
- Smart
Routing string - Whether to enable smart routing service.
- Upload
Max stringFilesize - Maximum upload file size.
- Websocket string
- Whether to enable Websocket.
- Config
Id string - The ID of the Configuration.
- Config
Type string - The type of the Configuration. Valid values:
global,rule. - Grpc string
- Whether to enable GRPC.
- Http2Origin string
- Whether to enable HTTP2 origin.
- Id string
- The ID of the Network Optimization.
- Rule string
- Rule content.
- Rule
Enable string - Rule switch.
- Rule
Name string - The name of the rule.
- Sequence int
- The rule execution order prioritizes lower numerical values.
- Site
Version int - The version of the site.
- Smart
Routing string - Whether to enable smart routing service.
- Upload
Max stringFilesize - Maximum upload file size.
- Websocket string
- Whether to enable Websocket.
- config_
id string - The ID of the Configuration.
- config_
type string - The type of the Configuration. Valid values:
global,rule. - grpc string
- Whether to enable GRPC.
- http2_
origin string - Whether to enable HTTP2 origin.
- id string
- The ID of the Network Optimization.
- rule string
- Rule content.
- rule_
enable string - Rule switch.
- rule_
name string - The name of the rule.
- sequence number
- The rule execution order prioritizes lower numerical values.
- site_
version number - The version of the site.
- smart_
routing string - Whether to enable smart routing service.
- upload_
max_ stringfilesize - Maximum upload file size.
- websocket string
- Whether to enable Websocket.
- config
Id String - The ID of the Configuration.
- config
Type String - The type of the Configuration. Valid values:
global,rule. - grpc String
- Whether to enable GRPC.
- http2Origin String
- Whether to enable HTTP2 origin.
- id String
- The ID of the Network Optimization.
- rule String
- Rule content.
- rule
Enable String - Rule switch.
- rule
Name String - The name of the rule.
- sequence Integer
- The rule execution order prioritizes lower numerical values.
- site
Version Integer - The version of the site.
- smart
Routing String - Whether to enable smart routing service.
- upload
Max StringFilesize - Maximum upload file size.
- websocket String
- Whether to enable Websocket.
- config
Id string - The ID of the Configuration.
- config
Type string - The type of the Configuration. Valid values:
global,rule. - grpc string
- Whether to enable GRPC.
- http2Origin string
- Whether to enable HTTP2 origin.
- id string
- The ID of the Network Optimization.
- rule string
- Rule content.
- rule
Enable string - Rule switch.
- rule
Name string - The name of the rule.
- sequence number
- The rule execution order prioritizes lower numerical values.
- site
Version number - The version of the site.
- smart
Routing string - Whether to enable smart routing service.
- upload
Max stringFilesize - Maximum upload file size.
- websocket string
- Whether to enable Websocket.
- config_
id str - The ID of the Configuration.
- config_
type str - The type of the Configuration. Valid values:
global,rule. - grpc str
- Whether to enable GRPC.
- http2_
origin str - Whether to enable HTTP2 origin.
- id str
- The ID of the Network Optimization.
- rule str
- Rule content.
- rule_
enable str - Rule switch.
- rule_
name str - The name of the rule.
- sequence int
- The rule execution order prioritizes lower numerical values.
- site_
version int - The version of the site.
- smart_
routing str - Whether to enable smart routing service.
- upload_
max_ strfilesize - Maximum upload file size.
- websocket str
- Whether to enable Websocket.
- config
Id String - The ID of the Configuration.
- config
Type String - The type of the Configuration. Valid values:
global,rule. - grpc String
- Whether to enable GRPC.
- http2Origin String
- Whether to enable HTTP2 origin.
- id String
- The ID of the Network Optimization.
- rule String
- Rule content.
- rule
Enable String - Rule switch.
- rule
Name String - The name of the rule.
- sequence Number
- The rule execution order prioritizes lower numerical values.
- site
Version Number - The version of the site.
- smart
Routing String - Whether to enable smart routing service.
- upload
Max StringFilesize - Maximum upload file size.
- websocket String
- Whether to enable Websocket.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi
published on Thursday, Jul 16, 2026 by Pulumi