1. Packages
  2. Dynatrace
  3. API Docs
  4. AzureService
Dynatrace v0.10.0 published on Friday, Jun 7, 2024 by Pulumiverse

dynatrace.AzureService

Explore with Pulumi AI

dynatrace logo
Dynatrace v0.10.0 published on Friday, Jun 7, 2024 by Pulumiverse

    This resource is excluded by default in the export utility.

    This resource requires the API token scopes Read configuration (ReadConfig) and Write configuration (WriteConfig)

    Dynatrace Documentation

    • Microsoft Azure monitoring - https://www.dynatrace.com/support/help/how-to-use-dynatrace/infrastructure-monitoring/cloud-platform-monitoring/microsoft-azure-services-monitoring

    • Azure credentials API - https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/azure-credentials-api

    Resource Example Usage

    This example utilizes the data source dynatrace.getAzureSupportedServices in order to query for a full list of all supported services. The for_each loop within the resource dynatrace.AzureService configures each of these services to get utilized with the default metrics recommended by Dynatrace (use_recommended_metrics).

    If you want to configure a different set of metrics for a specific service, a separate resource dynatrace.AzureService will be necessary for that. That allows you to configure the metric blocks according to your wishes. Just be aware of the fact, that Dynatrace enforces for most services a recommended set of metrics. All of them need to be part of your configuration in order to end up with a non-empty plan.

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumi/dynatrace";
    import * as dynatrace from "@pulumiverse/dynatrace";
    
    export = async () => {
        const tERRAFORMSAMPLE = new dynatrace.AzureCredentials("tERRAFORMSAMPLE", {
            active: false,
            appId: "ABCDE",
            autoTagging: true,
            directoryId: "ABCDE",
            label: "TERRAFORM_SAMPLE",
            key: "aaaa",
            monitorOnlyTaggedEntities: true,
            monitorOnlyTagPairs: [{
                name: "string",
                value: "string",
            }],
        });
        const supportedServices = await dynatrace.getAzureSupportedServices({
            excepts: ["AZURE_STORAGE_ACCOUNT"],
        });
        const tERRAFORMSAMPLEServices: dynatrace.AzureService[] = [];
        for (const range of Object.entries(supportedServices.services).map(([k, v]) => ({key: k, value: v}))) {
            tERRAFORMSAMPLEServices.push(new dynatrace.AzureService(`tERRAFORMSAMPLEServices-${range.key}`, {
                credentialsId: tERRAFORMSAMPLE.id,
                useRecommendedMetrics: true,
            }));
        }
    }
    
    import pulumi
    import pulumi_dynatrace as dynatrace
    import pulumiverse_dynatrace as dynatrace
    
    t_erraformsample = dynatrace.AzureCredentials("tERRAFORMSAMPLE",
        active=False,
        app_id="ABCDE",
        auto_tagging=True,
        directory_id="ABCDE",
        label="TERRAFORM_SAMPLE",
        key="aaaa",
        monitor_only_tagged_entities=True,
        monitor_only_tag_pairs=[dynatrace.AzureCredentialsMonitorOnlyTagPairArgs(
            name="string",
            value="string",
        )])
    supported_services = dynatrace.get_azure_supported_services(excepts=["AZURE_STORAGE_ACCOUNT"])
    t_erraformsample_services = []
    for range in [{"key": k, "value": v} for [k, v] in enumerate(supported_services.services)]:
        t_erraformsample_services.append(dynatrace.AzureService(f"tERRAFORMSAMPLEServices-{range['key']}",
            credentials_id=t_erraformsample.id,
            use_recommended_metrics=True))
    
    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 {
    		tERRAFORMSAMPLE, err := dynatrace.NewAzureCredentials(ctx, "tERRAFORMSAMPLE", &dynatrace.AzureCredentialsArgs{
    			Active:                    pulumi.Bool(false),
    			AppId:                     pulumi.String("ABCDE"),
    			AutoTagging:               pulumi.Bool(true),
    			DirectoryId:               pulumi.String("ABCDE"),
    			Label:                     pulumi.String("TERRAFORM_SAMPLE"),
    			Key:                       pulumi.String("aaaa"),
    			MonitorOnlyTaggedEntities: pulumi.Bool(true),
    			MonitorOnlyTagPairs: dynatrace.AzureCredentialsMonitorOnlyTagPairArray{
    				&dynatrace.AzureCredentialsMonitorOnlyTagPairArgs{
    					Name:  pulumi.String("string"),
    					Value: pulumi.String("string"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		supportedServices, err := dynatrace.GetAzureSupportedServices(ctx, &dynatrace.GetAzureSupportedServicesArgs{
    			Excepts: []string{
    				"AZURE_STORAGE_ACCOUNT",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		var tERRAFORMSAMPLEServices []*dynatrace.AzureService
    		for key0, _ := range supportedServices.Services {
    			__res, err := dynatrace.NewAzureService(ctx, fmt.Sprintf("tERRAFORMSAMPLEServices-%v", key0), &dynatrace.AzureServiceArgs{
    				CredentialsId:         tERRAFORMSAMPLE.ID(),
    				UseRecommendedMetrics: pulumi.Bool(true),
    			})
    			if err != nil {
    				return err
    			}
    			tERRAFORMSAMPLEServices = append(tERRAFORMSAMPLEServices, __res)
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Pulumi;
    using Dynatrace = Pulumi.Dynatrace;
    using Dynatrace = Pulumiverse.Dynatrace;
    
    return await Deployment.RunAsync(async() => 
    {
        var tERRAFORMSAMPLE = new Dynatrace.AzureCredentials("tERRAFORMSAMPLE", new()
        {
            Active = false,
            AppId = "ABCDE",
            AutoTagging = true,
            DirectoryId = "ABCDE",
            Label = "TERRAFORM_SAMPLE",
            Key = "aaaa",
            MonitorOnlyTaggedEntities = true,
            MonitorOnlyTagPairs = new[]
            {
                new Dynatrace.Inputs.AzureCredentialsMonitorOnlyTagPairArgs
                {
                    Name = "string",
                    Value = "string",
                },
            },
        });
    
        var supportedServices = await Dynatrace.GetAzureSupportedServices.InvokeAsync(new()
        {
            Excepts = new[]
            {
                "AZURE_STORAGE_ACCOUNT",
            },
        });
    
        var tERRAFORMSAMPLEServices = new List<Dynatrace.AzureService>();
        foreach (var range in )
        {
            tERRAFORMSAMPLEServices.Add(new Dynatrace.AzureService($"tERRAFORMSAMPLEServices-{range.Key}", new()
            {
                CredentialsId = tERRAFORMSAMPLE.Id,
                UseRecommendedMetrics = true,
            }));
        }
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dynatrace.AzureCredentials;
    import com.pulumi.dynatrace.AzureCredentialsArgs;
    import com.pulumi.dynatrace.inputs.AzureCredentialsMonitorOnlyTagPairArgs;
    import com.pulumi.dynatrace.DynatraceFunctions;
    import com.pulumi.dynatrace.inputs.GetAzureSupportedServicesArgs;
    import com.pulumi.dynatrace.AzureService;
    import com.pulumi.dynatrace.AzureServiceArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    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) {
            var tERRAFORMSAMPLE = new AzureCredentials("tERRAFORMSAMPLE", AzureCredentialsArgs.builder()
                .active(false)
                .appId("ABCDE")
                .autoTagging(true)
                .directoryId("ABCDE")
                .label("TERRAFORM_SAMPLE")
                .key("aaaa")
                .monitorOnlyTaggedEntities(true)
                .monitorOnlyTagPairs(AzureCredentialsMonitorOnlyTagPairArgs.builder()
                    .name("string")
                    .value("string")
                    .build())
                .build());
    
            final var supportedServices = DynatraceFunctions.getAzureSupportedServices(GetAzureSupportedServicesArgs.builder()
                .excepts("AZURE_STORAGE_ACCOUNT")
                .build());
    
            final var tERRAFORMSAMPLEServices = supportedServices.applyValue(getAzureSupportedServicesResult -> {
                final var resources = new ArrayList<AzureService>();
                for (var range : KeyedValue.of(getAzureSupportedServicesResult.services()) {
                    var resource = new AzureService("tERRAFORMSAMPLEServices-" + range.key(), AzureServiceArgs.builder()
                        .credentialsId(tERRAFORMSAMPLE.id())
                        .useRecommendedMetrics(true)
                        .build());
    
                    resources.add(resource);
                }
    
                return resources;
            });
    
        }
    }
    
    resources:
      tERRAFORMSAMPLE:
        type: dynatrace:AzureCredentials
        properties:
          active: false
          appId: ABCDE
          autoTagging: true
          directoryId: ABCDE
          label: TERRAFORM_SAMPLE
          key: aaaa
          monitorOnlyTaggedEntities: true
          monitorOnlyTagPairs:
            - name: string
              value: string
      tERRAFORMSAMPLEServices:
        type: dynatrace:AzureService
        properties:
          credentialsId: ${tERRAFORMSAMPLE.id}
          useRecommendedMetrics: true
        options: {}
    variables:
      supportedServices:
        fn::invoke:
          Function: dynatrace:getAzureSupportedServices
          Arguments:
            excepts:
              - AZURE_STORAGE_ACCOUNT
    

    Create AzureService Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AzureService(name: string, args: AzureServiceArgs, opts?: CustomResourceOptions);
    @overload
    def AzureService(resource_name: str,
                     args: AzureServiceArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def AzureService(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     credentials_id: Optional[str] = None,
                     metrics: Optional[Sequence[AzureServiceMetricArgs]] = None,
                     name: Optional[str] = None,
                     use_recommended_metrics: Optional[bool] = None)
    func NewAzureService(ctx *Context, name string, args AzureServiceArgs, opts ...ResourceOption) (*AzureService, error)
    public AzureService(string name, AzureServiceArgs args, CustomResourceOptions? opts = null)
    public AzureService(String name, AzureServiceArgs args)
    public AzureService(String name, AzureServiceArgs args, CustomResourceOptions options)
    
    type: dynatrace:AzureService
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

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

    Example

    The following reference example uses placeholder values for all input properties.

    var azureServiceResource = new Dynatrace.AzureService("azureServiceResource", new()
    {
        CredentialsId = "string",
        Metrics = new[]
        {
            new Dynatrace.Inputs.AzureServiceMetricArgs
            {
                Name = "string",
                Dimensions = new[]
                {
                    "string",
                },
            },
        },
        Name = "string",
        UseRecommendedMetrics = false,
    });
    
    example, err := dynatrace.NewAzureService(ctx, "azureServiceResource", &dynatrace.AzureServiceArgs{
    	CredentialsId: pulumi.String("string"),
    	Metrics: dynatrace.AzureServiceMetricArray{
    		&dynatrace.AzureServiceMetricArgs{
    			Name: pulumi.String("string"),
    			Dimensions: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	Name:                  pulumi.String("string"),
    	UseRecommendedMetrics: pulumi.Bool(false),
    })
    
    var azureServiceResource = new AzureService("azureServiceResource", AzureServiceArgs.builder()
        .credentialsId("string")
        .metrics(AzureServiceMetricArgs.builder()
            .name("string")
            .dimensions("string")
            .build())
        .name("string")
        .useRecommendedMetrics(false)
        .build());
    
    azure_service_resource = dynatrace.AzureService("azureServiceResource",
        credentials_id="string",
        metrics=[dynatrace.AzureServiceMetricArgs(
            name="string",
            dimensions=["string"],
        )],
        name="string",
        use_recommended_metrics=False)
    
    const azureServiceResource = new dynatrace.AzureService("azureServiceResource", {
        credentialsId: "string",
        metrics: [{
            name: "string",
            dimensions: ["string"],
        }],
        name: "string",
        useRecommendedMetrics: false,
    });
    
    type: dynatrace:AzureService
    properties:
        credentialsId: string
        metrics:
            - dimensions:
                - string
              name: string
        name: string
        useRecommendedMetrics: false
    

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

    CredentialsId string
    the ID of the azure credentials this supported service belongs to
    Metrics List<Pulumiverse.Dynatrace.Inputs.AzureServiceMetric>
    Name string
    The name of the supporting service.
    UseRecommendedMetrics bool
    CredentialsId string
    the ID of the azure credentials this supported service belongs to
    Metrics []AzureServiceMetricArgs
    Name string
    The name of the supporting service.
    UseRecommendedMetrics bool
    credentialsId String
    the ID of the azure credentials this supported service belongs to
    metrics List<AzureServiceMetric>
    name String
    The name of the supporting service.
    useRecommendedMetrics Boolean
    credentialsId string
    the ID of the azure credentials this supported service belongs to
    metrics AzureServiceMetric[]
    name string
    The name of the supporting service.
    useRecommendedMetrics boolean
    credentials_id str
    the ID of the azure credentials this supported service belongs to
    metrics Sequence[AzureServiceMetricArgs]
    name str
    The name of the supporting service.
    use_recommended_metrics bool
    credentialsId String
    the ID of the azure credentials this supported service belongs to
    metrics List<Property Map>
    name String
    The name of the supporting service.
    useRecommendedMetrics Boolean

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AzureService resource produces the following output properties:

    BuiltIn bool
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    Id string
    The provider-assigned unique ID for this managed resource.
    RequiredMetrics string
    BuiltIn bool
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    Id string
    The provider-assigned unique ID for this managed resource.
    RequiredMetrics string
    builtIn Boolean
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    id String
    The provider-assigned unique ID for this managed resource.
    requiredMetrics String
    builtIn boolean
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    id string
    The provider-assigned unique ID for this managed resource.
    requiredMetrics string
    built_in bool
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    id str
    The provider-assigned unique ID for this managed resource.
    required_metrics str
    builtIn Boolean
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    id String
    The provider-assigned unique ID for this managed resource.
    requiredMetrics String

    Look up Existing AzureService Resource

    Get an existing AzureService 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?: AzureServiceState, opts?: CustomResourceOptions): AzureService
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            built_in: Optional[bool] = None,
            credentials_id: Optional[str] = None,
            metrics: Optional[Sequence[AzureServiceMetricArgs]] = None,
            name: Optional[str] = None,
            required_metrics: Optional[str] = None,
            use_recommended_metrics: Optional[bool] = None) -> AzureService
    func GetAzureService(ctx *Context, name string, id IDInput, state *AzureServiceState, opts ...ResourceOption) (*AzureService, error)
    public static AzureService Get(string name, Input<string> id, AzureServiceState? state, CustomResourceOptions? opts = null)
    public static AzureService get(String name, Output<String> id, AzureServiceState 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:
    BuiltIn bool
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    CredentialsId string
    the ID of the azure credentials this supported service belongs to
    Metrics List<Pulumiverse.Dynatrace.Inputs.AzureServiceMetric>
    Name string
    The name of the supporting service.
    RequiredMetrics string
    UseRecommendedMetrics bool
    BuiltIn bool
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    CredentialsId string
    the ID of the azure credentials this supported service belongs to
    Metrics []AzureServiceMetricArgs
    Name string
    The name of the supporting service.
    RequiredMetrics string
    UseRecommendedMetrics bool
    builtIn Boolean
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    credentialsId String
    the ID of the azure credentials this supported service belongs to
    metrics List<AzureServiceMetric>
    name String
    The name of the supporting service.
    requiredMetrics String
    useRecommendedMetrics Boolean
    builtIn boolean
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    credentialsId string
    the ID of the azure credentials this supported service belongs to
    metrics AzureServiceMetric[]
    name string
    The name of the supporting service.
    requiredMetrics string
    useRecommendedMetrics boolean
    built_in bool
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    credentials_id str
    the ID of the azure credentials this supported service belongs to
    metrics Sequence[AzureServiceMetricArgs]
    name str
    The name of the supporting service.
    required_metrics str
    use_recommended_metrics bool
    builtIn Boolean
    This attribute is automatically set to true if Dynatrace considers the supporting service with the given name to be a built-in service
    credentialsId String
    the ID of the azure credentials this supported service belongs to
    metrics List<Property Map>
    name String
    The name of the supporting service.
    requiredMetrics String
    useRecommendedMetrics Boolean

    Supporting Types

    AzureServiceMetric, AzureServiceMetricArgs

    Name string
    the name of the metric of the supporting service
    Dimensions List<string>
    a list of metric's dimensions names
    Name string
    the name of the metric of the supporting service
    Dimensions []string
    a list of metric's dimensions names
    name String
    the name of the metric of the supporting service
    dimensions List<String>
    a list of metric's dimensions names
    name string
    the name of the metric of the supporting service
    dimensions string[]
    a list of metric's dimensions names
    name str
    the name of the metric of the supporting service
    dimensions Sequence[str]
    a list of metric's dimensions names
    name String
    the name of the metric of the supporting service
    dimensions List<String>
    a list of metric's dimensions names

    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.10.0 published on Friday, Jun 7, 2024 by Pulumiverse