1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. edas
  5. DeployGroup
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.edas.DeployGroup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 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 defaultRandomInteger = new random.RandomInteger("defaultRandomInteger", {
        min: 10000,
        max: 99999,
    });
    const defaultRegions = alicloud.getRegions({
        current: true,
    });
    const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
        vpcName: pulumi.interpolate`${name}-${defaultRandomInteger.result}`,
        cidrBlock: "10.4.0.0/16",
    });
    const defaultCluster = new alicloud.edas.Cluster("defaultCluster", {
        clusterName: pulumi.interpolate`${name}-${defaultRandomInteger.result}`,
        clusterType: 2,
        networkMode: 2,
        logicalRegionId: defaultRegions.then(defaultRegions => defaultRegions.regions?.[0]?.id),
        vpcId: defaultNetwork.id,
    });
    const defaultApplication = new alicloud.edas.Application("defaultApplication", {
        applicationName: pulumi.interpolate`${name}-${defaultRandomInteger.result}`,
        clusterId: defaultCluster.id,
        packageType: "JAR",
    });
    const defaultDeployGroup = new alicloud.edas.DeployGroup("defaultDeployGroup", {
        appId: defaultApplication.id,
        groupName: pulumi.interpolate`${name}-${defaultRandomInteger.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_random_integer = random.RandomInteger("defaultRandomInteger",
        min=10000,
        max=99999)
    default_regions = alicloud.get_regions(current=True)
    default_network = alicloud.vpc.Network("defaultNetwork",
        vpc_name=default_random_integer.result.apply(lambda result: f"{name}-{result}"),
        cidr_block="10.4.0.0/16")
    default_cluster = alicloud.edas.Cluster("defaultCluster",
        cluster_name=default_random_integer.result.apply(lambda result: f"{name}-{result}"),
        cluster_type=2,
        network_mode=2,
        logical_region_id=default_regions.regions[0].id,
        vpc_id=default_network.id)
    default_application = alicloud.edas.Application("defaultApplication",
        application_name=default_random_integer.result.apply(lambda result: f"{name}-{result}"),
        cluster_id=default_cluster.id,
        package_type="JAR")
    default_deploy_group = alicloud.edas.DeployGroup("defaultDeployGroup",
        app_id=default_application.id,
        group_name=default_random_integer.result.apply(lambda result: f"{name}-{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
    		}
    		defaultRandomInteger, err := random.NewRandomInteger(ctx, "defaultRandomInteger", &random.RandomIntegerArgs{
    			Min: pulumi.Int(10000),
    			Max: pulumi.Int(99999),
    		})
    		if err != nil {
    			return err
    		}
    		defaultRegions, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
    			VpcName: defaultRandomInteger.Result.ApplyT(func(result int) (string, error) {
    				return fmt.Sprintf("%v-%v", name, result), nil
    			}).(pulumi.StringOutput),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultCluster, err := edas.NewCluster(ctx, "defaultCluster", &edas.ClusterArgs{
    			ClusterName: defaultRandomInteger.Result.ApplyT(func(result int) (string, error) {
    				return fmt.Sprintf("%v-%v", name, result), nil
    			}).(pulumi.StringOutput),
    			ClusterType:     pulumi.Int(2),
    			NetworkMode:     pulumi.Int(2),
    			LogicalRegionId: pulumi.String(defaultRegions.Regions[0].Id),
    			VpcId:           defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultApplication, err := edas.NewApplication(ctx, "defaultApplication", &edas.ApplicationArgs{
    			ApplicationName: defaultRandomInteger.Result.ApplyT(func(result int) (string, error) {
    				return fmt.Sprintf("%v-%v", name, result), nil
    			}).(pulumi.StringOutput),
    			ClusterId:   defaultCluster.ID(),
    			PackageType: pulumi.String("JAR"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = edas.NewDeployGroup(ctx, "defaultDeployGroup", &edas.DeployGroupArgs{
    			AppId: defaultApplication.ID(),
    			GroupName: defaultRandomInteger.Result.ApplyT(func(result int) (string, error) {
    				return fmt.Sprintf("%v-%v", name, result), nil
    			}).(pulumi.StringOutput),
    		})
    		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 defaultRandomInteger = new Random.RandomInteger("defaultRandomInteger", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var defaultRegions = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
        {
            VpcName = defaultRandomInteger.Result.Apply(result => $"{name}-{result}"),
            CidrBlock = "10.4.0.0/16",
        });
    
        var defaultCluster = new AliCloud.Edas.Cluster("defaultCluster", new()
        {
            ClusterName = defaultRandomInteger.Result.Apply(result => $"{name}-{result}"),
            ClusterType = 2,
            NetworkMode = 2,
            LogicalRegionId = defaultRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id),
            VpcId = defaultNetwork.Id,
        });
    
        var defaultApplication = new AliCloud.Edas.Application("defaultApplication", new()
        {
            ApplicationName = defaultRandomInteger.Result.Apply(result => $"{name}-{result}"),
            ClusterId = defaultCluster.Id,
            PackageType = "JAR",
        });
    
        var defaultDeployGroup = new AliCloud.Edas.DeployGroup("defaultDeployGroup", new()
        {
            AppId = defaultApplication.Id,
            GroupName = defaultRandomInteger.Result.Apply(result => $"{name}-{result}"),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.RandomInteger;
    import com.pulumi.random.RandomIntegerArgs;
    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 defaultRandomInteger = new RandomInteger("defaultRandomInteger", RandomIntegerArgs.builder()        
                .min(10000)
                .max(99999)
                .build());
    
            final var defaultRegions = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
                .vpcName(defaultRandomInteger.result().applyValue(result -> String.format("%s-%s", name,result)))
                .cidrBlock("10.4.0.0/16")
                .build());
    
            var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()        
                .clusterName(defaultRandomInteger.result().applyValue(result -> String.format("%s-%s", name,result)))
                .clusterType("2")
                .networkMode("2")
                .logicalRegionId(defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()))
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultApplication = new Application("defaultApplication", ApplicationArgs.builder()        
                .applicationName(defaultRandomInteger.result().applyValue(result -> String.format("%s-%s", name,result)))
                .clusterId(defaultCluster.id())
                .packageType("JAR")
                .build());
    
            var defaultDeployGroup = new DeployGroup("defaultDeployGroup", DeployGroupArgs.builder()        
                .appId(defaultApplication.id())
                .groupName(defaultRandomInteger.result().applyValue(result -> String.format("%s-%s", name,result)))
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultRandomInteger:
        type: random:RandomInteger
        properties:
          min: 10000
          max: 99999
      defaultNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${name}-${defaultRandomInteger.result}
          cidrBlock: 10.4.0.0/16
      defaultCluster:
        type: alicloud:edas:Cluster
        properties:
          clusterName: ${name}-${defaultRandomInteger.result}
          clusterType: '2'
          networkMode: '2'
          logicalRegionId: ${defaultRegions.regions[0].id}
          vpcId: ${defaultNetwork.id}
      defaultApplication:
        type: alicloud:edas:Application
        properties:
          applicationName: ${name}-${defaultRandomInteger.result}
          clusterId: ${defaultCluster.id}
          packageType: JAR
      defaultDeployGroup:
        type: alicloud:edas:DeployGroup
        properties:
          appId: ${defaultApplication.id}
          groupName: ${name}-${defaultRandomInteger.result}
    variables:
      defaultRegions:
        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.

    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

    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.53.0 published on Wednesday, Apr 17, 2024 by Pulumi