Dynatrace v0.21.0 published on Sunday, Nov 17, 2024 by Pulumiverse
dynatrace.getApplication
Explore with Pulumi AI
The application data source allows the application ID to be retrieved by its name.
name
queries for all applications with the specified name
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as dynatrace from "@pulumi/dynatrace";
import * as dynatrace from "@pulumiverse/dynatrace";
const test = dynatrace.getApplication({
name: "Example",
});
const _name_ = new dynatrace.ApplicationDetectionRule("#name#", {
applicationIdentifier: test.then(test => test.id),
filterConfig: {
applicationMatchTarget: "DOMAIN",
applicationMatchType: "MATCHES",
pattern: "www.google.com",
},
});
import pulumi
import pulumi_dynatrace as dynatrace
import pulumiverse_dynatrace as dynatrace
test = dynatrace.get_application(name="Example")
_name_ = dynatrace.ApplicationDetectionRule("#name#",
application_identifier=test.id,
filter_config={
"application_match_target": "DOMAIN",
"application_match_type": "MATCHES",
"pattern": "www.google.com",
})
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-dynatrace/sdk/go/dynatrace"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := dynatrace.GetApplication(ctx, &dynatrace.GetApplicationArgs{
Name: "Example",
}, nil)
if err != nil {
return err
}
_, err = dynatrace.NewApplicationDetectionRule(ctx, "#name#", &dynatrace.ApplicationDetectionRuleArgs{
ApplicationIdentifier: pulumi.String(test.Id),
FilterConfig: &dynatrace.ApplicationDetectionRuleFilterConfigArgs{
ApplicationMatchTarget: pulumi.String("DOMAIN"),
ApplicationMatchType: pulumi.String("MATCHES"),
Pattern: pulumi.String("www.google.com"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Dynatrace = Pulumi.Dynatrace;
using Dynatrace = Pulumiverse.Dynatrace;
return await Deployment.RunAsync(() =>
{
var test = Dynatrace.GetApplication.Invoke(new()
{
Name = "Example",
});
var _name_ = new Dynatrace.ApplicationDetectionRule("#name#", new()
{
ApplicationIdentifier = test.Apply(getApplicationResult => getApplicationResult.Id),
FilterConfig = new Dynatrace.Inputs.ApplicationDetectionRuleFilterConfigArgs
{
ApplicationMatchTarget = "DOMAIN",
ApplicationMatchType = "MATCHES",
Pattern = "www.google.com",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dynatrace.DynatraceFunctions;
import com.pulumi.dynatrace.inputs.GetApplicationArgs;
import com.pulumi.dynatrace.ApplicationDetectionRule;
import com.pulumi.dynatrace.ApplicationDetectionRuleArgs;
import com.pulumi.dynatrace.inputs.ApplicationDetectionRuleFilterConfigArgs;
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 test = DynatraceFunctions.getApplication(GetApplicationArgs.builder()
.name("Example")
.build());
var _name_ = new ApplicationDetectionRule("#name#", ApplicationDetectionRuleArgs.builder()
.applicationIdentifier(test.applyValue(getApplicationResult -> getApplicationResult.id()))
.filterConfig(ApplicationDetectionRuleFilterConfigArgs.builder()
.applicationMatchTarget("DOMAIN")
.applicationMatchType("MATCHES")
.pattern("www.google.com")
.build())
.build());
}
}
resources:
'#name#':
type: dynatrace:ApplicationDetectionRule
properties:
applicationIdentifier: ${test.id}
filterConfig:
applicationMatchTarget: DOMAIN
applicationMatchType: MATCHES
pattern: www.google.com
variables:
test:
fn::invoke:
Function: dynatrace:getApplication
Arguments:
name: Example
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(name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetApplicationResult
def get_application_output(name: 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: dynatrace:index/getApplication:getApplication
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- Name string
- name String
- name string
- name str
- name String
getApplication Result
The following output properties are available:
Package Details
- Repository
- dynatrace pulumiverse/pulumi-dynatrace
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
dynatrace
Terraform Provider.