Skip to content
v2.277.0

TargetProperty Struct Added in v2.277.0 ​

Where the notification is sent.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const targetProperty: cloudwatch.CfnAlert.TargetProperty = {
  arn: 'arn',
  type: 'type',

  // the properties below are optional
  metadata: {
    metadataKey: 'metadata',
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudwatch as cloudwatch

target_property = cloudwatch.CfnAlert.TargetProperty(
    arn="arn",
    type="type",

    # the properties below are optional
    metadata={
        "metadata_key": "metadata"
    }
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudwatch.*;

TargetProperty targetProperty = TargetProperty.builder()
        .arn("arn")
        .type("type")

        // the properties below are optional
        .metadata(Map.of(
                "metadataKey", "metadata"))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudWatch;

var targetProperty = new TargetProperty {
    Arn = "arn",
    Type = "type",

    // the properties below are optional
    Metadata = new Dictionary<string, string> {
        { "metadataKey", "metadata" }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

targetProperty := &TargetProperty{
	Arn: jsii.String("arn"),
	Type: jsii.String("type"),

	// the properties below are optional
	Metadata: map[string]*string{
		"metadataKey": jsii.String("metadata"),
	},
}

Properties ​

arnstringarnstrarnStringArnstringArn*stringrequired#
The ARN of the target.

For sns, the ARN of the Amazon SNS topic. For slack and pagerduty, the ARN of a CloudWatch Omni integration.

metadataoptionalIResolvable | { [key: string]: string }metadataoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]metadataoptionalIResolvableMetadataoptionalIResolvableMetadataoptionalinterface{}#
Settings specific to the target, as key-value pairs (up to 20).

The keys depend on the integration type. Not used for sns targets.

typestringtypestrtypeStringTypestringType*stringrequired#
The target type.

Valid values: sns, slack, pagerduty.