1. Packages
  2. Dynatrace
  3. API Docs
  4. getAutotag
Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse

dynatrace.getAutotag

Explore with Pulumi AI

dynatrace logo
Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse

    The automatically applied tag data source allows the tag ID to be retrieved by its name.

    This data source requires the API token scopes Read settings (settings.read)

    • name queries the automatically applied tag 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 exampleAutotag = dynatrace.getAutotag({
        name: "Terraform Example",
    });
    const exampleAutotagRules = new dynatrace.AutotagRules("exampleAutotagRules", {
        autoTagId: exampleAutotag.then(exampleAutotag => exampleAutotag.id),
        rules: {
            rules: [
                {
                    type: "ME",
                    enabled: true,
                    valueFormat: "Java",
                    valueNormalization: "Leave text as-is",
                    attributeRule: {
                        entityType: "PROCESS_GROUP",
                        pgToHostPropagation: true,
                        pgToServicePropagation: false,
                        conditions: {
                            conditions: [{
                                enumValue: "JAVA",
                                key: "PROCESS_GROUP_TECHNOLOGY",
                                operator: "EQUALS",
                            }],
                        },
                    },
                },
                {
                    type: "ME",
                    enabled: true,
                    valueFormat: ".NET",
                    valueNormalization: "Leave text as-is",
                    attributeRule: {
                        entityType: "PROCESS_GROUP",
                        pgToHostPropagation: true,
                        pgToServicePropagation: false,
                        conditions: {
                            conditions: [{
                                enumValue: "DOTNET",
                                key: "PROCESS_GROUP_TECHNOLOGY",
                                operator: "EQUALS",
                            }],
                        },
                    },
                },
            ],
        },
    });
    
    import pulumi
    import pulumi_dynatrace as dynatrace
    import pulumiverse_dynatrace as dynatrace
    
    example_autotag = dynatrace.get_autotag(name="Terraform Example")
    example_autotag_rules = dynatrace.AutotagRules("exampleAutotagRules",
        auto_tag_id=example_autotag.id,
        rules={
            "rules": [
                {
                    "type": "ME",
                    "enabled": True,
                    "value_format": "Java",
                    "value_normalization": "Leave text as-is",
                    "attribute_rule": {
                        "entity_type": "PROCESS_GROUP",
                        "pg_to_host_propagation": True,
                        "pg_to_service_propagation": False,
                        "conditions": {
                            "conditions": [{
                                "enum_value": "JAVA",
                                "key": "PROCESS_GROUP_TECHNOLOGY",
                                "operator": "EQUALS",
                            }],
                        },
                    },
                },
                {
                    "type": "ME",
                    "enabled": True,
                    "value_format": ".NET",
                    "value_normalization": "Leave text as-is",
                    "attribute_rule": {
                        "entity_type": "PROCESS_GROUP",
                        "pg_to_host_propagation": True,
                        "pg_to_service_propagation": False,
                        "conditions": {
                            "conditions": [{
                                "enum_value": "DOTNET",
                                "key": "PROCESS_GROUP_TECHNOLOGY",
                                "operator": "EQUALS",
                            }],
                        },
                    },
                },
            ],
        })
    
    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 {
    		exampleAutotag, err := dynatrace.LookupAutotag(ctx, &dynatrace.LookupAutotagArgs{
    			Name: "Terraform Example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = dynatrace.NewAutotagRules(ctx, "exampleAutotagRules", &dynatrace.AutotagRulesArgs{
    			AutoTagId: pulumi.String(exampleAutotag.Id),
    			Rules: &dynatrace.AutotagRulesRulesArgs{
    				Rules: dynatrace.AutotagRulesRulesRuleArray{
    					&dynatrace.AutotagRulesRulesRuleArgs{
    						Type:               pulumi.String("ME"),
    						Enabled:            pulumi.Bool(true),
    						ValueFormat:        pulumi.String("Java"),
    						ValueNormalization: pulumi.String("Leave text as-is"),
    						AttributeRule: &dynatrace.AutotagRulesRulesRuleAttributeRuleArgs{
    							EntityType:             pulumi.String("PROCESS_GROUP"),
    							PgToHostPropagation:    pulumi.Bool(true),
    							PgToServicePropagation: pulumi.Bool(false),
    							Conditions: &dynatrace.AutotagRulesRulesRuleAttributeRuleConditionsArgs{
    								Conditions: dynatrace.AutotagRulesRulesRuleAttributeRuleConditionsConditionArray{
    									&dynatrace.AutotagRulesRulesRuleAttributeRuleConditionsConditionArgs{
    										EnumValue: pulumi.String("JAVA"),
    										Key:       pulumi.String("PROCESS_GROUP_TECHNOLOGY"),
    										Operator:  pulumi.String("EQUALS"),
    									},
    								},
    							},
    						},
    					},
    					&dynatrace.AutotagRulesRulesRuleArgs{
    						Type:               pulumi.String("ME"),
    						Enabled:            pulumi.Bool(true),
    						ValueFormat:        pulumi.String(".NET"),
    						ValueNormalization: pulumi.String("Leave text as-is"),
    						AttributeRule: &dynatrace.AutotagRulesRulesRuleAttributeRuleArgs{
    							EntityType:             pulumi.String("PROCESS_GROUP"),
    							PgToHostPropagation:    pulumi.Bool(true),
    							PgToServicePropagation: pulumi.Bool(false),
    							Conditions: &dynatrace.AutotagRulesRulesRuleAttributeRuleConditionsArgs{
    								Conditions: dynatrace.AutotagRulesRulesRuleAttributeRuleConditionsConditionArray{
    									&dynatrace.AutotagRulesRulesRuleAttributeRuleConditionsConditionArgs{
    										EnumValue: pulumi.String("DOTNET"),
    										Key:       pulumi.String("PROCESS_GROUP_TECHNOLOGY"),
    										Operator:  pulumi.String("EQUALS"),
    									},
    								},
    							},
    						},
    					},
    				},
    			},
    		})
    		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 exampleAutotag = Dynatrace.GetAutotag.Invoke(new()
        {
            Name = "Terraform Example",
        });
    
        var exampleAutotagRules = new Dynatrace.AutotagRules("exampleAutotagRules", new()
        {
            AutoTagId = exampleAutotag.Apply(getAutotagResult => getAutotagResult.Id),
            Rules = new Dynatrace.Inputs.AutotagRulesRulesArgs
            {
                Rules = new[]
                {
                    new Dynatrace.Inputs.AutotagRulesRulesRuleArgs
                    {
                        Type = "ME",
                        Enabled = true,
                        ValueFormat = "Java",
                        ValueNormalization = "Leave text as-is",
                        AttributeRule = new Dynatrace.Inputs.AutotagRulesRulesRuleAttributeRuleArgs
                        {
                            EntityType = "PROCESS_GROUP",
                            PgToHostPropagation = true,
                            PgToServicePropagation = false,
                            Conditions = new Dynatrace.Inputs.AutotagRulesRulesRuleAttributeRuleConditionsArgs
                            {
                                Conditions = new[]
                                {
                                    new Dynatrace.Inputs.AutotagRulesRulesRuleAttributeRuleConditionsConditionArgs
                                    {
                                        EnumValue = "JAVA",
                                        Key = "PROCESS_GROUP_TECHNOLOGY",
                                        Operator = "EQUALS",
                                    },
                                },
                            },
                        },
                    },
                    new Dynatrace.Inputs.AutotagRulesRulesRuleArgs
                    {
                        Type = "ME",
                        Enabled = true,
                        ValueFormat = ".NET",
                        ValueNormalization = "Leave text as-is",
                        AttributeRule = new Dynatrace.Inputs.AutotagRulesRulesRuleAttributeRuleArgs
                        {
                            EntityType = "PROCESS_GROUP",
                            PgToHostPropagation = true,
                            PgToServicePropagation = false,
                            Conditions = new Dynatrace.Inputs.AutotagRulesRulesRuleAttributeRuleConditionsArgs
                            {
                                Conditions = new[]
                                {
                                    new Dynatrace.Inputs.AutotagRulesRulesRuleAttributeRuleConditionsConditionArgs
                                    {
                                        EnumValue = "DOTNET",
                                        Key = "PROCESS_GROUP_TECHNOLOGY",
                                        Operator = "EQUALS",
                                    },
                                },
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    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.GetAutotagArgs;
    import com.pulumi.dynatrace.AutotagRules;
    import com.pulumi.dynatrace.AutotagRulesArgs;
    import com.pulumi.dynatrace.inputs.AutotagRulesRulesArgs;
    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 exampleAutotag = DynatraceFunctions.getAutotag(GetAutotagArgs.builder()
                .name("Terraform Example")
                .build());
    
            var exampleAutotagRules = new AutotagRules("exampleAutotagRules", AutotagRulesArgs.builder()
                .autoTagId(exampleAutotag.applyValue(getAutotagResult -> getAutotagResult.id()))
                .rules(AutotagRulesRulesArgs.builder()
                    .rules(                
                        AutotagRulesRulesRuleArgs.builder()
                            .type("ME")
                            .enabled(true)
                            .valueFormat("Java")
                            .valueNormalization("Leave text as-is")
                            .attributeRule(AutotagRulesRulesRuleAttributeRuleArgs.builder()
                                .entityType("PROCESS_GROUP")
                                .pgToHostPropagation(true)
                                .pgToServicePropagation(false)
                                .conditions(AutotagRulesRulesRuleAttributeRuleConditionsArgs.builder()
                                    .conditions(AutotagRulesRulesRuleAttributeRuleConditionsConditionArgs.builder()
                                        .enumValue("JAVA")
                                        .key("PROCESS_GROUP_TECHNOLOGY")
                                        .operator("EQUALS")
                                        .build())
                                    .build())
                                .build())
                            .build(),
                        AutotagRulesRulesRuleArgs.builder()
                            .type("ME")
                            .enabled(true)
                            .valueFormat(".NET")
                            .valueNormalization("Leave text as-is")
                            .attributeRule(AutotagRulesRulesRuleAttributeRuleArgs.builder()
                                .entityType("PROCESS_GROUP")
                                .pgToHostPropagation(true)
                                .pgToServicePropagation(false)
                                .conditions(AutotagRulesRulesRuleAttributeRuleConditionsArgs.builder()
                                    .conditions(AutotagRulesRulesRuleAttributeRuleConditionsConditionArgs.builder()
                                        .enumValue("DOTNET")
                                        .key("PROCESS_GROUP_TECHNOLOGY")
                                        .operator("EQUALS")
                                        .build())
                                    .build())
                                .build())
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleAutotagRules:
        type: dynatrace:AutotagRules
        properties:
          autoTagId: ${exampleAutotag.id}
          rules:
            rules:
              - type: ME
                enabled: true
                valueFormat: Java
                valueNormalization: Leave text as-is
                attributeRule:
                  entityType: PROCESS_GROUP
                  pgToHostPropagation: true
                  pgToServicePropagation: false
                  conditions:
                    conditions:
                      - enumValue: JAVA
                        key: PROCESS_GROUP_TECHNOLOGY
                        operator: EQUALS
              - type: ME
                enabled: true
                valueFormat: .NET
                valueNormalization: Leave text as-is
                attributeRule:
                  entityType: PROCESS_GROUP
                  pgToHostPropagation: true
                  pgToServicePropagation: false
                  conditions:
                    conditions:
                      - enumValue: DOTNET
                        key: PROCESS_GROUP_TECHNOLOGY
                        operator: EQUALS
    variables:
      exampleAutotag:
        fn::invoke:
          Function: dynatrace:getAutotag
          Arguments:
            name: Terraform Example
    

    Using getAutotag

    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 getAutotag(args: GetAutotagArgs, opts?: InvokeOptions): Promise<GetAutotagResult>
    function getAutotagOutput(args: GetAutotagOutputArgs, opts?: InvokeOptions): Output<GetAutotagResult>
    def get_autotag(name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAutotagResult
    def get_autotag_output(name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetAutotagResult]
    func LookupAutotag(ctx *Context, args *LookupAutotagArgs, opts ...InvokeOption) (*LookupAutotagResult, error)
    func LookupAutotagOutput(ctx *Context, args *LookupAutotagOutputArgs, opts ...InvokeOption) LookupAutotagResultOutput

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

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

    The following arguments are supported:

    Name string
    Name string
    name String
    name string
    name str
    name String

    getAutotag Result

    The following output properties are available:

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

    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.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse