@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:36.788Z") public class CfnCustomMetric extends CfnResource implements IInspectable
Use the AWS::IoT::CustomMetric
resource to define a custom metric published by your devices to Device Defender. For API reference, see CreateCustomMetric and for general information, see Custom metrics .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.iot.*; CfnCustomMetric cfnCustomMetric = CfnCustomMetric.Builder.create(this, "MyCfnCustomMetric") .metricType("metricType") // the properties below are optional .displayName("displayName") .metricName("metricName") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnCustomMetric.Builder
A fluent builder for
CfnCustomMetric . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnCustomMetric(Construct scope,
java.lang.String id,
CfnCustomMetricProps props)
Create a new `AWS::IoT::CustomMetric`.
|
protected |
CfnCustomMetric(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnCustomMetric(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrMetricArn()
The Amazon Resource Number (ARN) of the custom metric;
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getDisplayName()
The friendly name in the console for the custom metric.
|
java.lang.String |
getMetricName()
The name of the custom metric.
|
java.lang.String |
getMetricType()
The type of the custom metric.
|
TagManager |
getTags()
Metadata that can be used to manage the custom metric.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setDisplayName(java.lang.String value)
The friendly name in the console for the custom metric.
|
void |
setMetricName(java.lang.String value)
The name of the custom metric.
|
void |
setMetricType(java.lang.String value)
The type of the custom metric.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnCustomMetric(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnCustomMetric(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnCustomMetric(Construct scope, java.lang.String id, CfnCustomMetricProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrMetricArn()
for example, arn: *aws-partition* :iot: *region* : *accountId* :custommetric/ *metricName*
.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.lang.String getMetricType()
The type
number
only takes a single metric value as an input, but when you submit the metrics value in the DeviceMetrics report, you must pass it as an array with a single value.
public void setMetricType(java.lang.String value)
The type
number
only takes a single metric value as an input, but when you submit the metrics value in the DeviceMetrics report, you must pass it as an array with a single value.
public java.lang.String getDisplayName()
This name doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. You can update the friendly name after you define it.
public void setDisplayName(java.lang.String value)
This name doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. You can update the friendly name after you define it.
public java.lang.String getMetricName()
This will be used in the metric report submitted from the device/thing. The name can't begin with aws:
. You can’t change the name after you define it.
public void setMetricName(java.lang.String value)
This will be used in the metric report submitted from the device/thing. The name can't begin with aws:
. You can’t change the name after you define it.