timescale.MetricExporter
Explore with Pulumi AI
Schema for a metric exporter.
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.timescale.MetricExporter;
import com.pulumi.timescale.MetricExporterArgs;
import com.pulumi.timescale.inputs.MetricExporterDatadogArgs;
import com.pulumi.timescale.inputs.MetricExporterPrometheusArgs;
import com.pulumi.timescale.inputs.MetricExporterCloudwatchArgs;
import com.pulumi.timescale.Service;
import com.pulumi.timescale.ServiceArgs;
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 config = ctx.config();
final var tsProjectId = config.get("tsProjectId");
final var tsAccessKey = config.get("tsAccessKey");
final var tsSecretKey = config.get("tsSecretKey");
var myDatadogExporter = new MetricExporter("myDatadogExporter", MetricExporterArgs.builder()
.region("us-east-1")
.datadog(MetricExporterDatadogArgs.builder()
.api_key("your_datadog_api_key_here")
.site("datadoghq.com")
.build())
.build());
var myPrometheusExporter = new MetricExporter("myPrometheusExporter", MetricExporterArgs.builder()
.region("us-east-1")
.prometheus(MetricExporterPrometheusArgs.builder()
.username("prom_user")
.password("a_very_secure_password")
.build())
.build());
var myCloudwatchExporterWithRole = new MetricExporter("myCloudwatchExporterWithRole", MetricExporterArgs.builder()
.region("us-east-1")
.cloudwatch(MetricExporterCloudwatchArgs.builder()
.region("us-east-1")
.role_arn("arn:aws:iam::123456789012:role/MyMetricsExporterRole")
.log_group_name("/myapplication/metrics")
.log_stream_name("exporter-stream-role")
.namespace("MyApplication/CustomMetrics")
.build())
.build());
var myCloudwatchExporterWithKeys = new MetricExporter("myCloudwatchExporterWithKeys", MetricExporterArgs.builder()
.region("us-east-1")
.cloudwatch(MetricExporterCloudwatchArgs.builder()
.region("us-east-1")
.access_key("your_access_key_")
.secret_key("your_secret_keyxxxxxxxxxxxxxxxxxxxxxxxxx")
.log_group_name("/anotherapplication/metrics")
.log_stream_name("exporter-stream-keys")
.namespace("AnotherApplication/CustomMetrics")
.build())
.build());
// Create a service and attach one of the exporters (only 1 metric exporter can be attached at the same time)
var metricExporterTest = new Service("metricExporterTest", ServiceArgs.builder()
.milliCpu(1000)
.memoryGb(4)
.regionCode("us-east-1")
.metricExporterId(myCloudwatchExporterWithKeys.id())
.build());
}
}
configuration:
tsProjectId:
type: string
tsAccessKey:
type: string
tsSecretKey:
type: string
resources:
myDatadogExporter:
type: timescale:MetricExporter
properties:
region: us-east-1
datadog:
api_key: your_datadog_api_key_here
site: datadoghq.com
myPrometheusExporter:
type: timescale:MetricExporter
properties:
region: us-east-1
prometheus:
username: prom_user
password: a_very_secure_password
myCloudwatchExporterWithRole:
type: timescale:MetricExporter
properties:
region: us-east-1
cloudwatch:
region: us-east-1
role_arn: arn:aws:iam::123456789012:role/MyMetricsExporterRole
log_group_name: /myapplication/metrics
log_stream_name: exporter-stream-role
namespace: MyApplication/CustomMetrics
myCloudwatchExporterWithKeys:
type: timescale:MetricExporter
properties:
region: us-east-1
cloudwatch:
region: us-east-1
access_key: your_access_key_
secret_key: your_secret_keyxxxxxxxxxxxxxxxxxxxxxxxxx
log_group_name: /anotherapplication/metrics
log_stream_name: exporter-stream-keys
namespace: AnotherApplication/CustomMetrics
# Create a service and attach one of the exporters (only 1 metric exporter can be attached at the same time)
metricExporterTest:
type: timescale:Service
properties:
milliCpu: 1000
memoryGb: 4
regionCode: us-east-1
metricExporterId: ${myCloudwatchExporterWithKeys.id}
Create MetricExporter Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MetricExporter(name: string, args: MetricExporterArgs, opts?: CustomResourceOptions);
@overload
def MetricExporter(resource_name: str,
args: MetricExporterArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MetricExporter(resource_name: str,
opts: Optional[ResourceOptions] = None,
region: Optional[str] = None,
cloudwatch: Optional[MetricExporterCloudwatchArgs] = None,
datadog: Optional[MetricExporterDatadogArgs] = None,
name: Optional[str] = None,
prometheus: Optional[MetricExporterPrometheusArgs] = None)
func NewMetricExporter(ctx *Context, name string, args MetricExporterArgs, opts ...ResourceOption) (*MetricExporter, error)
public MetricExporter(string name, MetricExporterArgs args, CustomResourceOptions? opts = null)
public MetricExporter(String name, MetricExporterArgs args)
public MetricExporter(String name, MetricExporterArgs args, CustomResourceOptions options)
type: timescale:MetricExporter
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 MetricExporterArgs
- 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 MetricExporterArgs
- 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 MetricExporterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MetricExporterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MetricExporterArgs
- 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 metricExporterResource = new Timescale.MetricExporter("metricExporterResource", new()
{
Region = "string",
Cloudwatch = new Timescale.Inputs.MetricExporterCloudwatchArgs
{
LogGroupName = "string",
LogStreamName = "string",
Namespace = "string",
Region = "string",
AccessKey = "string",
RoleArn = "string",
SecretKey = "string",
},
Datadog = new Timescale.Inputs.MetricExporterDatadogArgs
{
ApiKey = "string",
Site = "string",
},
Name = "string",
Prometheus = new Timescale.Inputs.MetricExporterPrometheusArgs
{
Password = "string",
Username = "string",
},
});
example, err := timescale.NewMetricExporter(ctx, "metricExporterResource", ×cale.MetricExporterArgs{
Region: pulumi.String("string"),
Cloudwatch: ×cale.MetricExporterCloudwatchArgs{
LogGroupName: pulumi.String("string"),
LogStreamName: pulumi.String("string"),
Namespace: pulumi.String("string"),
Region: pulumi.String("string"),
AccessKey: pulumi.String("string"),
RoleArn: pulumi.String("string"),
SecretKey: pulumi.String("string"),
},
Datadog: ×cale.MetricExporterDatadogArgs{
ApiKey: pulumi.String("string"),
Site: pulumi.String("string"),
},
Name: pulumi.String("string"),
Prometheus: ×cale.MetricExporterPrometheusArgs{
Password: pulumi.String("string"),
Username: pulumi.String("string"),
},
})
var metricExporterResource = new MetricExporter("metricExporterResource", MetricExporterArgs.builder()
.region("string")
.cloudwatch(MetricExporterCloudwatchArgs.builder()
.logGroupName("string")
.logStreamName("string")
.namespace("string")
.region("string")
.accessKey("string")
.roleArn("string")
.secretKey("string")
.build())
.datadog(MetricExporterDatadogArgs.builder()
.apiKey("string")
.site("string")
.build())
.name("string")
.prometheus(MetricExporterPrometheusArgs.builder()
.password("string")
.username("string")
.build())
.build());
metric_exporter_resource = timescale.MetricExporter("metricExporterResource",
region="string",
cloudwatch={
"log_group_name": "string",
"log_stream_name": "string",
"namespace": "string",
"region": "string",
"access_key": "string",
"role_arn": "string",
"secret_key": "string",
},
datadog={
"api_key": "string",
"site": "string",
},
name="string",
prometheus={
"password": "string",
"username": "string",
})
const metricExporterResource = new timescale.MetricExporter("metricExporterResource", {
region: "string",
cloudwatch: {
logGroupName: "string",
logStreamName: "string",
namespace: "string",
region: "string",
accessKey: "string",
roleArn: "string",
secretKey: "string",
},
datadog: {
apiKey: "string",
site: "string",
},
name: "string",
prometheus: {
password: "string",
username: "string",
},
});
type: timescale:MetricExporter
properties:
cloudwatch:
accessKey: string
logGroupName: string
logStreamName: string
namespace: string
region: string
roleArn: string
secretKey: string
datadog:
apiKey: string
site: string
name: string
prometheus:
password: string
username: string
region: string
MetricExporter Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MetricExporter resource accepts the following input properties:
- Region string
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- Cloudwatch
Metric
Exporter Cloudwatch - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - Datadog
Metric
Exporter Datadog - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - Name string
- Metric exporter name.
- Prometheus
Metric
Exporter Prometheus - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
.
- Region string
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- Cloudwatch
Metric
Exporter Cloudwatch Args - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - Datadog
Metric
Exporter Datadog Args - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - Name string
- Metric exporter name.
- Prometheus
Metric
Exporter Prometheus Args - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
.
- region String
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- cloudwatch
Metric
Exporter Cloudwatch - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - datadog
Metric
Exporter Datadog - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - name String
- Metric exporter name.
- prometheus
Metric
Exporter Prometheus - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
.
- region string
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- cloudwatch
Metric
Exporter Cloudwatch - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - datadog
Metric
Exporter Datadog - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - name string
- Metric exporter name.
- prometheus
Metric
Exporter Prometheus - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
.
- region str
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- cloudwatch
Metric
Exporter Cloudwatch Args - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - datadog
Metric
Exporter Datadog Args - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - name str
- Metric exporter name.
- prometheus
Metric
Exporter Prometheus Args - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
.
- region String
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- cloudwatch Property Map
- Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - datadog Property Map
- Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - name String
- Metric exporter name.
- prometheus Property Map
- Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
.
Outputs
All input properties are implicitly available as output properties. Additionally, the MetricExporter resource produces the following output properties:
Look up Existing MetricExporter Resource
Get an existing MetricExporter 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?: MetricExporterState, opts?: CustomResourceOptions): MetricExporter
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cloudwatch: Optional[MetricExporterCloudwatchArgs] = None,
created: Optional[str] = None,
datadog: Optional[MetricExporterDatadogArgs] = None,
name: Optional[str] = None,
prometheus: Optional[MetricExporterPrometheusArgs] = None,
region: Optional[str] = None,
type: Optional[str] = None) -> MetricExporter
func GetMetricExporter(ctx *Context, name string, id IDInput, state *MetricExporterState, opts ...ResourceOption) (*MetricExporter, error)
public static MetricExporter Get(string name, Input<string> id, MetricExporterState? state, CustomResourceOptions? opts = null)
public static MetricExporter get(String name, Output<String> id, MetricExporterState state, CustomResourceOptions options)
resources: _: type: timescale:MetricExporter get: id: ${id}
- 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.
- Cloudwatch
Metric
Exporter Cloudwatch - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - Created string
- Timestamp of when the metric exporter was created (RFC3339 format).
- Datadog
Metric
Exporter Datadog - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - Name string
- Metric exporter name.
- Prometheus
Metric
Exporter Prometheus - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
. - Region string
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- Type string
- Type of the metric exporter. Possible values: datadog, prometheus, cloudwatch.
- Cloudwatch
Metric
Exporter Cloudwatch Args - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - Created string
- Timestamp of when the metric exporter was created (RFC3339 format).
- Datadog
Metric
Exporter Datadog Args - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - Name string
- Metric exporter name.
- Prometheus
Metric
Exporter Prometheus Args - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
. - Region string
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- Type string
- Type of the metric exporter. Possible values: datadog, prometheus, cloudwatch.
- cloudwatch
Metric
Exporter Cloudwatch - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - created String
- Timestamp of when the metric exporter was created (RFC3339 format).
- datadog
Metric
Exporter Datadog - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - name String
- Metric exporter name.
- prometheus
Metric
Exporter Prometheus - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
. - region String
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- type String
- Type of the metric exporter. Possible values: datadog, prometheus, cloudwatch.
- cloudwatch
Metric
Exporter Cloudwatch - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - created string
- Timestamp of when the metric exporter was created (RFC3339 format).
- datadog
Metric
Exporter Datadog - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - name string
- Metric exporter name.
- prometheus
Metric
Exporter Prometheus - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
. - region string
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- type string
- Type of the metric exporter. Possible values: datadog, prometheus, cloudwatch.
- cloudwatch
Metric
Exporter Cloudwatch Args - Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - created str
- Timestamp of when the metric exporter was created (RFC3339 format).
- datadog
Metric
Exporter Datadog Args - Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - name str
- Metric exporter name.
- prometheus
Metric
Exporter Prometheus Args - Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
. - region str
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- type str
- Type of the metric exporter. Possible values: datadog, prometheus, cloudwatch.
- cloudwatch Property Map
- Configuration for AWS CloudWatch exporter. Configure authentication using either
role_arn
oraccess_key
withsecret_key
. Cannot be used withdatadog
orprometheus
. - created String
- Timestamp of when the metric exporter was created (RFC3339 format).
- datadog Property Map
- Configuration for Datadog exporter. Cannot be used with
prometheus
orcloudwatch
. - name String
- Metric exporter name.
- prometheus Property Map
- Configuration for Prometheus exporter. Cannot be used with
datadog
orcloudwatch
. - region String
- Region where the exporter will be deployed. Only services running in the same region can be attached.
- type String
- Type of the metric exporter. Possible values: datadog, prometheus, cloudwatch.
Supporting Types
MetricExporterCloudwatch, MetricExporterCloudwatchArgs
- Log
Group stringName - Name of the CloudWatch Log Group.
- Log
Stream stringName - Name of the CloudWatch Log Stream.
- Namespace string
- CloudWatch Metric Namespace.
- Region string
- AWS region for CloudWatch.
- Access
Key string - AWS access key ID. If provided,
secret_key
must also be set, androle_arn
must not be set. - Role
Arn string - ARN of the IAM role to assume for CloudWatch access. If provided,
access_key
andsecret_key
must not be set. - Secret
Key string - AWS secret access key. If provided,
access_key
must also be set, androle_arn
must not be set.
- Log
Group stringName - Name of the CloudWatch Log Group.
- Log
Stream stringName - Name of the CloudWatch Log Stream.
- Namespace string
- CloudWatch Metric Namespace.
- Region string
- AWS region for CloudWatch.
- Access
Key string - AWS access key ID. If provided,
secret_key
must also be set, androle_arn
must not be set. - Role
Arn string - ARN of the IAM role to assume for CloudWatch access. If provided,
access_key
andsecret_key
must not be set. - Secret
Key string - AWS secret access key. If provided,
access_key
must also be set, androle_arn
must not be set.
- log
Group StringName - Name of the CloudWatch Log Group.
- log
Stream StringName - Name of the CloudWatch Log Stream.
- namespace String
- CloudWatch Metric Namespace.
- region String
- AWS region for CloudWatch.
- access
Key String - AWS access key ID. If provided,
secret_key
must also be set, androle_arn
must not be set. - role
Arn String - ARN of the IAM role to assume for CloudWatch access. If provided,
access_key
andsecret_key
must not be set. - secret
Key String - AWS secret access key. If provided,
access_key
must also be set, androle_arn
must not be set.
- log
Group stringName - Name of the CloudWatch Log Group.
- log
Stream stringName - Name of the CloudWatch Log Stream.
- namespace string
- CloudWatch Metric Namespace.
- region string
- AWS region for CloudWatch.
- access
Key string - AWS access key ID. If provided,
secret_key
must also be set, androle_arn
must not be set. - role
Arn string - ARN of the IAM role to assume for CloudWatch access. If provided,
access_key
andsecret_key
must not be set. - secret
Key string - AWS secret access key. If provided,
access_key
must also be set, androle_arn
must not be set.
- log_
group_ strname - Name of the CloudWatch Log Group.
- log_
stream_ strname - Name of the CloudWatch Log Stream.
- namespace str
- CloudWatch Metric Namespace.
- region str
- AWS region for CloudWatch.
- access_
key str - AWS access key ID. If provided,
secret_key
must also be set, androle_arn
must not be set. - role_
arn str - ARN of the IAM role to assume for CloudWatch access. If provided,
access_key
andsecret_key
must not be set. - secret_
key str - AWS secret access key. If provided,
access_key
must also be set, androle_arn
must not be set.
- log
Group StringName - Name of the CloudWatch Log Group.
- log
Stream StringName - Name of the CloudWatch Log Stream.
- namespace String
- CloudWatch Metric Namespace.
- region String
- AWS region for CloudWatch.
- access
Key String - AWS access key ID. If provided,
secret_key
must also be set, androle_arn
must not be set. - role
Arn String - ARN of the IAM role to assume for CloudWatch access. If provided,
access_key
andsecret_key
must not be set. - secret
Key String - AWS secret access key. If provided,
access_key
must also be set, androle_arn
must not be set.
MetricExporterDatadog, MetricExporterDatadogArgs
MetricExporterPrometheus, MetricExporterPrometheusArgs
Package Details
- Repository
- timescale timescale/terraform-provider-timescale
- License
- Notes
- This Pulumi package is based on the
timescale
Terraform Provider.