AWS Classic

v5.16.0 published on Saturday, Sep 24, 2022 by Pulumi

getApplication

Use this data source to get information about an AWS Serverless Application Repository application. For example, this can be used to determine the required capabilities for an application.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var exampleApplication = Aws.ServerlessRepository.GetApplication.Invoke(new()
    {
        ApplicationId = "arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication",
    });

    var exampleCloudFormationStack = new Aws.ServerlessRepository.CloudFormationStack("exampleCloudFormationStack", new()
    {
        ApplicationId = exampleApplication.Apply(getApplicationResult => getApplicationResult.ApplicationId),
        SemanticVersion = exampleApplication.Apply(getApplicationResult => getApplicationResult.SemanticVersion),
        Capabilities = exampleApplication.Apply(getApplicationResult => getApplicationResult.RequiredCapabilities),
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/serverlessrepository"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleApplication, err := serverlessrepository.GetApplication(ctx, &serverlessrepository.GetApplicationArgs{
			ApplicationId: "arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication",
		}, nil)
		if err != nil {
			return err
		}
		_, err = serverlessrepository.NewCloudFormationStack(ctx, "exampleCloudFormationStack", &serverlessrepository.CloudFormationStackArgs{
			ApplicationId:   pulumi.String(exampleApplication.ApplicationId),
			SemanticVersion: pulumi.String(exampleApplication.SemanticVersion),
			Capabilities:    interface{}(exampleApplication.RequiredCapabilities),
		})
		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.aws.serverlessrepository.ServerlessrepositoryFunctions;
import com.pulumi.aws.elasticbeanstalk.inputs.GetApplicationArgs;
import com.pulumi.aws.serverlessrepository.CloudFormationStack;
import com.pulumi.aws.serverlessrepository.CloudFormationStackArgs;
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 exampleApplication = ServerlessrepositoryFunctions.getApplication(GetApplicationArgs.builder()
            .applicationId("arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication")
            .build());

        var exampleCloudFormationStack = new CloudFormationStack("exampleCloudFormationStack", CloudFormationStackArgs.builder()        
            .applicationId(exampleApplication.applyValue(getApplicationResult -> getApplicationResult.applicationId()))
            .semanticVersion(exampleApplication.applyValue(getApplicationResult -> getApplicationResult.semanticVersion()))
            .capabilities(exampleApplication.applyValue(getApplicationResult -> getApplicationResult.requiredCapabilities()))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_application = aws.serverlessrepository.get_application(application_id="arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication")
example_cloud_formation_stack = aws.serverlessrepository.CloudFormationStack("exampleCloudFormationStack",
    application_id=example_application.application_id,
    semantic_version=example_application.semantic_version,
    capabilities=example_application.required_capabilities)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleApplication = aws.serverlessrepository.getApplication({
    applicationId: "arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication",
});
const exampleCloudFormationStack = new aws.serverlessrepository.CloudFormationStack("exampleCloudFormationStack", {
    applicationId: exampleApplication.then(exampleApplication => exampleApplication.applicationId),
    semanticVersion: exampleApplication.then(exampleApplication => exampleApplication.semanticVersion),
    capabilities: exampleApplication.then(exampleApplication => exampleApplication.requiredCapabilities),
});
resources:
  exampleCloudFormationStack:
    type: aws:serverlessrepository:CloudFormationStack
    properties:
      applicationId: ${exampleApplication.applicationId}
      semanticVersion: ${exampleApplication.semanticVersion}
      capabilities: ${exampleApplication.requiredCapabilities}
variables:
  exampleApplication:
    Fn::Invoke:
      Function: aws:serverlessrepository:getApplication
      Arguments:
        applicationId: arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication

Using getApplication

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getApplication(args: GetApplicationArgs, opts?: InvokeOptions): Promise<GetApplicationResult>
function getApplicationOutput(args: GetApplicationOutputArgs, opts?: InvokeOptions): Output<GetApplicationResult>
def get_application(application_id: Optional[str] = None,
                    semantic_version: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetApplicationResult
def get_application_output(application_id: Optional[pulumi.Input[str]] = None,
                    semantic_version: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetApplicationResult]
func GetApplication(ctx *Context, args *GetApplicationArgs, opts ...InvokeOption) (*GetApplicationResult, error)
func GetApplicationOutput(ctx *Context, args *GetApplicationOutputArgs, opts ...InvokeOption) GetApplicationResultOutput

> Note: This function is named GetApplication in the Go SDK.

public static class GetApplication 
{
    public static Task<GetApplicationResult> InvokeAsync(GetApplicationArgs args, InvokeOptions? opts = null)
    public static Output<GetApplicationResult> Invoke(GetApplicationInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetApplicationResult> getApplication(GetApplicationArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:serverlessrepository/getApplication:getApplication
  Arguments:
    # Arguments dictionary

The following arguments are supported:

ApplicationId string

ARN of the application.

SemanticVersion string

Requested version of the application. By default, retrieves the latest version.

ApplicationId string

ARN of the application.

SemanticVersion string

Requested version of the application. By default, retrieves the latest version.

applicationId String

ARN of the application.

semanticVersion String

Requested version of the application. By default, retrieves the latest version.

applicationId string

ARN of the application.

semanticVersion string

Requested version of the application. By default, retrieves the latest version.

application_id str

ARN of the application.

semantic_version str

Requested version of the application. By default, retrieves the latest version.

applicationId String

ARN of the application.

semanticVersion String

Requested version of the application. By default, retrieves the latest version.

getApplication Result

The following output properties are available:

ApplicationId string

ARN of the application.

Id string

The provider-assigned unique ID for this managed resource.

Name string

Name of the application.

RequiredCapabilities List<string>

A list of capabilities describing the permissions needed to deploy the application.

SemanticVersion string
SourceCodeUrl string

URL pointing to the source code of the application version.

TemplateUrl string

URL pointing to the Cloud Formation template for the application version.

ApplicationId string

ARN of the application.

Id string

The provider-assigned unique ID for this managed resource.

Name string

Name of the application.

RequiredCapabilities []string

A list of capabilities describing the permissions needed to deploy the application.

SemanticVersion string
SourceCodeUrl string

URL pointing to the source code of the application version.

TemplateUrl string

URL pointing to the Cloud Formation template for the application version.

applicationId String

ARN of the application.

id String

The provider-assigned unique ID for this managed resource.

name String

Name of the application.

requiredCapabilities List<String>

A list of capabilities describing the permissions needed to deploy the application.

semanticVersion String
sourceCodeUrl String

URL pointing to the source code of the application version.

templateUrl String

URL pointing to the Cloud Formation template for the application version.

applicationId string

ARN of the application.

id string

The provider-assigned unique ID for this managed resource.

name string

Name of the application.

requiredCapabilities string[]

A list of capabilities describing the permissions needed to deploy the application.

semanticVersion string
sourceCodeUrl string

URL pointing to the source code of the application version.

templateUrl string

URL pointing to the Cloud Formation template for the application version.

application_id str

ARN of the application.

id str

The provider-assigned unique ID for this managed resource.

name str

Name of the application.

required_capabilities Sequence[str]

A list of capabilities describing the permissions needed to deploy the application.

semantic_version str
source_code_url str

URL pointing to the source code of the application version.

template_url str

URL pointing to the Cloud Formation template for the application version.

applicationId String

ARN of the application.

id String

The provider-assigned unique ID for this managed resource.

name String

Name of the application.

requiredCapabilities List<String>

A list of capabilities describing the permissions needed to deploy the application.

semanticVersion String
sourceCodeUrl String

URL pointing to the source code of the application version.

templateUrl String

URL pointing to the Cloud Formation template for the application version.

Package Details

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

This Pulumi package is based on the aws Terraform Provider.