dynatrace.AwsService
Explore with Pulumi AI
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
Amazon Web Services - https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-cloud-platforms/amazon-web-services/amazon-web-services-integrations/aws-service-metrics
AWS credentials API - https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/aws-credentials-api
Resource Example Usage
This example utilizes the data source dynatrace.getAwsSupportedServices
in order to query for a full list of all supported services.
The for_each
loop within the resource dynatrace.AwsService
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.AwsService
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.AwsCredentials("tERRAFORMSAMPLE", {
label: "TERRAFORM-TEST-001",
partitionType: "AWS_DEFAULT",
taggedOnly: false,
authenticationData: {
accountId: "246186168471",
iamRole: "Dynatrace_monitoring_role_demo1",
},
removeDefaults: true,
});
const supportedServices = await dynatrace.getAwsSupportedServices({});
const tERRAFORMSAMPLEServices: dynatrace.AwsService[] = [];
for (const range of Object.entries(supportedServices.services).map(([k, v]) => ({key: k, value: v}))) {
tERRAFORMSAMPLEServices.push(new dynatrace.AwsService(`tERRAFORMSAMPLEServices-${range.key}`, {
credentialsId: tERRAFORMSAMPLE.id,
useRecommendedMetrics: true,
}));
}
}
import pulumi
import pulumi_dynatrace as dynatrace
import pulumiverse_dynatrace as dynatrace
t_erraformsample = dynatrace.AwsCredentials("tERRAFORMSAMPLE",
label="TERRAFORM-TEST-001",
partition_type="AWS_DEFAULT",
tagged_only=False,
authentication_data=dynatrace.AwsCredentialsAuthenticationDataArgs(
account_id="246186168471",
iam_role="Dynatrace_monitoring_role_demo1",
),
remove_defaults=True)
supported_services = dynatrace.get_aws_supported_services()
t_erraformsample_services = []
for range in [{"key": k, "value": v} for [k, v] in enumerate(supported_services.services)]:
t_erraformsample_services.append(dynatrace.AwsService(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.NewAwsCredentials(ctx, "tERRAFORMSAMPLE", &dynatrace.AwsCredentialsArgs{
Label: pulumi.String("TERRAFORM-TEST-001"),
PartitionType: pulumi.String("AWS_DEFAULT"),
TaggedOnly: pulumi.Bool(false),
AuthenticationData: &dynatrace.AwsCredentialsAuthenticationDataArgs{
AccountId: pulumi.String("246186168471"),
IamRole: pulumi.String("Dynatrace_monitoring_role_demo1"),
},
RemoveDefaults: pulumi.Bool(true),
})
if err != nil {
return err
}
supportedServices, err := dynatrace.GetAwsSupportedServices(ctx, nil, nil)
if err != nil {
return err
}
var tERRAFORMSAMPLEServices []*dynatrace.AwsService
for key0, _ := range supportedServices.Services {
__res, err := dynatrace.NewAwsService(ctx, fmt.Sprintf("tERRAFORMSAMPLEServices-%v", key0), &dynatrace.AwsServiceArgs{
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.AwsCredentials("tERRAFORMSAMPLE", new()
{
Label = "TERRAFORM-TEST-001",
PartitionType = "AWS_DEFAULT",
TaggedOnly = false,
AuthenticationData = new Dynatrace.Inputs.AwsCredentialsAuthenticationDataArgs
{
AccountId = "246186168471",
IamRole = "Dynatrace_monitoring_role_demo1",
},
RemoveDefaults = true,
});
var supportedServices = await Dynatrace.GetAwsSupportedServices.InvokeAsync();
var tERRAFORMSAMPLEServices = new List<Dynatrace.AwsService>();
foreach (var range in )
{
tERRAFORMSAMPLEServices.Add(new Dynatrace.AwsService($"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.AwsCredentials;
import com.pulumi.dynatrace.AwsCredentialsArgs;
import com.pulumi.dynatrace.inputs.AwsCredentialsAuthenticationDataArgs;
import com.pulumi.dynatrace.DynatraceFunctions;
import com.pulumi.dynatrace.inputs.GetAwsSupportedServicesArgs;
import com.pulumi.dynatrace.AwsService;
import com.pulumi.dynatrace.AwsServiceArgs;
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 AwsCredentials("tERRAFORMSAMPLE", AwsCredentialsArgs.builder()
.label("TERRAFORM-TEST-001")
.partitionType("AWS_DEFAULT")
.taggedOnly(false)
.authenticationData(AwsCredentialsAuthenticationDataArgs.builder()
.accountId("246186168471")
.iamRole("Dynatrace_monitoring_role_demo1")
.build())
.removeDefaults(true)
.build());
final var supportedServices = DynatraceFunctions.getAwsSupportedServices();
final var tERRAFORMSAMPLEServices = supportedServices.applyValue(getAwsSupportedServicesResult -> {
final var resources = new ArrayList<AwsService>();
for (var range : KeyedValue.of(getAwsSupportedServicesResult.services()) {
var resource = new AwsService("tERRAFORMSAMPLEServices-" + range.key(), AwsServiceArgs.builder()
.credentialsId(tERRAFORMSAMPLE.id())
.useRecommendedMetrics(true)
.build());
resources.add(resource);
}
return resources;
});
}
}
resources:
tERRAFORMSAMPLE:
type: dynatrace:AwsCredentials
properties:
label: TERRAFORM-TEST-001
partitionType: AWS_DEFAULT
taggedOnly: false
authenticationData:
accountId: '246186168471'
iamRole: Dynatrace_monitoring_role_demo1
removeDefaults: true
tERRAFORMSAMPLEServices:
type: dynatrace:AwsService
properties:
credentialsId: ${tERRAFORMSAMPLE.id}
useRecommendedMetrics: true
options: {}
variables:
supportedServices:
fn::invoke:
Function: dynatrace:getAwsSupportedServices
Arguments: {}
Create AwsService Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AwsService(name: string, args: AwsServiceArgs, opts?: CustomResourceOptions);
@overload
def AwsService(resource_name: str,
args: AwsServiceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AwsService(resource_name: str,
opts: Optional[ResourceOptions] = None,
credentials_id: Optional[str] = None,
metrics: Optional[Sequence[AwsServiceMetricArgs]] = None,
name: Optional[str] = None,
use_recommended_metrics: Optional[bool] = None)
func NewAwsService(ctx *Context, name string, args AwsServiceArgs, opts ...ResourceOption) (*AwsService, error)
public AwsService(string name, AwsServiceArgs args, CustomResourceOptions? opts = null)
public AwsService(String name, AwsServiceArgs args)
public AwsService(String name, AwsServiceArgs args, CustomResourceOptions options)
type: dynatrace:AwsService
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 AwsServiceArgs
- 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 AwsServiceArgs
- 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 AwsServiceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AwsServiceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AwsServiceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var awsServiceResource = new Dynatrace.AwsService("awsServiceResource", new()
{
CredentialsId = "string",
Metrics = new[]
{
new Dynatrace.Inputs.AwsServiceMetricArgs
{
Name = "string",
Dimensions = new[]
{
"string",
},
Statistic = "string",
},
},
Name = "string",
UseRecommendedMetrics = false,
});
example, err := dynatrace.NewAwsService(ctx, "awsServiceResource", &dynatrace.AwsServiceArgs{
CredentialsId: pulumi.String("string"),
Metrics: dynatrace.AwsServiceMetricArray{
&dynatrace.AwsServiceMetricArgs{
Name: pulumi.String("string"),
Dimensions: pulumi.StringArray{
pulumi.String("string"),
},
Statistic: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
UseRecommendedMetrics: pulumi.Bool(false),
})
var awsServiceResource = new AwsService("awsServiceResource", AwsServiceArgs.builder()
.credentialsId("string")
.metrics(AwsServiceMetricArgs.builder()
.name("string")
.dimensions("string")
.statistic("string")
.build())
.name("string")
.useRecommendedMetrics(false)
.build());
aws_service_resource = dynatrace.AwsService("awsServiceResource",
credentials_id="string",
metrics=[dynatrace.AwsServiceMetricArgs(
name="string",
dimensions=["string"],
statistic="string",
)],
name="string",
use_recommended_metrics=False)
const awsServiceResource = new dynatrace.AwsService("awsServiceResource", {
credentialsId: "string",
metrics: [{
name: "string",
dimensions: ["string"],
statistic: "string",
}],
name: "string",
useRecommendedMetrics: false,
});
type: dynatrace:AwsService
properties:
credentialsId: string
metrics:
- dimensions:
- string
name: string
statistic: string
name: string
useRecommendedMetrics: false
AwsService 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 AwsService resource accepts the following input properties:
- Credentials
Id string - the ID of the azure credentials this supported service belongs to
- Metrics
List<Pulumiverse.
Dynatrace. Inputs. Aws Service Metric> - Name string
- The name of the supporting service.
- Use
Recommended boolMetrics
- Credentials
Id string - the ID of the azure credentials this supported service belongs to
- Metrics
[]Aws
Service Metric Args - Name string
- The name of the supporting service.
- Use
Recommended boolMetrics
- credentials
Id String - the ID of the azure credentials this supported service belongs to
- metrics
List<Aws
Service Metric> - name String
- The name of the supporting service.
- use
Recommended BooleanMetrics
- credentials
Id string - the ID of the azure credentials this supported service belongs to
- metrics
Aws
Service Metric[] - name string
- The name of the supporting service.
- use
Recommended booleanMetrics
- credentials_
id str - the ID of the azure credentials this supported service belongs to
- metrics
Sequence[Aws
Service Metric Args] - name str
- The name of the supporting service.
- use_
recommended_ boolmetrics
- credentials
Id String - the ID of the azure credentials this supported service belongs to
- metrics List<Property Map>
- name String
- The name of the supporting service.
- use
Recommended BooleanMetrics
Outputs
All input properties are implicitly available as output properties. Additionally, the AwsService resource produces the following output properties:
- 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 string
- The provider-assigned unique ID for this managed resource.
- Required
Metrics 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 string
- The provider-assigned unique ID for this managed resource.
- Required
Metrics string
- built
In 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.
- required
Metrics String
- built
In 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.
- required
Metrics 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
- built
In 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.
- required
Metrics String
Look up Existing AwsService Resource
Get an existing AwsService 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?: AwsServiceState, opts?: CustomResourceOptions): AwsService
@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[AwsServiceMetricArgs]] = None,
name: Optional[str] = None,
required_metrics: Optional[str] = None,
use_recommended_metrics: Optional[bool] = None) -> AwsService
func GetAwsService(ctx *Context, name string, id IDInput, state *AwsServiceState, opts ...ResourceOption) (*AwsService, error)
public static AwsService Get(string name, Input<string> id, AwsServiceState? state, CustomResourceOptions? opts = null)
public static AwsService get(String name, Output<String> id, AwsServiceState 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.
- 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 string - the ID of the azure credentials this supported service belongs to
- Metrics
List<Pulumiverse.
Dynatrace. Inputs. Aws Service Metric> - Name string
- The name of the supporting service.
- Required
Metrics string - Use
Recommended boolMetrics
- 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 string - the ID of the azure credentials this supported service belongs to
- Metrics
[]Aws
Service Metric Args - Name string
- The name of the supporting service.
- Required
Metrics string - Use
Recommended boolMetrics
- built
In Boolean - 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 String - the ID of the azure credentials this supported service belongs to
- metrics
List<Aws
Service Metric> - name String
- The name of the supporting service.
- required
Metrics String - use
Recommended BooleanMetrics
- built
In boolean - 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 string - the ID of the azure credentials this supported service belongs to
- metrics
Aws
Service Metric[] - name string
- The name of the supporting service.
- required
Metrics string - use
Recommended booleanMetrics
- 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[Aws
Service Metric Args] - name str
- The name of the supporting service.
- required_
metrics str - use_
recommended_ boolmetrics
- built
In Boolean - 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 String - the ID of the azure credentials this supported service belongs to
- metrics List<Property Map>
- name String
- The name of the supporting service.
- required
Metrics String - use
Recommended BooleanMetrics
Supporting Types
AwsServiceMetric, AwsServiceMetricArgs
- Name string
- the name of the metric of the supporting service
- Dimensions List<string>
- a list of metric's dimensions names
- Statistic string
- Possible values are
AVERAGE
,AVG_MIN_MAX
,MAXIMUM
,MINIMUM
,SAMPLE_COUNT
andSUM
- Name string
- the name of the metric of the supporting service
- Dimensions []string
- a list of metric's dimensions names
- Statistic string
- Possible values are
AVERAGE
,AVG_MIN_MAX
,MAXIMUM
,MINIMUM
,SAMPLE_COUNT
andSUM
- name String
- the name of the metric of the supporting service
- dimensions List<String>
- a list of metric's dimensions names
- statistic String
- Possible values are
AVERAGE
,AVG_MIN_MAX
,MAXIMUM
,MINIMUM
,SAMPLE_COUNT
andSUM
- name string
- the name of the metric of the supporting service
- dimensions string[]
- a list of metric's dimensions names
- statistic string
- Possible values are
AVERAGE
,AVG_MIN_MAX
,MAXIMUM
,MINIMUM
,SAMPLE_COUNT
andSUM
- name str
- the name of the metric of the supporting service
- dimensions Sequence[str]
- a list of metric's dimensions names
- statistic str
- Possible values are
AVERAGE
,AVG_MIN_MAX
,MAXIMUM
,MINIMUM
,SAMPLE_COUNT
andSUM
- name String
- the name of the metric of the supporting service
- dimensions List<String>
- a list of metric's dimensions names
- statistic String
- Possible values are
AVERAGE
,AVG_MIN_MAX
,MAXIMUM
,MINIMUM
,SAMPLE_COUNT
andSUM
Package Details
- Repository
- dynatrace pulumiverse/pulumi-dynatrace
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
dynatrace
Terraform Provider.