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

alicloud.edas.DeployGroup

Explore with Pulumi AI

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

    Provides an EDAS deploy group resource, see What is EDAS Deploy Group.

    NOTE: Available since v1.82.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") || "tf-example";
    const defaultInteger = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const default = alicloud.getRegions({
        current: true,
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: `${name}-${defaultInteger.result}`,
        cidrBlock: "10.4.0.0/16",
    });
    const defaultCluster = new alicloud.edas.Cluster("default", {
        clusterName: `${name}-${defaultInteger.result}`,
        clusterType: 2,
        networkMode: 2,
        logicalRegionId: _default.then(_default => _default.regions?.[0]?.id),
        vpcId: defaultNetwork.id,
    });
    const defaultApplication = new alicloud.edas.Application("default", {
        applicationName: `${name}-${defaultInteger.result}`,
        clusterId: defaultCluster.id,
        packageType: "JAR",
    });
    const defaultDeployGroup = new alicloud.edas.DeployGroup("default", {
        appId: defaultApplication.id,
        groupName: `${name}-${defaultInteger.result}`,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default_integer = random.index.Integer("default",
        min=10000,
        max=99999)
    default = alicloud.get_regions(current=True)
    default_network = alicloud.vpc.Network("default",
        vpc_name=f"{name}-{default_integer['result']}",
        cidr_block="10.4.0.0/16")
    default_cluster = alicloud.edas.Cluster("default",
        cluster_name=f"{name}-{default_integer['result']}",
        cluster_type=2,
        network_mode=2,
        logical_region_id=default.regions[0].id,
        vpc_id=default_network.id)
    default_application = alicloud.edas.Application("default",
        application_name=f"{name}-{default_integer['result']}",
        cluster_id=default_cluster.id,
        package_type="JAR")
    default_deploy_group = alicloud.edas.DeployGroup("default",
        app_id=default_application.id,
        group_name=f"{name}-{default_integer['result']}")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/edas"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"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 := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		_default, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultCluster, err := edas.NewCluster(ctx, "default", &edas.ClusterArgs{
    			ClusterName:     pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			ClusterType:     pulumi.Int(2),
    			NetworkMode:     pulumi.Int(2),
    			LogicalRegionId: pulumi.String(_default.Regions[0].Id),
    			VpcId:           defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultApplication, err := edas.NewApplication(ctx, "default", &edas.ApplicationArgs{
    			ApplicationName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			ClusterId:       defaultCluster.ID(),
    			PackageType:     pulumi.String("JAR"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = edas.NewDeployGroup(ctx, "default", &edas.DeployGroupArgs{
    			AppId:     defaultApplication.ID(),
    			GroupName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    		})
    		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") ?? "tf-example";
        var defaultInteger = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var @default = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = $"{name}-{defaultInteger.Result}",
            CidrBlock = "10.4.0.0/16",
        });
    
        var defaultCluster = new AliCloud.Edas.Cluster("default", new()
        {
            ClusterName = $"{name}-{defaultInteger.Result}",
            ClusterType = 2,
            NetworkMode = 2,
            LogicalRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
            VpcId = defaultNetwork.Id,
        });
    
        var defaultApplication = new AliCloud.Edas.Application("default", new()
        {
            ApplicationName = $"{name}-{defaultInteger.Result}",
            ClusterId = defaultCluster.Id,
            PackageType = "JAR",
        });
    
        var defaultDeployGroup = new AliCloud.Edas.DeployGroup("default", new()
        {
            AppId = defaultApplication.Id,
            GroupName = $"{name}-{defaultInteger.Result}",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetRegionsArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.edas.Cluster;
    import com.pulumi.alicloud.edas.ClusterArgs;
    import com.pulumi.alicloud.edas.Application;
    import com.pulumi.alicloud.edas.ApplicationArgs;
    import com.pulumi.alicloud.edas.DeployGroup;
    import com.pulumi.alicloud.edas.DeployGroupArgs;
    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("tf-example");
            var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
                .min(10000)
                .max(99999)
                .build());
    
            final var default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(String.format("%s-%s", name,defaultInteger.result()))
                .cidrBlock("10.4.0.0/16")
                .build());
    
            var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
                .clusterName(String.format("%s-%s", name,defaultInteger.result()))
                .clusterType("2")
                .networkMode("2")
                .logicalRegionId(default_.regions()[0].id())
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultApplication = new Application("defaultApplication", ApplicationArgs.builder()
                .applicationName(String.format("%s-%s", name,defaultInteger.result()))
                .clusterId(defaultCluster.id())
                .packageType("JAR")
                .build());
    
            var defaultDeployGroup = new DeployGroup("defaultDeployGroup", DeployGroupArgs.builder()
                .appId(defaultApplication.id())
                .groupName(String.format("%s-%s", name,defaultInteger.result()))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultInteger:
        type: random:integer
        name: default
        properties:
          min: 10000
          max: 99999
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}-${defaultInteger.result}
          cidrBlock: 10.4.0.0/16
      defaultCluster:
        type: alicloud:edas:Cluster
        name: default
        properties:
          clusterName: ${name}-${defaultInteger.result}
          clusterType: '2'
          networkMode: '2'
          logicalRegionId: ${default.regions[0].id}
          vpcId: ${defaultNetwork.id}
      defaultApplication:
        type: alicloud:edas:Application
        name: default
        properties:
          applicationName: ${name}-${defaultInteger.result}
          clusterId: ${defaultCluster.id}
          packageType: JAR
      defaultDeployGroup:
        type: alicloud:edas:DeployGroup
        name: default
        properties:
          appId: ${defaultApplication.id}
          groupName: ${name}-${defaultInteger.result}
    variables:
      default:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
    

    Create DeployGroup Resource

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

    Constructor syntax

    new DeployGroup(name: string, args: DeployGroupArgs, opts?: CustomResourceOptions);
    @overload
    def DeployGroup(resource_name: str,
                    args: DeployGroupArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def DeployGroup(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    app_id: Optional[str] = None,
                    group_name: Optional[str] = None)
    func NewDeployGroup(ctx *Context, name string, args DeployGroupArgs, opts ...ResourceOption) (*DeployGroup, error)
    public DeployGroup(string name, DeployGroupArgs args, CustomResourceOptions? opts = null)
    public DeployGroup(String name, DeployGroupArgs args)
    public DeployGroup(String name, DeployGroupArgs args, CustomResourceOptions options)
    
    type: alicloud:edas:DeployGroup
    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 DeployGroupArgs
    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 DeployGroupArgs
    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 DeployGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeployGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeployGroupArgs
    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 deployGroupResource = new AliCloud.Edas.DeployGroup("deployGroupResource", new()
    {
        AppId = "string",
        GroupName = "string",
    });
    
    example, err := edas.NewDeployGroup(ctx, "deployGroupResource", &edas.DeployGroupArgs{
    	AppId:     pulumi.String("string"),
    	GroupName: pulumi.String("string"),
    })
    
    var deployGroupResource = new DeployGroup("deployGroupResource", DeployGroupArgs.builder()
        .appId("string")
        .groupName("string")
        .build());
    
    deploy_group_resource = alicloud.edas.DeployGroup("deployGroupResource",
        app_id="string",
        group_name="string")
    
    const deployGroupResource = new alicloud.edas.DeployGroup("deployGroupResource", {
        appId: "string",
        groupName: "string",
    });
    
    type: alicloud:edas:DeployGroup
    properties:
        appId: string
        groupName: string
    

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

    AppId string
    The ID of the application that you want to deploy.
    GroupName string
    The name of the instance group that you want to create.
    AppId string
    The ID of the application that you want to deploy.
    GroupName string
    The name of the instance group that you want to create.
    appId String
    The ID of the application that you want to deploy.
    groupName String
    The name of the instance group that you want to create.
    appId string
    The ID of the application that you want to deploy.
    groupName string
    The name of the instance group that you want to create.
    app_id str
    The ID of the application that you want to deploy.
    group_name str
    The name of the instance group that you want to create.
    appId String
    The ID of the application that you want to deploy.
    groupName String
    The name of the instance group that you want to create.

    Outputs

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

    GroupType int
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    Id string
    The provider-assigned unique ID for this managed resource.
    GroupType int
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    Id string
    The provider-assigned unique ID for this managed resource.
    groupType Integer
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    id String
    The provider-assigned unique ID for this managed resource.
    groupType number
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    id string
    The provider-assigned unique ID for this managed resource.
    group_type int
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    id str
    The provider-assigned unique ID for this managed resource.
    groupType Number
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DeployGroup Resource

    Get an existing DeployGroup 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?: DeployGroupState, opts?: CustomResourceOptions): DeployGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            group_name: Optional[str] = None,
            group_type: Optional[int] = None) -> DeployGroup
    func GetDeployGroup(ctx *Context, name string, id IDInput, state *DeployGroupState, opts ...ResourceOption) (*DeployGroup, error)
    public static DeployGroup Get(string name, Input<string> id, DeployGroupState? state, CustomResourceOptions? opts = null)
    public static DeployGroup get(String name, Output<String> id, DeployGroupState 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:
    AppId string
    The ID of the application that you want to deploy.
    GroupName string
    The name of the instance group that you want to create.
    GroupType int
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    AppId string
    The ID of the application that you want to deploy.
    GroupName string
    The name of the instance group that you want to create.
    GroupType int
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    appId String
    The ID of the application that you want to deploy.
    groupName String
    The name of the instance group that you want to create.
    groupType Integer
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    appId string
    The ID of the application that you want to deploy.
    groupName string
    The name of the instance group that you want to create.
    groupType number
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    app_id str
    The ID of the application that you want to deploy.
    group_name str
    The name of the instance group that you want to create.
    group_type int
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.
    appId String
    The ID of the application that you want to deploy.
    groupName String
    The name of the instance group that you want to create.
    groupType Number
    The type of the instance group that you want to create. Valid values: 0: Default group. 1: Phased release is disabled for traffic management. 2: Phased release is enabled for traffic management.

    Import

    EDAS deploy group can be imported using the id, e.g.

    $ pulumi import alicloud:edas/deployGroup:DeployGroup group app_id:group_name:group_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