Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.esa.getSites
Explore with Pulumi AI
This data source provides Esa Site available to the user.What is Site
NOTE: Available since v1.244.0.
Example 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 defaultIEoDfU = new alicloud.esa.RatePlanInstance("defaultIEoDfU", {
    type: "NS",
    autoRenew: true,
    period: 1,
    paymentType: "Subscription",
    coverage: "overseas",
    autoPay: true,
    planName: "basic",
});
const defaultSite = new alicloud.esa.Site("default", {
    siteName: "bcd.com",
    coverage: "overseas",
    accessType: "NS",
    instanceId: defaultIEoDfU.id,
});
const _default = alicloud.esa.getSitesOutput({
    ids: [defaultSite.id],
    nameRegex: defaultSite.siteName,
    siteName: "bcd.com",
});
export const alicloudEsaSiteExampleId = _default.apply(_default => _default.sites?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
default_i_eo_df_u = alicloud.esa.RatePlanInstance("defaultIEoDfU",
    type="NS",
    auto_renew=True,
    period=1,
    payment_type="Subscription",
    coverage="overseas",
    auto_pay=True,
    plan_name="basic")
default_site = alicloud.esa.Site("default",
    site_name="bcd.com",
    coverage="overseas",
    access_type="NS",
    instance_id=default_i_eo_df_u.id)
default = alicloud.esa.get_sites_output(ids=[default_site.id],
    name_regex=default_site.site_name,
    site_name="bcd.com")
pulumi.export("alicloudEsaSiteExampleId", default.sites[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
}
defaultIEoDfU, err := esa.NewRatePlanInstance(ctx, "defaultIEoDfU", &esa.RatePlanInstanceArgs{
Type: pulumi.String("NS"),
AutoRenew: pulumi.Bool(true),
Period: pulumi.Int(1),
PaymentType: pulumi.String("Subscription"),
Coverage: pulumi.String("overseas"),
AutoPay: pulumi.Bool(true),
PlanName: pulumi.String("basic"),
})
if err != nil {
return err
}
defaultSite, err := esa.NewSite(ctx, "default", &esa.SiteArgs{
SiteName: pulumi.String("bcd.com"),
Coverage: pulumi.String("overseas"),
AccessType: pulumi.String("NS"),
InstanceId: defaultIEoDfU.ID(),
})
if err != nil {
return err
}
_default := esa.GetSitesOutput(ctx, esa.GetSitesOutputArgs{
Ids: pulumi.StringArray{
defaultSite.ID(),
},
NameRegex: defaultSite.SiteName,
SiteName: pulumi.String("bcd.com"),
}, nil);
ctx.Export("alicloudEsaSiteExampleId", _default.ApplyT(func(_default esa.GetSitesResult) (*int, error) {
return &default.Sites[0].Id, nil
}).(pulumi.IntPtrOutput))
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 defaultIEoDfU = new AliCloud.Esa.RatePlanInstance("defaultIEoDfU", new()
    {
        Type = "NS",
        AutoRenew = true,
        Period = 1,
        PaymentType = "Subscription",
        Coverage = "overseas",
        AutoPay = true,
        PlanName = "basic",
    });
    var defaultSite = new AliCloud.Esa.Site("default", new()
    {
        SiteName = "bcd.com",
        Coverage = "overseas",
        AccessType = "NS",
        InstanceId = defaultIEoDfU.Id,
    });
    var @default = AliCloud.Esa.GetSites.Invoke(new()
    {
        Ids = new[]
        {
            defaultSite.Id,
        },
        NameRegex = defaultSite.SiteName,
        SiteName = "bcd.com",
    });
    return new Dictionary<string, object?>
    {
        ["alicloudEsaSiteExampleId"] = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.Id)),
    };
});
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.EsaFunctions;
import com.pulumi.alicloud.esa.inputs.GetSitesArgs;
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 defaultIEoDfU = new RatePlanInstance("defaultIEoDfU", RatePlanInstanceArgs.builder()
            .type("NS")
            .autoRenew(true)
            .period("1")
            .paymentType("Subscription")
            .coverage("overseas")
            .autoPay(true)
            .planName("basic")
            .build());
        var defaultSite = new Site("defaultSite", SiteArgs.builder()
            .siteName("bcd.com")
            .coverage("overseas")
            .accessType("NS")
            .instanceId(defaultIEoDfU.id())
            .build());
        final var default = EsaFunctions.getSites(GetSitesArgs.builder()
            .ids(defaultSite.id())
            .nameRegex(defaultSite.siteName())
            .siteName("bcd.com")
            .build());
        ctx.export("alicloudEsaSiteExampleId", default_.applyValue(default_ -> default_.sites()[0].id()));
    }
}
configuration:
  name:
    type: string
    default: terraform-example
resources:
  defaultIEoDfU:
    type: alicloud:esa:RatePlanInstance
    properties:
      type: NS
      autoRenew: true
      period: '1'
      paymentType: Subscription
      coverage: overseas
      autoPay: true
      planName: basic
  defaultSite:
    type: alicloud:esa:Site
    name: default
    properties:
      siteName: bcd.com
      coverage: overseas
      accessType: NS
      instanceId: ${defaultIEoDfU.id}
variables:
  default:
    fn::invoke:
      function: alicloud:esa:getSites
      arguments:
        ids:
          - ${defaultSite.id}
        nameRegex: ${defaultSite.siteName}
        siteName: bcd.com
outputs:
  alicloudEsaSiteExampleId: ${default.sites[0].id}
Using getSites
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 getSites(args: GetSitesArgs, opts?: InvokeOptions): Promise<GetSitesResult>
function getSitesOutput(args: GetSitesOutputArgs, opts?: InvokeOptions): Output<GetSitesResult>def get_sites(access_type: Optional[str] = None,
              coverage: Optional[str] = None,
              ids: Optional[Sequence[str]] = None,
              name_regex: Optional[str] = None,
              only_enterprise: Optional[bool] = None,
              output_file: Optional[str] = None,
              page_number: Optional[int] = None,
              page_size: Optional[int] = None,
              plan_subscribe_type: Optional[str] = None,
              resource_group_id: Optional[str] = None,
              site_name: Optional[str] = None,
              site_search_type: Optional[str] = None,
              status: Optional[str] = None,
              tags: Optional[Mapping[str, str]] = None,
              opts: Optional[InvokeOptions] = None) -> GetSitesResult
def get_sites_output(access_type: Optional[pulumi.Input[str]] = None,
              coverage: Optional[pulumi.Input[str]] = None,
              ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
              name_regex: Optional[pulumi.Input[str]] = None,
              only_enterprise: Optional[pulumi.Input[bool]] = None,
              output_file: Optional[pulumi.Input[str]] = None,
              page_number: Optional[pulumi.Input[int]] = None,
              page_size: Optional[pulumi.Input[int]] = None,
              plan_subscribe_type: Optional[pulumi.Input[str]] = None,
              resource_group_id: Optional[pulumi.Input[str]] = None,
              site_name: Optional[pulumi.Input[str]] = None,
              site_search_type: Optional[pulumi.Input[str]] = None,
              status: Optional[pulumi.Input[str]] = None,
              tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetSitesResult]func GetSites(ctx *Context, args *GetSitesArgs, opts ...InvokeOption) (*GetSitesResult, error)
func GetSitesOutput(ctx *Context, args *GetSitesOutputArgs, opts ...InvokeOption) GetSitesResultOutput> Note: This function is named GetSites in the Go SDK.
public static class GetSites 
{
    public static Task<GetSitesResult> InvokeAsync(GetSitesArgs args, InvokeOptions? opts = null)
    public static Output<GetSitesResult> Invoke(GetSitesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSitesResult> getSites(GetSitesArgs args, InvokeOptions options)
public static Output<GetSitesResult> getSites(GetSitesArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:esa/getSites:getSites
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AccessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- Coverage string
- Acceleration area
- Ids List<string>
- A list of Site IDs.
- NameRegex string
- A regex string to filter results by Group Metric Rule name.
- OnlyEnterprise bool
- Only the Enterprise version, pass true when the table only queries the enterprise version of the site.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- PageNumber int
- Current page number.
- PageSize int
- Number of records per page.
- PlanSubscribe stringType 
- Package subscription type. Value:-basicplan: Basic version.-standardplan: Standard version.-advancedplan: Advanced version.-enterpriseplan: Enterprise Edition.
- ResourceGroup stringId 
- The ID of the resource group
- SiteName string
- Site Name
- SiteSearch stringType 
- The search match pattern for the site name. The default value is exact match. Valid values:-prefix: matches the prefix.-suffix: The suffix matches.-exact: exact match.-fuzzy: fuzzy match.
- Status string
- The status of the resource
- Dictionary<string, string>
- Resource tags
- AccessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- Coverage string
- Acceleration area
- Ids []string
- A list of Site IDs.
- NameRegex string
- A regex string to filter results by Group Metric Rule name.
- OnlyEnterprise bool
- Only the Enterprise version, pass true when the table only queries the enterprise version of the site.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- PageNumber int
- Current page number.
- PageSize int
- Number of records per page.
- PlanSubscribe stringType 
- Package subscription type. Value:-basicplan: Basic version.-standardplan: Standard version.-advancedplan: Advanced version.-enterpriseplan: Enterprise Edition.
- ResourceGroup stringId 
- The ID of the resource group
- SiteName string
- Site Name
- SiteSearch stringType 
- The search match pattern for the site name. The default value is exact match. Valid values:-prefix: matches the prefix.-suffix: The suffix matches.-exact: exact match.-fuzzy: fuzzy match.
- Status string
- The status of the resource
- map[string]string
- Resource tags
- accessType String
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage String
- Acceleration area
- ids List<String>
- A list of Site IDs.
- nameRegex String
- A regex string to filter results by Group Metric Rule name.
- onlyEnterprise Boolean
- Only the Enterprise version, pass true when the table only queries the enterprise version of the site.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- pageNumber Integer
- Current page number.
- pageSize Integer
- Number of records per page.
- planSubscribe StringType 
- Package subscription type. Value:-basicplan: Basic version.-standardplan: Standard version.-advancedplan: Advanced version.-enterpriseplan: Enterprise Edition.
- resourceGroup StringId 
- The ID of the resource group
- siteName String
- Site Name
- siteSearch StringType 
- The search match pattern for the site name. The default value is exact match. Valid values:-prefix: matches the prefix.-suffix: The suffix matches.-exact: exact match.-fuzzy: fuzzy match.
- status String
- The status of the resource
- Map<String,String>
- Resource tags
- accessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage string
- Acceleration area
- ids string[]
- A list of Site IDs.
- nameRegex string
- A regex string to filter results by Group Metric Rule name.
- onlyEnterprise boolean
- Only the Enterprise version, pass true when the table only queries the enterprise version of the site.
- outputFile string
- File name where to save data source results (after running pulumi preview).
- pageNumber number
- Current page number.
- pageSize number
- Number of records per page.
- planSubscribe stringType 
- Package subscription type. Value:-basicplan: Basic version.-standardplan: Standard version.-advancedplan: Advanced version.-enterpriseplan: Enterprise Edition.
- resourceGroup stringId 
- The ID of the resource group
- siteName string
- Site Name
- siteSearch stringType 
- The search match pattern for the site name. The default value is exact match. Valid values:-prefix: matches the prefix.-suffix: The suffix matches.-exact: exact match.-fuzzy: fuzzy match.
- status string
- The status of the resource
- {[key: string]: string}
- Resource tags
- access_type str
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage str
- Acceleration area
- ids Sequence[str]
- A list of Site IDs.
- name_regex str
- A regex string to filter results by Group Metric Rule name.
- only_enterprise bool
- Only the Enterprise version, pass true when the table only queries the enterprise version of the site.
- output_file str
- File name where to save data source results (after running pulumi preview).
- page_number int
- Current page number.
- page_size int
- Number of records per page.
- plan_subscribe_ strtype 
- Package subscription type. Value:-basicplan: Basic version.-standardplan: Standard version.-advancedplan: Advanced version.-enterpriseplan: Enterprise Edition.
- resource_group_ strid 
- The ID of the resource group
- site_name str
- Site Name
- site_search_ strtype 
- The search match pattern for the site name. The default value is exact match. Valid values:-prefix: matches the prefix.-suffix: The suffix matches.-exact: exact match.-fuzzy: fuzzy match.
- status str
- The status of the resource
- Mapping[str, str]
- Resource tags
- accessType String
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage String
- Acceleration area
- ids List<String>
- A list of Site IDs.
- nameRegex String
- A regex string to filter results by Group Metric Rule name.
- onlyEnterprise Boolean
- Only the Enterprise version, pass true when the table only queries the enterprise version of the site.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- pageNumber Number
- Current page number.
- pageSize Number
- Number of records per page.
- planSubscribe StringType 
- Package subscription type. Value:-basicplan: Basic version.-standardplan: Standard version.-advancedplan: Advanced version.-enterpriseplan: Enterprise Edition.
- resourceGroup StringId 
- The ID of the resource group
- siteName String
- Site Name
- siteSearch StringType 
- The search match pattern for the site name. The default value is exact match. Valid values:-prefix: matches the prefix.-suffix: The suffix matches.-exact: exact match.-fuzzy: fuzzy match.
- status String
- The status of the resource
- Map<String>
- Resource tags
getSites Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of Site IDs.
- Names List<string>
- A list of name of Sites.
- Sites
List<Pulumi.Ali Cloud. Esa. Outputs. Get Sites Site> 
- A list of Site Entries. Each element contains the following attributes:
- AccessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- Coverage string
- Acceleration area
- NameRegex string
- OnlyEnterprise bool
- OutputFile string
- PageNumber int
- PageSize int
- PlanSubscribe stringType 
- ResourceGroup stringId 
- The ID of the resource group
- SiteName string
- Site Name
- SiteSearch stringType 
- Status string
- The status of the resource
- Dictionary<string, string>
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of Site IDs.
- Names []string
- A list of name of Sites.
- Sites
[]GetSites Site 
- A list of Site Entries. Each element contains the following attributes:
- AccessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- Coverage string
- Acceleration area
- NameRegex string
- OnlyEnterprise bool
- OutputFile string
- PageNumber int
- PageSize int
- PlanSubscribe stringType 
- ResourceGroup stringId 
- The ID of the resource group
- SiteName string
- Site Name
- SiteSearch stringType 
- Status string
- The status of the resource
- map[string]string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Site IDs.
- names List<String>
- A list of name of Sites.
- sites
List<GetSites Site> 
- A list of Site Entries. Each element contains the following attributes:
- accessType String
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage String
- Acceleration area
- nameRegex String
- onlyEnterprise Boolean
- outputFile String
- pageNumber Integer
- pageSize Integer
- planSubscribe StringType 
- resourceGroup StringId 
- The ID of the resource group
- siteName String
- Site Name
- siteSearch StringType 
- status String
- The status of the resource
- Map<String,String>
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of Site IDs.
- names string[]
- A list of name of Sites.
- sites
GetSites Site[] 
- A list of Site Entries. Each element contains the following attributes:
- accessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage string
- Acceleration area
- nameRegex string
- onlyEnterprise boolean
- outputFile string
- pageNumber number
- pageSize number
- planSubscribe stringType 
- resourceGroup stringId 
- The ID of the resource group
- siteName string
- Site Name
- siteSearch stringType 
- status string
- The status of the resource
- {[key: string]: string}
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of Site IDs.
- names Sequence[str]
- A list of name of Sites.
- sites
Sequence[GetSites Site] 
- A list of Site Entries. Each element contains the following attributes:
- access_type str
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage str
- Acceleration area
- name_regex str
- only_enterprise bool
- output_file str
- page_number int
- page_size int
- plan_subscribe_ strtype 
- resource_group_ strid 
- The ID of the resource group
- site_name str
- Site Name
- site_search_ strtype 
- status str
- The status of the resource
- Mapping[str, str]
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Site IDs.
- names List<String>
- A list of name of Sites.
- sites List<Property Map>
- A list of Site Entries. Each element contains the following attributes:
- accessType String
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage String
- Acceleration area
- nameRegex String
- onlyEnterprise Boolean
- outputFile String
- pageNumber Number
- pageSize Number
- planSubscribe StringType 
- resourceGroup StringId 
- The ID of the resource group
- siteName String
- Site Name
- siteSearch StringType 
- status String
- The status of the resource
- Map<String>
Supporting Types
GetSitesSite  
- AccessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- Coverage string
- Acceleration area
- CreateTime string
- Creation time
- Id int
- The ID of the resource supplied above.
- InstanceId string
- The ID of the associated package instance.
- ModifyTime string
- Modification time
- NameServer stringList 
- Site Resolution Name Server List
- ResourceGroup stringId 
- The ID of the resource group
- SiteId int
- Site ID
- SiteName string
- Site Name
- Status string
- The status of the resource
- AccessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- Coverage string
- Acceleration area
- CreateTime string
- Creation time
- Id int
- The ID of the resource supplied above.
- InstanceId string
- The ID of the associated package instance.
- ModifyTime string
- Modification time
- NameServer stringList 
- Site Resolution Name Server List
- ResourceGroup stringId 
- The ID of the resource group
- SiteId int
- Site ID
- SiteName string
- Site Name
- Status string
- The status of the resource
- accessType String
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage String
- Acceleration area
- createTime String
- Creation time
- id Integer
- The ID of the resource supplied above.
- instanceId String
- The ID of the associated package instance.
- modifyTime String
- Modification time
- nameServer StringList 
- Site Resolution Name Server List
- resourceGroup StringId 
- The ID of the resource group
- siteId Integer
- Site ID
- siteName String
- Site Name
- status String
- The status of the resource
- accessType string
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage string
- Acceleration area
- createTime string
- Creation time
- id number
- The ID of the resource supplied above.
- instanceId string
- The ID of the associated package instance.
- modifyTime string
- Modification time
- nameServer stringList 
- Site Resolution Name Server List
- resourceGroup stringId 
- The ID of the resource group
- siteId number
- Site ID
- siteName string
- Site Name
- status string
- The status of the resource
- access_type str
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage str
- Acceleration area
- create_time str
- Creation time
- id int
- The ID of the resource supplied above.
- instance_id str
- The ID of the associated package instance.
- modify_time str
- Modification time
- name_server_ strlist 
- Site Resolution Name Server List
- resource_group_ strid 
- The ID of the resource group
- site_id int
- Site ID
- site_name str
- Site Name
- status str
- The status of the resource
- accessType String
- Access type. Value:-NS: Managed access via NS.-CNAME: access through CNAME.
- coverage String
- Acceleration area
- createTime String
- Creation time
- id Number
- The ID of the resource supplied above.
- instanceId String
- The ID of the associated package instance.
- modifyTime String
- Modification time
- nameServer StringList 
- Site Resolution Name Server List
- resourceGroup StringId 
- The ID of the resource group
- siteId Number
- Site ID
- siteName String
- Site Name
- status String
- The status of the resource
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.