Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

Application

Provides a OOS Application resource.

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

NOTE: Available in v1.145.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "tftestacc";
        var defaultResourceGroups = Output.Create(AliCloud.ResourceManager.GetResourceGroups.InvokeAsync());
        var defaultApplication = new AliCloud.Oos.Application("defaultApplication", new AliCloud.Oos.ApplicationArgs
        {
            ResourceGroupId = defaultResourceGroups.Apply(defaultResourceGroups => defaultResourceGroups.Groups?[0]?.Id),
            ApplicationName = name,
            Description = name,
            Tags = 
            {
                { "Created", "TF" },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oos"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
	"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 := "tftestacc"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		defaultResourceGroups, err := resourcemanager.GetResourceGroups(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = oos.NewApplication(ctx, "defaultApplication", &oos.ApplicationArgs{
			ResourceGroupId: pulumi.String(defaultResourceGroups.Groups[0].Id),
			ApplicationName: pulumi.String(name),
			Description:     pulumi.String(name),
			Tags: pulumi.AnyMap{
				"Created": pulumi.Any("TF"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.oos.Application;
import com.pulumi.alicloud.oos.ApplicationArgs;
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("tftestacc");
        final var defaultResourceGroups = ResourcemanagerFunctions.getResourceGroups();

        var defaultApplication = new Application("defaultApplication", ApplicationArgs.builder()        
            .resourceGroupId(defaultResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.groups()[0].id()))
            .applicationName(name)
            .description(name)
            .tags(Map.of("Created", "TF"))
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tftestacc"
default_resource_groups = alicloud.resourcemanager.get_resource_groups()
default_application = alicloud.oos.Application("defaultApplication",
    resource_group_id=default_resource_groups.groups[0].id,
    application_name=name,
    description=name,
    tags={
        "Created": "TF",
    })
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "tftestacc";
const defaultResourceGroups = alicloud.resourcemanager.getResourceGroups({});
const defaultApplication = new alicloud.oos.Application("defaultApplication", {
    resourceGroupId: defaultResourceGroups.then(defaultResourceGroups => defaultResourceGroups.groups?[0]?.id),
    applicationName: name,
    description: name,
    tags: {
        Created: "TF",
    },
});
configuration:
  name:
    type: string
    default: tftestacc
resources:
  defaultApplication:
    type: alicloud:oos:Application
    properties:
      resourceGroupId: ${defaultResourceGroups.groups[0].id}
      applicationName: ${name}
      description: ${name}
      tags:
        Created: TF
variables:
  defaultResourceGroups:
    Fn::Invoke:
      Function: alicloud:resourcemanager:getResourceGroups
      Arguments: {}

Create a Application Resource

new Application(name: string, args: ApplicationArgs, opts?: CustomResourceOptions);
@overload
def Application(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                application_name: Optional[str] = None,
                description: Optional[str] = None,
                resource_group_id: Optional[str] = None,
                tags: Optional[Mapping[str, Any]] = None)
@overload
def Application(resource_name: str,
                args: ApplicationArgs,
                opts: Optional[ResourceOptions] = None)
func NewApplication(ctx *Context, name string, args ApplicationArgs, opts ...ResourceOption) (*Application, error)
public Application(string name, ApplicationArgs args, CustomResourceOptions? opts = null)
public Application(String name, ApplicationArgs args)
public Application(String name, ApplicationArgs args, CustomResourceOptions options)
type: alicloud:oos:Application
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ApplicationArgs
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 ApplicationArgs
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 ApplicationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ApplicationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ApplicationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

ApplicationName string

The name of the application.

Description string

Application group description information.

ResourceGroupId string

The ID of the resource group.

Tags Dictionary<string, object>

The tag of the resource.

ApplicationName string

The name of the application.

Description string

Application group description information.

ResourceGroupId string

The ID of the resource group.

Tags map[string]interface{}

The tag of the resource.

applicationName String

The name of the application.

description String

Application group description information.

resourceGroupId String

The ID of the resource group.

tags Map<String,Object>

The tag of the resource.

applicationName string

The name of the application.

description string

Application group description information.

resourceGroupId string

The ID of the resource group.

tags {[key: string]: any}

The tag of the resource.

application_name str

The name of the application.

description str

Application group description information.

resource_group_id str

The ID of the resource group.

tags Mapping[str, Any]

The tag of the resource.

applicationName String

The name of the application.

description String

Application group description information.

resourceGroupId String

The ID of the resource group.

tags Map<Any>

The tag of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the Application 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 an Existing Application Resource

Get an existing Application 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?: ApplicationState, opts?: CustomResourceOptions): Application
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        application_name: Optional[str] = None,
        description: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        tags: Optional[Mapping[str, Any]] = None) -> Application
func GetApplication(ctx *Context, name string, id IDInput, state *ApplicationState, opts ...ResourceOption) (*Application, error)
public static Application Get(string name, Input<string> id, ApplicationState? state, CustomResourceOptions? opts = null)
public static Application get(String name, Output<String> id, ApplicationState 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:
ApplicationName string

The name of the application.

Description string

Application group description information.

ResourceGroupId string

The ID of the resource group.

Tags Dictionary<string, object>

The tag of the resource.

ApplicationName string

The name of the application.

Description string

Application group description information.

ResourceGroupId string

The ID of the resource group.

Tags map[string]interface{}

The tag of the resource.

applicationName String

The name of the application.

description String

Application group description information.

resourceGroupId String

The ID of the resource group.

tags Map<String,Object>

The tag of the resource.

applicationName string

The name of the application.

description string

Application group description information.

resourceGroupId string

The ID of the resource group.

tags {[key: string]: any}

The tag of the resource.

application_name str

The name of the application.

description str

Application group description information.

resource_group_id str

The ID of the resource group.

tags Mapping[str, Any]

The tag of the resource.

applicationName String

The name of the application.

description String

Application group description information.

resourceGroupId String

The ID of the resource group.

tags Map<Any>

The tag of the resource.

Import

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

 $ pulumi import alicloud:oos/application:Application example <id>

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.