1. Packages
  2. Dynatrace
  3. API Docs
  4. getProcessGroup
Dynatrace v0.21.0 published on Sunday, Nov 17, 2024 by Pulumiverse

dynatrace.getProcessGroup

Explore with Pulumi AI

dynatrace logo
Dynatrace v0.21.0 published on Sunday, Nov 17, 2024 by Pulumiverse

    !> The data source API endpoint has been deprecated, please use dynatrace.getEntity with entity type PROCESS_GROUP instead.

    The process group data source allows the process group ID to be retrieved by its name and optionally tags / tag-value pairs.

    • name queries for all process groups with the specified name
    • tags (optional) refers to the tags that need to be present for the process group (inclusive)

    If multiple process groups match the given criteria, the first result will be retrieved.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumi/dynatrace";
    import * as dynatrace from "@pulumiverse/dynatrace";
    
    const test = dynatrace.getProcessGroup({
        name: "Example",
        tags: [
            "TerraformKeyTest",
            "TerraformKeyValueTest=TestValue",
        ],
    });
    const _name_ = new dynatrace.ManagementZone("#name#", {entitySelectorBasedRules: [{
        enabled: true,
        selector: test.then(test => `type("process_group"),entityId("${test.id}")`),
    }]});
    
    import pulumi
    import pulumi_dynatrace as dynatrace
    import pulumiverse_dynatrace as dynatrace
    
    test = dynatrace.get_process_group(name="Example",
        tags=[
            "TerraformKeyTest",
            "TerraformKeyValueTest=TestValue",
        ])
    _name_ = dynatrace.ManagementZone("#name#", entity_selector_based_rules=[{
        "enabled": True,
        "selector": f"type(\"process_group\"),entityId(\"{test.id}\")",
    }])
    
    package main
    
    import (
    	"fmt"
    
    	"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.GetProcessGroup(ctx, &dynatrace.GetProcessGroupArgs{
    			Name: "Example",
    			Tags: []string{
    				"TerraformKeyTest",
    				"TerraformKeyValueTest=TestValue",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = dynatrace.NewManagementZone(ctx, "#name#", &dynatrace.ManagementZoneArgs{
    			EntitySelectorBasedRules: dynatrace.ManagementZoneEntitySelectorBasedRuleArray{
    				&dynatrace.ManagementZoneEntitySelectorBasedRuleArgs{
    					Enabled:  pulumi.Bool(true),
    					Selector: pulumi.Sprintf("type(\"process_group\"),entityId(\"%v\")", test.Id),
    				},
    			},
    		})
    		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.GetProcessGroup.Invoke(new()
        {
            Name = "Example",
            Tags = new[]
            {
                "TerraformKeyTest",
                "TerraformKeyValueTest=TestValue",
            },
        });
    
        var _name_ = new Dynatrace.ManagementZone("#name#", new()
        {
            EntitySelectorBasedRules = new[]
            {
                new Dynatrace.Inputs.ManagementZoneEntitySelectorBasedRuleArgs
                {
                    Enabled = true,
                    Selector = $"type(\"process_group\"),entityId(\"{test.Apply(getProcessGroupResult => getProcessGroupResult.Id)}\")",
                },
            },
        });
    
    });
    
    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.GetProcessGroupArgs;
    import com.pulumi.dynatrace.ManagementZone;
    import com.pulumi.dynatrace.ManagementZoneArgs;
    import com.pulumi.dynatrace.inputs.ManagementZoneEntitySelectorBasedRuleArgs;
    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.getProcessGroup(GetProcessGroupArgs.builder()
                .name("Example")
                .tags(            
                    "TerraformKeyTest",
                    "TerraformKeyValueTest=TestValue")
                .build());
    
            var _name_ = new ManagementZone("#name#", ManagementZoneArgs.builder()
                .entitySelectorBasedRules(ManagementZoneEntitySelectorBasedRuleArgs.builder()
                    .enabled(true)
                    .selector(String.format("type(\"process_group\"),entityId(\"%s\")", test.applyValue(getProcessGroupResult -> getProcessGroupResult.id())))
                    .build())
                .build());
    
        }
    }
    
    resources:
      '#name#':
        type: dynatrace:ManagementZone
        properties:
          entitySelectorBasedRules:
            - enabled: true
              selector: type("process_group"),entityId("${test.id}")
    variables:
      test:
        fn::invoke:
          Function: dynatrace:getProcessGroup
          Arguments:
            name: Example
            tags:
              - TerraformKeyTest
              - TerraformKeyValueTest=TestValue
    

    Using getProcessGroup

    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 getProcessGroup(args: GetProcessGroupArgs, opts?: InvokeOptions): Promise<GetProcessGroupResult>
    function getProcessGroupOutput(args: GetProcessGroupOutputArgs, opts?: InvokeOptions): Output<GetProcessGroupResult>
    def get_process_group(name: Optional[str] = None,
                          tags: Optional[Sequence[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetProcessGroupResult
    def get_process_group_output(name: Optional[pulumi.Input[str]] = None,
                          tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetProcessGroupResult]
    func GetProcessGroup(ctx *Context, args *GetProcessGroupArgs, opts ...InvokeOption) (*GetProcessGroupResult, error)
    func GetProcessGroupOutput(ctx *Context, args *GetProcessGroupOutputArgs, opts ...InvokeOption) GetProcessGroupResultOutput

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

    public static class GetProcessGroup 
    {
        public static Task<GetProcessGroupResult> InvokeAsync(GetProcessGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetProcessGroupResult> Invoke(GetProcessGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProcessGroupResult> getProcessGroup(GetProcessGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: dynatrace:index/getProcessGroup:getProcessGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Tags List<string>
    Required tags of the process group to find
    Name string
    Tags []string
    Required tags of the process group to find
    name String
    tags List<String>
    Required tags of the process group to find
    name string
    tags string[]
    Required tags of the process group to find
    name str
    tags Sequence[str]
    Required tags of the process group to find
    name String
    tags List<String>
    Required tags of the process group to find

    getProcessGroup Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Tags List<string>
    Required tags of the process group to find
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Tags []string
    Required tags of the process group to find
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    tags List<String>
    Required tags of the process group to find
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    tags string[]
    Required tags of the process group to find
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    tags Sequence[str]
    Required tags of the process group to find
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    tags List<String>
    Required tags of the process group to find

    Package Details

    Repository
    dynatrace pulumiverse/pulumi-dynatrace
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dynatrace Terraform Provider.
    dynatrace logo
    Dynatrace v0.21.0 published on Sunday, Nov 17, 2024 by Pulumiverse