1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. Version
Alibaba Cloud v3.83.0 published on Monday, Jul 21, 2025 by Pulumi

alicloud.esa.Version

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.83.0 published on Monday, Jul 21, 2025 by Pulumi

    Provides a ESA Site Version resource.

    For information about ESA Site Version and how to use it, see What is Site Version.

    NOTE: Available since v1.251.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") || "bcd72239.com";
    const _default = alicloud.esa.getSites({
        planSubscribeType: "enterpriseplan",
    });
    const defaultSite = new alicloud.esa.Site("default", {
        siteName: name,
        instanceId: _default.then(_default => _default.sites?.[0]?.instanceId),
        coverage: "overseas",
        accessType: "NS",
        versionManagement: true,
    });
    const defaultVersion = new alicloud.esa.Version("default", {
        siteId: defaultSite.id,
        description: "example",
        originVersion: 0,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "bcd72239.com"
    default = alicloud.esa.get_sites(plan_subscribe_type="enterpriseplan")
    default_site = alicloud.esa.Site("default",
        site_name=name,
        instance_id=default.sites[0].instance_id,
        coverage="overseas",
        access_type="NS",
        version_management=True)
    default_version = alicloud.esa.Version("default",
        site_id=default_site.id,
        description="example",
        origin_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 := "bcd72239.com"
    		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
    		}
    		defaultSite, err := esa.NewSite(ctx, "default", &esa.SiteArgs{
    			SiteName:          pulumi.String(name),
    			InstanceId:        pulumi.String(_default.Sites[0].InstanceId),
    			Coverage:          pulumi.String("overseas"),
    			AccessType:        pulumi.String("NS"),
    			VersionManagement: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = esa.NewVersion(ctx, "default", &esa.VersionArgs{
    			SiteId:        defaultSite.ID(),
    			Description:   pulumi.String("example"),
    			OriginVersion: 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") ?? "bcd72239.com";
        var @default = AliCloud.Esa.GetSites.Invoke(new()
        {
            PlanSubscribeType = "enterpriseplan",
        });
    
        var defaultSite = new AliCloud.Esa.Site("default", new()
        {
            SiteName = name,
            InstanceId = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.InstanceId)),
            Coverage = "overseas",
            AccessType = "NS",
            VersionManagement = true,
        });
    
        var defaultVersion = new AliCloud.Esa.Version("default", new()
        {
            SiteId = defaultSite.Id,
            Description = "example",
            OriginVersion = 0,
        });
    
    });
    
    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.Site;
    import com.pulumi.alicloud.esa.SiteArgs;
    import com.pulumi.alicloud.esa.Version;
    import com.pulumi.alicloud.esa.VersionArgs;
    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("bcd72239.com");
            final var default = EsaFunctions.getSites(GetSitesArgs.builder()
                .planSubscribeType("enterpriseplan")
                .build());
    
            var defaultSite = new Site("defaultSite", SiteArgs.builder()
                .siteName(name)
                .instanceId(default_.sites()[0].instanceId())
                .coverage("overseas")
                .accessType("NS")
                .versionManagement(true)
                .build());
    
            var defaultVersion = new Version("defaultVersion", VersionArgs.builder()
                .siteId(defaultSite.id())
                .description("example")
                .originVersion(0)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: bcd72239.com
    resources:
      defaultSite:
        type: alicloud:esa:Site
        name: default
        properties:
          siteName: ${name}
          instanceId: ${default.sites[0].instanceId}
          coverage: overseas
          accessType: NS
          versionManagement: true
      defaultVersion:
        type: alicloud:esa:Version
        name: default
        properties:
          siteId: ${defaultSite.id}
          description: example
          originVersion: '0'
    variables:
      default:
        fn::invoke:
          function: alicloud:esa:getSites
          arguments:
            planSubscribeType: enterpriseplan
    

    Create Version Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Version(name: string, args: VersionArgs, opts?: CustomResourceOptions);
    @overload
    def Version(resource_name: str,
                args: VersionArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Version(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                origin_version: Optional[int] = None,
                site_id: Optional[int] = None,
                description: Optional[str] = None)
    func NewVersion(ctx *Context, name string, args VersionArgs, opts ...ResourceOption) (*Version, error)
    public Version(string name, VersionArgs args, CustomResourceOptions? opts = null)
    public Version(String name, VersionArgs args)
    public Version(String name, VersionArgs args, CustomResourceOptions options)
    
    type: alicloud:esa:Version
    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 VersionArgs
    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 VersionArgs
    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 VersionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VersionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VersionArgs
    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 versionResource = new AliCloud.Esa.Version("versionResource", new()
    {
        OriginVersion = 0,
        SiteId = 0,
        Description = "string",
    });
    
    example, err := esa.NewVersion(ctx, "versionResource", &esa.VersionArgs{
    	OriginVersion: pulumi.Int(0),
    	SiteId:        pulumi.Int(0),
    	Description:   pulumi.String("string"),
    })
    
    var versionResource = new Version("versionResource", VersionArgs.builder()
        .originVersion(0)
        .siteId(0)
        .description("string")
        .build());
    
    version_resource = alicloud.esa.Version("versionResource",
        origin_version=0,
        site_id=0,
        description="string")
    
    const versionResource = new alicloud.esa.Version("versionResource", {
        originVersion: 0,
        siteId: 0,
        description: "string",
    });
    
    type: alicloud:esa:Version
    properties:
        description: string
        originVersion: 0
        siteId: 0
    

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

    OriginVersion int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    SiteId int
    The site ID, which can be obtained by calling the ListSites API.
    Description string
    The Site version's description.
    OriginVersion int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    SiteId int
    The site ID, which can be obtained by calling the ListSites API.
    Description string
    The Site version's description.
    originVersion Integer
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    siteId Integer
    The site ID, which can be obtained by calling the ListSites API.
    description String
    The Site version's description.
    originVersion number
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    siteId number
    The site ID, which can be obtained by calling the ListSites API.
    description string
    The Site version's description.
    origin_version int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    site_id int
    The site ID, which can be obtained by calling the ListSites API.
    description str
    The Site version's description.
    originVersion Number
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    siteId Number
    The site ID, which can be obtained by calling the ListSites API.
    description String
    The Site version's description.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Version resource produces the following output properties:

    CreateTime string
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    Id string
    The provider-assigned unique ID for this managed resource.
    SiteVersion int
    The version number of the site configuration.
    Status string
    Site version status::online.:configuring._faildconfigure_faild`.
    CreateTime string
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    Id string
    The provider-assigned unique ID for this managed resource.
    SiteVersion int
    The version number of the site configuration.
    Status string
    Site version status::online.:configuring._faildconfigure_faild`.
    createTime String
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    id String
    The provider-assigned unique ID for this managed resource.
    siteVersion Integer
    The version number of the site configuration.
    status String
    Site version status::online.:configuring._faildconfigure_faild`.
    createTime string
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    id string
    The provider-assigned unique ID for this managed resource.
    siteVersion number
    The version number of the site configuration.
    status string
    Site version status::online.:configuring._faildconfigure_faild`.
    create_time str
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    id str
    The provider-assigned unique ID for this managed resource.
    site_version int
    The version number of the site configuration.
    status str
    Site version status::online.:configuring._faildconfigure_faild`.
    createTime String
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    id String
    The provider-assigned unique ID for this managed resource.
    siteVersion Number
    The version number of the site configuration.
    status String
    Site version status::online.:configuring._faildconfigure_faild`.

    Look up Existing Version Resource

    Get an existing Version 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?: VersionState, opts?: CustomResourceOptions): Version
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            origin_version: Optional[int] = None,
            site_id: Optional[int] = None,
            site_version: Optional[int] = None,
            status: Optional[str] = None) -> Version
    func GetVersion(ctx *Context, name string, id IDInput, state *VersionState, opts ...ResourceOption) (*Version, error)
    public static Version Get(string name, Input<string> id, VersionState? state, CustomResourceOptions? opts = null)
    public static Version get(String name, Output<String> id, VersionState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:esa:Version    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.
    The following state arguments are supported:
    CreateTime string
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    Description string
    The Site version's description.
    OriginVersion int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    SiteId int
    The site ID, which can be obtained by calling the ListSites API.
    SiteVersion int
    The version number of the site configuration.
    Status string
    Site version status::online.:configuring._faildconfigure_faild`.
    CreateTime string
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    Description string
    The Site version's description.
    OriginVersion int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    SiteId int
    The site ID, which can be obtained by calling the ListSites API.
    SiteVersion int
    The version number of the site configuration.
    Status string
    Site version status::online.:configuring._faildconfigure_faild`.
    createTime String
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    description String
    The Site version's description.
    originVersion Integer
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    siteId Integer
    The site ID, which can be obtained by calling the ListSites API.
    siteVersion Integer
    The version number of the site configuration.
    status String
    Site version status::online.:configuring._faildconfigure_faild`.
    createTime string
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    description string
    The Site version's description.
    originVersion number
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    siteId number
    The site ID, which can be obtained by calling the ListSites API.
    siteVersion number
    The version number of the site configuration.
    status string
    Site version status::online.:configuring._faildconfigure_faild`.
    create_time str
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    description str
    The Site version's description.
    origin_version int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    site_id int
    The site ID, which can be obtained by calling the ListSites API.
    site_version int
    The version number of the site configuration.
    status str
    Site version status::online.:configuring._faildconfigure_faild`.
    createTime String
    The creation time. The date format follows ISO8601 notation and uses UTC time. The format is yyyy-MM-ddTHH:mm:ssZ.
    description String
    The Site version's description.
    originVersion Number
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    siteId Number
    The site ID, which can be obtained by calling the ListSites API.
    siteVersion Number
    The version number of the site configuration.
    status String
    Site version status::online.:configuring._faildconfigure_faild`.

    Import

    ESA Site Version can be imported using the id, e.g.

    $ pulumi import alicloud:esa/version:Version example <site_id>:<site_version>
    

    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.
    alicloud logo
    Alibaba Cloud v3.83.0 published on Monday, Jul 21, 2025 by Pulumi