1. Packages
  2. Alicloud Provider
  3. API Docs
  4. oos
  5. ApplicationGroup
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.oos.ApplicationGroup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    Provides a OOS Application Group resource.

    For information about OOS Application Group and how to use it, see What is Application Group.

    NOTE: Available since v1.146.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 defaultInteger = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const default = alicloud.resourcemanager.getResourceGroups({});
    const defaultApplication = new alicloud.oos.Application("default", {
        resourceGroupId: _default.then(_default => _default.groups?.[0]?.id),
        applicationName: `${name}-${defaultInteger.result}`,
        description: name,
        tags: {
            Created: "TF",
        },
    });
    const defaultGetRegions = alicloud.getRegions({
        current: true,
    });
    const defaultApplicationGroup = new alicloud.oos.ApplicationGroup("default", {
        applicationGroupName: name,
        applicationName: defaultApplication.id,
        deployRegionId: defaultGetRegions.then(defaultGetRegions => defaultGetRegions.regions?.[0]?.id),
        description: name,
        importTagKey: "example_key",
        importTagValue: "example_value",
    });
    
    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_integer = random.index.Integer("default",
        min=10000,
        max=99999)
    default = alicloud.resourcemanager.get_resource_groups()
    default_application = alicloud.oos.Application("default",
        resource_group_id=default.groups[0].id,
        application_name=f"{name}-{default_integer['result']}",
        description=name,
        tags={
            "Created": "TF",
        })
    default_get_regions = alicloud.get_regions(current=True)
    default_application_group = alicloud.oos.ApplicationGroup("default",
        application_group_name=name,
        application_name=default_application.id,
        deploy_region_id=default_get_regions.regions[0].id,
        description=name,
        import_tag_key="example_key",
        import_tag_value="example_value")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oos"
    	"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
    		}
    		defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		_default, err := resourcemanager.GetResourceGroups(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		defaultApplication, err := oos.NewApplication(ctx, "default", &oos.ApplicationArgs{
    			ResourceGroupId: pulumi.String(_default.Groups[0].Id),
    			ApplicationName: pulumi.Sprintf("%v-%v", name, defaultInteger.Result),
    			Description:     pulumi.String(name),
    			Tags: pulumi.StringMap{
    				"Created": pulumi.String("TF"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultGetRegions, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = oos.NewApplicationGroup(ctx, "default", &oos.ApplicationGroupArgs{
    			ApplicationGroupName: pulumi.String(name),
    			ApplicationName:      defaultApplication.ID(),
    			DeployRegionId:       pulumi.String(defaultGetRegions.Regions[0].Id),
    			Description:          pulumi.String(name),
    			ImportTagKey:         pulumi.String("example_key"),
    			ImportTagValue:       pulumi.String("example_value"),
    		})
    		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 defaultInteger = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke();
    
        var defaultApplication = new AliCloud.Oos.Application("default", new()
        {
            ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id)),
            ApplicationName = $"{name}-{defaultInteger.Result}",
            Description = name,
            Tags = 
            {
                { "Created", "TF" },
            },
        });
    
        var defaultGetRegions = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultApplicationGroup = new AliCloud.Oos.ApplicationGroup("default", new()
        {
            ApplicationGroupName = name,
            ApplicationName = defaultApplication.Id,
            DeployRegionId = defaultGetRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id),
            Description = name,
            ImportTagKey = "example_key",
            ImportTagValue = "example_value",
        });
    
    });
    
    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.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
    import com.pulumi.alicloud.oos.Application;
    import com.pulumi.alicloud.oos.ApplicationArgs;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetRegionsArgs;
    import com.pulumi.alicloud.oos.ApplicationGroup;
    import com.pulumi.alicloud.oos.ApplicationGroupArgs;
    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");
            var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
                .min(10000)
                .max(99999)
                .build());
    
            final var default = ResourcemanagerFunctions.getResourceGroups();
    
            var defaultApplication = new Application("defaultApplication", ApplicationArgs.builder()
                .resourceGroupId(default_.groups()[0].id())
                .applicationName(String.format("%s-%s", name,defaultInteger.result()))
                .description(name)
                .tags(Map.of("Created", "TF"))
                .build());
    
            final var defaultGetRegions = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            var defaultApplicationGroup = new ApplicationGroup("defaultApplicationGroup", ApplicationGroupArgs.builder()
                .applicationGroupName(name)
                .applicationName(defaultApplication.id())
                .deployRegionId(defaultGetRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()))
                .description(name)
                .importTagKey("example_key")
                .importTagValue("example_value")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultInteger:
        type: random:integer
        name: default
        properties:
          min: 10000
          max: 99999
      defaultApplication:
        type: alicloud:oos:Application
        name: default
        properties:
          resourceGroupId: ${default.groups[0].id}
          applicationName: ${name}-${defaultInteger.result}
          description: ${name}
          tags:
            Created: TF
      defaultApplicationGroup:
        type: alicloud:oos:ApplicationGroup
        name: default
        properties:
          applicationGroupName: ${name}
          applicationName: ${defaultApplication.id}
          deployRegionId: ${defaultGetRegions.regions[0].id}
          description: ${name}
          importTagKey: example_key
          importTagValue: example_value
    variables:
      default:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceGroups
          Arguments: {}
      defaultGetRegions:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
    

    Create ApplicationGroup Resource

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

    Constructor syntax

    new ApplicationGroup(name: string, args: ApplicationGroupArgs, opts?: CustomResourceOptions);
    @overload
    def ApplicationGroup(resource_name: str,
                         args: ApplicationGroupArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApplicationGroup(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         application_group_name: Optional[str] = None,
                         application_name: Optional[str] = None,
                         deploy_region_id: Optional[str] = None,
                         description: Optional[str] = None,
                         import_tag_key: Optional[str] = None,
                         import_tag_value: Optional[str] = None)
    func NewApplicationGroup(ctx *Context, name string, args ApplicationGroupArgs, opts ...ResourceOption) (*ApplicationGroup, error)
    public ApplicationGroup(string name, ApplicationGroupArgs args, CustomResourceOptions? opts = null)
    public ApplicationGroup(String name, ApplicationGroupArgs args)
    public ApplicationGroup(String name, ApplicationGroupArgs args, CustomResourceOptions options)
    
    type: alicloud:oos:ApplicationGroup
    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 ApplicationGroupArgs
    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 ApplicationGroupArgs
    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 ApplicationGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApplicationGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApplicationGroupArgs
    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 applicationGroupResource = new AliCloud.Oos.ApplicationGroup("applicationGroupResource", new()
    {
        ApplicationGroupName = "string",
        ApplicationName = "string",
        DeployRegionId = "string",
        Description = "string",
        ImportTagKey = "string",
        ImportTagValue = "string",
    });
    
    example, err := oos.NewApplicationGroup(ctx, "applicationGroupResource", &oos.ApplicationGroupArgs{
    	ApplicationGroupName: pulumi.String("string"),
    	ApplicationName:      pulumi.String("string"),
    	DeployRegionId:       pulumi.String("string"),
    	Description:          pulumi.String("string"),
    	ImportTagKey:         pulumi.String("string"),
    	ImportTagValue:       pulumi.String("string"),
    })
    
    var applicationGroupResource = new ApplicationGroup("applicationGroupResource", ApplicationGroupArgs.builder()
        .applicationGroupName("string")
        .applicationName("string")
        .deployRegionId("string")
        .description("string")
        .importTagKey("string")
        .importTagValue("string")
        .build());
    
    application_group_resource = alicloud.oos.ApplicationGroup("applicationGroupResource",
        application_group_name="string",
        application_name="string",
        deploy_region_id="string",
        description="string",
        import_tag_key="string",
        import_tag_value="string")
    
    const applicationGroupResource = new alicloud.oos.ApplicationGroup("applicationGroupResource", {
        applicationGroupName: "string",
        applicationName: "string",
        deployRegionId: "string",
        description: "string",
        importTagKey: "string",
        importTagValue: "string",
    });
    
    type: alicloud:oos:ApplicationGroup
    properties:
        applicationGroupName: string
        applicationName: string
        deployRegionId: string
        description: string
        importTagKey: string
        importTagValue: string
    

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

    ApplicationGroupName string
    The name of the Application group.
    ApplicationName string
    The name of the Application.
    DeployRegionId string
    The region ID of the deployment.
    Description string
    Application group description information.
    ImportTagKey string
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    ImportTagValue string
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    ApplicationGroupName string
    The name of the Application group.
    ApplicationName string
    The name of the Application.
    DeployRegionId string
    The region ID of the deployment.
    Description string
    Application group description information.
    ImportTagKey string
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    ImportTagValue string
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    applicationGroupName String
    The name of the Application group.
    applicationName String
    The name of the Application.
    deployRegionId String
    The region ID of the deployment.
    description String
    Application group description information.
    importTagKey String
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    importTagValue String
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    applicationGroupName string
    The name of the Application group.
    applicationName string
    The name of the Application.
    deployRegionId string
    The region ID of the deployment.
    description string
    Application group description information.
    importTagKey string
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    importTagValue string
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    application_group_name str
    The name of the Application group.
    application_name str
    The name of the Application.
    deploy_region_id str
    The region ID of the deployment.
    description str
    Application group description information.
    import_tag_key str
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    import_tag_value str
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    applicationGroupName String
    The name of the Application group.
    applicationName String
    The name of the Application.
    deployRegionId String
    The region ID of the deployment.
    description String
    Application group description information.
    importTagKey String
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    importTagValue String
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ApplicationGroup Resource

    Get an existing ApplicationGroup 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?: ApplicationGroupState, opts?: CustomResourceOptions): ApplicationGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_group_name: Optional[str] = None,
            application_name: Optional[str] = None,
            deploy_region_id: Optional[str] = None,
            description: Optional[str] = None,
            import_tag_key: Optional[str] = None,
            import_tag_value: Optional[str] = None) -> ApplicationGroup
    func GetApplicationGroup(ctx *Context, name string, id IDInput, state *ApplicationGroupState, opts ...ResourceOption) (*ApplicationGroup, error)
    public static ApplicationGroup Get(string name, Input<string> id, ApplicationGroupState? state, CustomResourceOptions? opts = null)
    public static ApplicationGroup get(String name, Output<String> id, ApplicationGroupState 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:
    ApplicationGroupName string
    The name of the Application group.
    ApplicationName string
    The name of the Application.
    DeployRegionId string
    The region ID of the deployment.
    Description string
    Application group description information.
    ImportTagKey string
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    ImportTagValue string
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    ApplicationGroupName string
    The name of the Application group.
    ApplicationName string
    The name of the Application.
    DeployRegionId string
    The region ID of the deployment.
    Description string
    Application group description information.
    ImportTagKey string
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    ImportTagValue string
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    applicationGroupName String
    The name of the Application group.
    applicationName String
    The name of the Application.
    deployRegionId String
    The region ID of the deployment.
    description String
    Application group description information.
    importTagKey String
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    importTagValue String
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    applicationGroupName string
    The name of the Application group.
    applicationName string
    The name of the Application.
    deployRegionId string
    The region ID of the deployment.
    description string
    Application group description information.
    importTagKey string
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    importTagValue string
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    application_group_name str
    The name of the Application group.
    application_name str
    The name of the Application.
    deploy_region_id str
    The region ID of the deployment.
    description str
    Application group description information.
    import_tag_key str
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    import_tag_value str
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .
    applicationGroupName String
    The name of the Application group.
    applicationName String
    The name of the Application.
    deployRegionId String
    The region ID of the deployment.
    description String
    Application group description information.
    importTagKey String
    The tag key must be passed in at the same time as the tag value (import_tag_value) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is app-{ApplicationName} (application name).
    importTagValue String
    The tag value must be passed in at the same time as the tag key (import_tag_key) or none, not just one. If both import_tag_key and import_tag_value are left empty, the default is application group name. .

    Import

    OOS Application Group can be imported using the id, e.g.

    $ pulumi import alicloud:oos/applicationGroup:ApplicationGroup example <application_name>:<application_group_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.62.1 published on Monday, Sep 16, 2024 by Pulumi