1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. Site
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.esa.Site

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a ESA Site resource.

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

    NOTE: Available since v1.234.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const default = alicloud.resourcemanager.getResourceGroups({});
    const defaultIEoDfU = new alicloud.esa.RatePlanInstance("defaultIEoDfU", {
        type: "NS",
        autoRenew: true,
        period: 1,
        paymentType: "Subscription",
        coverage: "overseas",
        autoPay: true,
        planName: "basic",
    });
    const defaultInteger = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const defaultSite = new alicloud.esa.Site("default", {
        siteName: `bcd${defaultInteger.result}.com`,
        coverage: "overseas",
        accessType: "NS",
        instanceId: defaultIEoDfU.id,
        resourceGroupId: _default.then(_default => _default.ids?.[0]),
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.resourcemanager.get_resource_groups()
    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_integer = random.index.Integer("default",
        min=10000,
        max=99999)
    default_site = alicloud.esa.Site("default",
        site_name=f"bcd{default_integer['result']}.com",
        coverage="overseas",
        access_type="NS",
        instance_id=default_i_eo_df_u.id,
        resource_group_id=default.ids[0])
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"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 := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		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
    		}
    		defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = esa.NewSite(ctx, "default", &esa.SiteArgs{
    			SiteName:        pulumi.Sprintf("bcd%v.com", defaultInteger.Result),
    			Coverage:        pulumi.String("overseas"),
    			AccessType:      pulumi.String("NS"),
    			InstanceId:      defaultIEoDfU.ID(),
    			ResourceGroupId: pulumi.String(_default.Ids[0]),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke();
    
        var defaultIEoDfU = new AliCloud.Esa.RatePlanInstance("defaultIEoDfU", new()
        {
            Type = "NS",
            AutoRenew = true,
            Period = 1,
            PaymentType = "Subscription",
            Coverage = "overseas",
            AutoPay = true,
            PlanName = "basic",
        });
    
        var defaultInteger = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var defaultSite = new AliCloud.Esa.Site("default", new()
        {
            SiteName = $"bcd{defaultInteger.Result}.com",
            Coverage = "overseas",
            AccessType = "NS",
            InstanceId = defaultIEoDfU.Id,
            ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Ids[0])),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
    import com.pulumi.alicloud.esa.RatePlanInstance;
    import com.pulumi.alicloud.esa.RatePlanInstanceArgs;
    import com.pulumi.random.integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.esa.Site;
    import com.pulumi.alicloud.esa.SiteArgs;
    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");
            final var default = ResourcemanagerFunctions.getResourceGroups();
    
            var defaultIEoDfU = new RatePlanInstance("defaultIEoDfU", RatePlanInstanceArgs.builder()
                .type("NS")
                .autoRenew(true)
                .period("1")
                .paymentType("Subscription")
                .coverage("overseas")
                .autoPay(true)
                .planName("basic")
                .build());
    
            var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
                .min(10000)
                .max(99999)
                .build());
    
            var defaultSite = new Site("defaultSite", SiteArgs.builder()
                .siteName(String.format("bcd%s.com", defaultInteger.result()))
                .coverage("overseas")
                .accessType("NS")
                .instanceId(defaultIEoDfU.id())
                .resourceGroupId(default_.ids()[0])
                .build());
    
        }
    }
    
    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
      defaultInteger:
        type: random:integer
        name: default
        properties:
          min: 10000
          max: 99999
      defaultSite:
        type: alicloud:esa:Site
        name: default
        properties:
          siteName: bcd${defaultInteger.result}.com
          coverage: overseas
          accessType: NS
          instanceId: ${defaultIEoDfU.id}
          resourceGroupId: ${default.ids[0]}
    variables:
      default:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceGroups
          Arguments: {}
    

    Create Site Resource

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

    Constructor syntax

    new Site(name: string, args: SiteArgs, opts?: CustomResourceOptions);
    @overload
    def Site(resource_name: str,
             args: SiteArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Site(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             instance_id: Optional[str] = None,
             site_name: Optional[str] = None,
             access_type: Optional[str] = None,
             coverage: Optional[str] = None,
             resource_group_id: Optional[str] = None,
             tags: Optional[Mapping[str, str]] = None)
    func NewSite(ctx *Context, name string, args SiteArgs, opts ...ResourceOption) (*Site, error)
    public Site(string name, SiteArgs args, CustomResourceOptions? opts = null)
    public Site(String name, SiteArgs args)
    public Site(String name, SiteArgs args, CustomResourceOptions options)
    
    type: alicloud:esa:Site
    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 SiteArgs
    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 SiteArgs
    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 SiteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SiteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SiteArgs
    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 siteResource = new AliCloud.Esa.Site("siteResource", new()
    {
        InstanceId = "string",
        SiteName = "string",
        AccessType = "string",
        Coverage = "string",
        ResourceGroupId = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := esa.NewSite(ctx, "siteResource", &esa.SiteArgs{
    	InstanceId:      pulumi.String("string"),
    	SiteName:        pulumi.String("string"),
    	AccessType:      pulumi.String("string"),
    	Coverage:        pulumi.String("string"),
    	ResourceGroupId: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var siteResource = new Site("siteResource", SiteArgs.builder()
        .instanceId("string")
        .siteName("string")
        .accessType("string")
        .coverage("string")
        .resourceGroupId("string")
        .tags(Map.of("string", "string"))
        .build());
    
    site_resource = alicloud.esa.Site("siteResource",
        instance_id="string",
        site_name="string",
        access_type="string",
        coverage="string",
        resource_group_id="string",
        tags={
            "string": "string",
        })
    
    const siteResource = new alicloud.esa.Site("siteResource", {
        instanceId: "string",
        siteName: "string",
        accessType: "string",
        coverage: "string",
        resourceGroupId: "string",
        tags: {
            string: "string",
        },
    });
    
    type: alicloud:esa:Site
    properties:
        accessType: string
        coverage: string
        instanceId: string
        resourceGroupId: string
        siteName: string
        tags:
            string: string
    

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

    InstanceId string
    The ID of the associated package instance.
    SiteName string
    Site Name
    AccessType string
    Site Access Type
    Coverage string
    Acceleration area
    ResourceGroupId string
    The ID of the resource group
    Tags Dictionary<string, string>
    Resource tags
    InstanceId string
    The ID of the associated package instance.
    SiteName string
    Site Name
    AccessType string
    Site Access Type
    Coverage string
    Acceleration area
    ResourceGroupId string
    The ID of the resource group
    Tags map[string]string
    Resource tags
    instanceId String
    The ID of the associated package instance.
    siteName String
    Site Name
    accessType String
    Site Access Type
    coverage String
    Acceleration area
    resourceGroupId String
    The ID of the resource group
    tags Map<String,String>
    Resource tags
    instanceId string
    The ID of the associated package instance.
    siteName string
    Site Name
    accessType string
    Site Access Type
    coverage string
    Acceleration area
    resourceGroupId string
    The ID of the resource group
    tags {[key: string]: string}
    Resource tags
    instance_id str
    The ID of the associated package instance.
    site_name str
    Site Name
    access_type str
    Site Access Type
    coverage str
    Acceleration area
    resource_group_id str
    The ID of the resource group
    tags Mapping[str, str]
    Resource tags
    instanceId String
    The ID of the associated package instance.
    siteName String
    Site Name
    accessType String
    Site Access Type
    coverage String
    Acceleration area
    resourceGroupId String
    The ID of the resource group
    tags Map<String>
    Resource tags

    Outputs

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

    CreateTime string
    Creation time
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource
    CreateTime string
    Creation time
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource
    createTime String
    Creation time
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource
    createTime string
    Creation time
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the resource
    create_time str
    Creation time
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the resource
    createTime String
    Creation time
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource

    Look up Existing Site Resource

    Get an existing Site 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?: SiteState, opts?: CustomResourceOptions): Site
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_type: Optional[str] = None,
            coverage: Optional[str] = None,
            create_time: Optional[str] = None,
            instance_id: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            site_name: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None) -> Site
    func GetSite(ctx *Context, name string, id IDInput, state *SiteState, opts ...ResourceOption) (*Site, error)
    public static Site Get(string name, Input<string> id, SiteState? state, CustomResourceOptions? opts = null)
    public static Site get(String name, Output<String> id, SiteState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AccessType string
    Site Access Type
    Coverage string
    Acceleration area
    CreateTime string
    Creation time
    InstanceId string
    The ID of the associated package instance.
    ResourceGroupId string
    The ID of the resource group
    SiteName string
    Site Name
    Status string
    The status of the resource
    Tags Dictionary<string, string>
    Resource tags
    AccessType string
    Site Access Type
    Coverage string
    Acceleration area
    CreateTime string
    Creation time
    InstanceId string
    The ID of the associated package instance.
    ResourceGroupId string
    The ID of the resource group
    SiteName string
    Site Name
    Status string
    The status of the resource
    Tags map[string]string
    Resource tags
    accessType String
    Site Access Type
    coverage String
    Acceleration area
    createTime String
    Creation time
    instanceId String
    The ID of the associated package instance.
    resourceGroupId String
    The ID of the resource group
    siteName String
    Site Name
    status String
    The status of the resource
    tags Map<String,String>
    Resource tags
    accessType string
    Site Access Type
    coverage string
    Acceleration area
    createTime string
    Creation time
    instanceId string
    The ID of the associated package instance.
    resourceGroupId string
    The ID of the resource group
    siteName string
    Site Name
    status string
    The status of the resource
    tags {[key: string]: string}
    Resource tags
    access_type str
    Site Access Type
    coverage str
    Acceleration area
    create_time str
    Creation time
    instance_id str
    The ID of the associated package instance.
    resource_group_id str
    The ID of the resource group
    site_name str
    Site Name
    status str
    The status of the resource
    tags Mapping[str, str]
    Resource tags
    accessType String
    Site Access Type
    coverage String
    Acceleration area
    createTime String
    Creation time
    instanceId String
    The ID of the associated package instance.
    resourceGroupId String
    The ID of the resource group
    siteName String
    Site Name
    status String
    The status of the resource
    tags Map<String>
    Resource tags

    Import

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

    $ pulumi import alicloud:esa/site:Site example <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.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi