1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. EdgeContainerAppRecord
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.esa.EdgeContainerAppRecord

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

    Provides a ESA Edge Container App Record resource.

    For information about ESA Edge Container App Record and how to use it, see What is Edge Container App Record.

    NOTE: Available since v1.247.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.com";
    const _default = alicloud.esa.getSites({
        planSubscribeType: "enterpriseplan",
    });
    const resourceSiteOriginPoolTest = new alicloud.esa.Site("resource_Site_OriginPool_test", {
        siteName: name,
        instanceId: _default.then(_default => _default.sites?.[0]?.instanceId),
        coverage: "overseas",
        accessType: "NS",
    });
    const defaultEdgeContainerApp = new alicloud.esa.EdgeContainerApp("default", {
        healthCheckHost: "example.com",
        healthCheckType: "l7",
        servicePort: 80,
        healthCheckInterval: 5,
        edgeContainerAppName: "terraform-app",
        healthCheckHttpCode: "http_2xx",
        healthCheckUri: "/",
        healthCheckTimeout: 3,
        healthCheckSuccTimes: 2,
        remarks: name,
        healthCheckMethod: "HEAD",
        healthCheckPort: 80,
        healthCheckFailTimes: 5,
        targetPort: 3000,
    });
    const defaultEdgeContainerAppRecord = new alicloud.esa.EdgeContainerAppRecord("default", {
        recordName: "tf.terraform.com",
        siteId: resourceSiteOriginPoolTest.id,
        appId: defaultEdgeContainerApp.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform.com"
    default = alicloud.esa.get_sites(plan_subscribe_type="enterpriseplan")
    resource_site_origin_pool_test = alicloud.esa.Site("resource_Site_OriginPool_test",
        site_name=name,
        instance_id=default.sites[0].instance_id,
        coverage="overseas",
        access_type="NS")
    default_edge_container_app = alicloud.esa.EdgeContainerApp("default",
        health_check_host="example.com",
        health_check_type="l7",
        service_port=80,
        health_check_interval=5,
        edge_container_app_name="terraform-app",
        health_check_http_code="http_2xx",
        health_check_uri="/",
        health_check_timeout=3,
        health_check_succ_times=2,
        remarks=name,
        health_check_method="HEAD",
        health_check_port=80,
        health_check_fail_times=5,
        target_port=3000)
    default_edge_container_app_record = alicloud.esa.EdgeContainerAppRecord("default",
        record_name="tf.terraform.com",
        site_id=resource_site_origin_pool_test.id,
        app_id=default_edge_container_app.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.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
    		}
    		resourceSiteOriginPoolTest, err := esa.NewSite(ctx, "resource_Site_OriginPool_test", &esa.SiteArgs{
    			SiteName:   pulumi.String(name),
    			InstanceId: pulumi.String(_default.Sites[0].InstanceId),
    			Coverage:   pulumi.String("overseas"),
    			AccessType: pulumi.String("NS"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultEdgeContainerApp, err := esa.NewEdgeContainerApp(ctx, "default", &esa.EdgeContainerAppArgs{
    			HealthCheckHost:      pulumi.String("example.com"),
    			HealthCheckType:      pulumi.String("l7"),
    			ServicePort:          pulumi.Int(80),
    			HealthCheckInterval:  pulumi.Int(5),
    			EdgeContainerAppName: pulumi.String("terraform-app"),
    			HealthCheckHttpCode:  pulumi.String("http_2xx"),
    			HealthCheckUri:       pulumi.String("/"),
    			HealthCheckTimeout:   pulumi.Int(3),
    			HealthCheckSuccTimes: pulumi.Int(2),
    			Remarks:              pulumi.String(name),
    			HealthCheckMethod:    pulumi.String("HEAD"),
    			HealthCheckPort:      pulumi.Int(80),
    			HealthCheckFailTimes: pulumi.Int(5),
    			TargetPort:           pulumi.Int(3000),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = esa.NewEdgeContainerAppRecord(ctx, "default", &esa.EdgeContainerAppRecordArgs{
    			RecordName: pulumi.String("tf.terraform.com"),
    			SiteId:     resourceSiteOriginPoolTest.ID(),
    			AppId:      defaultEdgeContainerApp.ID(),
    		})
    		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.com";
        var @default = AliCloud.Esa.GetSites.Invoke(new()
        {
            PlanSubscribeType = "enterpriseplan",
        });
    
        var resourceSiteOriginPoolTest = new AliCloud.Esa.Site("resource_Site_OriginPool_test", new()
        {
            SiteName = name,
            InstanceId = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.InstanceId)),
            Coverage = "overseas",
            AccessType = "NS",
        });
    
        var defaultEdgeContainerApp = new AliCloud.Esa.EdgeContainerApp("default", new()
        {
            HealthCheckHost = "example.com",
            HealthCheckType = "l7",
            ServicePort = 80,
            HealthCheckInterval = 5,
            EdgeContainerAppName = "terraform-app",
            HealthCheckHttpCode = "http_2xx",
            HealthCheckUri = "/",
            HealthCheckTimeout = 3,
            HealthCheckSuccTimes = 2,
            Remarks = name,
            HealthCheckMethod = "HEAD",
            HealthCheckPort = 80,
            HealthCheckFailTimes = 5,
            TargetPort = 3000,
        });
    
        var defaultEdgeContainerAppRecord = new AliCloud.Esa.EdgeContainerAppRecord("default", new()
        {
            RecordName = "tf.terraform.com",
            SiteId = resourceSiteOriginPoolTest.Id,
            AppId = defaultEdgeContainerApp.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.Site;
    import com.pulumi.alicloud.esa.SiteArgs;
    import com.pulumi.alicloud.esa.EdgeContainerApp;
    import com.pulumi.alicloud.esa.EdgeContainerAppArgs;
    import com.pulumi.alicloud.esa.EdgeContainerAppRecord;
    import com.pulumi.alicloud.esa.EdgeContainerAppRecordArgs;
    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.com");
            final var default = EsaFunctions.getSites(GetSitesArgs.builder()
                .planSubscribeType("enterpriseplan")
                .build());
    
            var resourceSiteOriginPoolTest = new Site("resourceSiteOriginPoolTest", SiteArgs.builder()
                .siteName(name)
                .instanceId(default_.sites()[0].instanceId())
                .coverage("overseas")
                .accessType("NS")
                .build());
    
            var defaultEdgeContainerApp = new EdgeContainerApp("defaultEdgeContainerApp", EdgeContainerAppArgs.builder()
                .healthCheckHost("example.com")
                .healthCheckType("l7")
                .servicePort("80")
                .healthCheckInterval("5")
                .edgeContainerAppName("terraform-app")
                .healthCheckHttpCode("http_2xx")
                .healthCheckUri("/")
                .healthCheckTimeout("3")
                .healthCheckSuccTimes("2")
                .remarks(name)
                .healthCheckMethod("HEAD")
                .healthCheckPort("80")
                .healthCheckFailTimes("5")
                .targetPort("3000")
                .build());
    
            var defaultEdgeContainerAppRecord = new EdgeContainerAppRecord("defaultEdgeContainerAppRecord", EdgeContainerAppRecordArgs.builder()
                .recordName("tf.terraform.com")
                .siteId(resourceSiteOriginPoolTest.id())
                .appId(defaultEdgeContainerApp.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform.com
    resources:
      resourceSiteOriginPoolTest:
        type: alicloud:esa:Site
        name: resource_Site_OriginPool_test
        properties:
          siteName: ${name}
          instanceId: ${default.sites[0].instanceId}
          coverage: overseas
          accessType: NS
      defaultEdgeContainerApp:
        type: alicloud:esa:EdgeContainerApp
        name: default
        properties:
          healthCheckHost: example.com
          healthCheckType: l7
          servicePort: '80'
          healthCheckInterval: '5'
          edgeContainerAppName: terraform-app
          healthCheckHttpCode: http_2xx
          healthCheckUri: /
          healthCheckTimeout: '3'
          healthCheckSuccTimes: '2'
          remarks: ${name}
          healthCheckMethod: HEAD
          healthCheckPort: '80'
          healthCheckFailTimes: '5'
          targetPort: '3000'
      defaultEdgeContainerAppRecord:
        type: alicloud:esa:EdgeContainerAppRecord
        name: default
        properties:
          recordName: tf.terraform.com
          siteId: ${resourceSiteOriginPoolTest.id}
          appId: ${defaultEdgeContainerApp.id}
    variables:
      default:
        fn::invoke:
          function: alicloud:esa:getSites
          arguments:
            planSubscribeType: enterpriseplan
    

    Create EdgeContainerAppRecord Resource

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

    Constructor syntax

    new EdgeContainerAppRecord(name: string, args: EdgeContainerAppRecordArgs, opts?: CustomResourceOptions);
    @overload
    def EdgeContainerAppRecord(resource_name: str,
                               args: EdgeContainerAppRecordArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def EdgeContainerAppRecord(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               app_id: Optional[str] = None,
                               record_name: Optional[str] = None,
                               site_id: Optional[int] = None)
    func NewEdgeContainerAppRecord(ctx *Context, name string, args EdgeContainerAppRecordArgs, opts ...ResourceOption) (*EdgeContainerAppRecord, error)
    public EdgeContainerAppRecord(string name, EdgeContainerAppRecordArgs args, CustomResourceOptions? opts = null)
    public EdgeContainerAppRecord(String name, EdgeContainerAppRecordArgs args)
    public EdgeContainerAppRecord(String name, EdgeContainerAppRecordArgs args, CustomResourceOptions options)
    
    type: alicloud:esa:EdgeContainerAppRecord
    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 EdgeContainerAppRecordArgs
    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 EdgeContainerAppRecordArgs
    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 EdgeContainerAppRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EdgeContainerAppRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EdgeContainerAppRecordArgs
    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 edgeContainerAppRecordResource = new AliCloud.Esa.EdgeContainerAppRecord("edgeContainerAppRecordResource", new()
    {
        AppId = "string",
        RecordName = "string",
        SiteId = 0,
    });
    
    example, err := esa.NewEdgeContainerAppRecord(ctx, "edgeContainerAppRecordResource", &esa.EdgeContainerAppRecordArgs{
    	AppId:      pulumi.String("string"),
    	RecordName: pulumi.String("string"),
    	SiteId:     pulumi.Int(0),
    })
    
    var edgeContainerAppRecordResource = new EdgeContainerAppRecord("edgeContainerAppRecordResource", EdgeContainerAppRecordArgs.builder()
        .appId("string")
        .recordName("string")
        .siteId(0)
        .build());
    
    edge_container_app_record_resource = alicloud.esa.EdgeContainerAppRecord("edgeContainerAppRecordResource",
        app_id="string",
        record_name="string",
        site_id=0)
    
    const edgeContainerAppRecordResource = new alicloud.esa.EdgeContainerAppRecord("edgeContainerAppRecordResource", {
        appId: "string",
        recordName: "string",
        siteId: 0,
    });
    
    type: alicloud:esa:EdgeContainerAppRecord
    properties:
        appId: string
        recordName: string
        siteId: 0
    

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

    AppId string
    The application ID
    RecordName string
    The associated domain name.
    SiteId int
    The website ID.
    AppId string
    The application ID
    RecordName string
    The associated domain name.
    SiteId int
    The website ID.
    appId String
    The application ID
    recordName String
    The associated domain name.
    siteId Integer
    The website ID.
    appId string
    The application ID
    recordName string
    The associated domain name.
    siteId number
    The website ID.
    app_id str
    The application ID
    record_name str
    The associated domain name.
    site_id int
    The website ID.
    appId String
    The application ID
    recordName String
    The associated domain name.
    siteId Number
    The website ID.

    Outputs

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

    CreateTime string
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreateTime string
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    createTime String
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    createTime string
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    id string
    The provider-assigned unique ID for this managed resource.
    create_time str
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    id str
    The provider-assigned unique ID for this managed resource.
    createTime String
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing EdgeContainerAppRecord Resource

    Get an existing EdgeContainerAppRecord 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?: EdgeContainerAppRecordState, opts?: CustomResourceOptions): EdgeContainerAppRecord
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            create_time: Optional[str] = None,
            record_name: Optional[str] = None,
            site_id: Optional[int] = None) -> EdgeContainerAppRecord
    func GetEdgeContainerAppRecord(ctx *Context, name string, id IDInput, state *EdgeContainerAppRecordState, opts ...ResourceOption) (*EdgeContainerAppRecord, error)
    public static EdgeContainerAppRecord Get(string name, Input<string> id, EdgeContainerAppRecordState? state, CustomResourceOptions? opts = null)
    public static EdgeContainerAppRecord get(String name, Output<String> id, EdgeContainerAppRecordState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:esa:EdgeContainerAppRecord    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:
    AppId string
    The application ID
    CreateTime string
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    RecordName string
    The associated domain name.
    SiteId int
    The website ID.
    AppId string
    The application ID
    CreateTime string
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    RecordName string
    The associated domain name.
    SiteId int
    The website ID.
    appId String
    The application ID
    createTime String
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    recordName String
    The associated domain name.
    siteId Integer
    The website ID.
    appId string
    The application ID
    createTime string
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    recordName string
    The associated domain name.
    siteId number
    The website ID.
    app_id str
    The application ID
    create_time str
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    record_name str
    The associated domain name.
    site_id int
    The website ID.
    appId String
    The application ID
    createTime String
    The time when the domain name was added. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.
    recordName String
    The associated domain name.
    siteId Number
    The website ID.

    Import

    ESA Edge Container App Record can be imported using the id, e.g.

    $ pulumi import alicloud:esa/edgeContainerAppRecord:EdgeContainerAppRecord example <site_id>:<app_id>:<record_name>
    

    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.76.0 published on Tuesday, Apr 8, 2025 by Pulumi