Skip to content
v2.278.0

CfnAlarm L1 construct ​

The AWS::CloudWatch::Alarm type specifies an alarm and associates it with the specified metric or metric math expression.

When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT_DATA . The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.

When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.

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';

declare const slidingWindow: any;
const cfnAlarm = new cloudwatch.CfnAlarm(this, 'MyCfnAlarm', /* all optional props */ {
  actionConfiguration: {
    alarmTagsPropagation: {
      enabled: false,

      // the properties below are optional
      excludedTagKeys: ['excludedTagKeys'],
      includedTagKeys: ['includedTagKeys'],
    },
  },
  actionsEnabled: false,
  alarmActions: ['alarmActions'],
  alarmDescription: 'alarmDescription',
  alarmName: 'alarmName',
  comparisonOperator: 'comparisonOperator',
  datapointsToAlarm: 123,
  dimensions: [{
    name: 'name',
    value: 'value',
  }],
  evaluateLowSampleCountPercentile: 'evaluateLowSampleCountPercentile',
  evaluationCriteria: {
    promQlCriteria: {
      pendingPeriod: 123,
      query: 'query',
      recoveryPeriod: 123,
    },
  },
  evaluationInterval: 123,
  evaluationPeriods: 123,
  evaluationWindow: {
    slidingWindow: slidingWindow,
    wallClockWindow: {
      timezone: 'timezone',
    },
  },
  extendedStatistic: 'extendedStatistic',
  insufficientDataActions: ['insufficientDataActions'],
  metricName: 'metricName',
  metrics: [{
    id: 'id',

    // the properties below are optional
    accountId: 'accountId',
    expression: 'expression',
    label: 'label',
    metricStat: {
      metric: {
        dimensions: [{
          name: 'name',
          value: 'value',
        }],
        metricName: 'metricName',
        namespace: 'namespace',
      },
      period: 123,
      stat: 'stat',

      // the properties below are optional
      unit: 'unit',
    },
    period: 123,
    returnData: false,
  }],
  namespace: 'namespace',
  okActions: ['okActions'],
  period: 123,
  statistic: 'statistic',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  threshold: 123,
  thresholdMetricId: 'thresholdMetricId',
  treatMissingData: 'treatMissingData',
  unit: 'unit',
  warmUpConfiguration: {
    onlyStartEvaluatingAfterWarmUpPeriodEnds: false,
    warmUpPeriodDurationInMinutes: 123,
  },
});
python
from aws_cdk import CfnTag
# 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

# sliding_window: Any

cfn_alarm = cloudwatch.CfnAlarm(self, "MyCfnAlarm",
    action_configuration=cloudwatch.CfnAlarm.ActionConfigurationProperty(
        alarm_tags_propagation=cloudwatch.CfnAlarm.AlarmTagsPropagationProperty(
            enabled=False,

            # the properties below are optional
            excluded_tag_keys=["excludedTagKeys"],
            included_tag_keys=["includedTagKeys"]
        )
    ),
    actions_enabled=False,
    alarm_actions=["alarmActions"],
    alarm_description="alarmDescription",
    alarm_name="alarmName",
    comparison_operator="comparisonOperator",
    datapoints_to_alarm=123,
    dimensions=[cloudwatch.CfnAlarm.DimensionProperty(
        name="name",
        value="value"
    )],
    evaluate_low_sample_count_percentile="evaluateLowSampleCountPercentile",
    evaluation_criteria=cloudwatch.CfnAlarm.EvaluationCriteriaProperty(
        prom_ql_criteria=cloudwatch.CfnAlarm.AlarmPromQLCriteriaProperty(
            pending_period=123,
            query="query",
            recovery_period=123
        )
    ),
    evaluation_interval=123,
    evaluation_periods=123,
    evaluation_window=cloudwatch.CfnAlarm.EvaluationWindowProperty(
        sliding_window=sliding_window,
        wall_clock_window=cloudwatch.CfnAlarm.WallClockWindowProperty(
            timezone="timezone"
        )
    ),
    extended_statistic="extendedStatistic",
    insufficient_data_actions=["insufficientDataActions"],
    metric_name="metricName",
    metrics=[cloudwatch.CfnAlarm.MetricDataQueryProperty(
        id="id",

        # the properties below are optional
        account_id="accountId",
        expression="expression",
        label="label",
        metric_stat=cloudwatch.CfnAlarm.MetricStatProperty(
            metric=cloudwatch.CfnAlarm.MetricProperty(
                dimensions=[cloudwatch.CfnAlarm.DimensionProperty(
                    name="name",
                    value="value"
                )],
                metric_name="metricName",
                namespace="namespace"
            ),
            period=123,
            stat="stat",

            # the properties below are optional
            unit="unit"
        ),
        period=123,
        return_data=False
    )],
    namespace="namespace",
    ok_actions=["okActions"],
    period=123,
    statistic="statistic",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    threshold=123,
    threshold_metric_id="thresholdMetricId",
    treat_missing_data="treatMissingData",
    unit="unit",
    warm_up_configuration=cloudwatch.CfnAlarm.WarmUpConfigurationProperty(
        only_start_evaluating_after_warm_up_period_ends=False,
        warm_up_period_duration_in_minutes=123
    )
)
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.*;

Object slidingWindow;

CfnAlarm cfnAlarm = CfnAlarm.Builder.create(this, "MyCfnAlarm")
        .actionConfiguration(ActionConfigurationProperty.builder()
                .alarmTagsPropagation(AlarmTagsPropagationProperty.builder()
                        .enabled(false)

                        // the properties below are optional
                        .excludedTagKeys(List.of("excludedTagKeys"))
                        .includedTagKeys(List.of("includedTagKeys"))
                        .build())
                .build())
        .actionsEnabled(false)
        .alarmActions(List.of("alarmActions"))
        .alarmDescription("alarmDescription")
        .alarmName("alarmName")
        .comparisonOperator("comparisonOperator")
        .datapointsToAlarm(123)
        .dimensions(List.of(DimensionProperty.builder()
                .name("name")
                .value("value")
                .build()))
        .evaluateLowSampleCountPercentile("evaluateLowSampleCountPercentile")
        .evaluationCriteria(EvaluationCriteriaProperty.builder()
                .promQlCriteria(AlarmPromQLCriteriaProperty.builder()
                        .pendingPeriod(123)
                        .query("query")
                        .recoveryPeriod(123)
                        .build())
                .build())
        .evaluationInterval(123)
        .evaluationPeriods(123)
        .evaluationWindow(EvaluationWindowProperty.builder()
                .slidingWindow(slidingWindow)
                .wallClockWindow(WallClockWindowProperty.builder()
                        .timezone("timezone")
                        .build())
                .build())
        .extendedStatistic("extendedStatistic")
        .insufficientDataActions(List.of("insufficientDataActions"))
        .metricName("metricName")
        .metrics(List.of(MetricDataQueryProperty.builder()
                .id("id")

                // the properties below are optional
                .accountId("accountId")
                .expression("expression")
                .label("label")
                .metricStat(MetricStatProperty.builder()
                        .metric(MetricProperty.builder()
                                .dimensions(List.of(DimensionProperty.builder()
                                        .name("name")
                                        .value("value")
                                        .build()))
                                .metricName("metricName")
                                .namespace("namespace")
                                .build())
                        .period(123)
                        .stat("stat")

                        // the properties below are optional
                        .unit("unit")
                        .build())
                .period(123)
                .returnData(false)
                .build()))
        .namespace("namespace")
        .okActions(List.of("okActions"))
        .period(123)
        .statistic("statistic")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .threshold(123)
        .thresholdMetricId("thresholdMetricId")
        .treatMissingData("treatMissingData")
        .unit("unit")
        .warmUpConfiguration(WarmUpConfigurationProperty.builder()
                .onlyStartEvaluatingAfterWarmUpPeriodEnds(false)
                .warmUpPeriodDurationInMinutes(123)
                .build())
        .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 slidingWindow;

var cfnAlarm = new CfnAlarm(this, "MyCfnAlarm", new CfnAlarmProps {
    ActionConfiguration = new ActionConfigurationProperty {
        AlarmTagsPropagation = new AlarmTagsPropagationProperty {
            Enabled = false,

            // the properties below are optional
            ExcludedTagKeys = new [] { "excludedTagKeys" },
            IncludedTagKeys = new [] { "includedTagKeys" }
        }
    },
    ActionsEnabled = false,
    AlarmActions = new [] { "alarmActions" },
    AlarmDescription = "alarmDescription",
    AlarmName = "alarmName",
    ComparisonOperator = "comparisonOperator",
    DatapointsToAlarm = 123,
    Dimensions = new [] { new DimensionProperty {
        Name = "name",
        Value = "value"
    } },
    EvaluateLowSampleCountPercentile = "evaluateLowSampleCountPercentile",
    EvaluationCriteria = new EvaluationCriteriaProperty {
        PromQlCriteria = new AlarmPromQLCriteriaProperty {
            PendingPeriod = 123,
            Query = "query",
            RecoveryPeriod = 123
        }
    },
    EvaluationInterval = 123,
    EvaluationPeriods = 123,
    EvaluationWindow = new EvaluationWindowProperty {
        SlidingWindow = slidingWindow,
        WallClockWindow = new WallClockWindowProperty {
            Timezone = "timezone"
        }
    },
    ExtendedStatistic = "extendedStatistic",
    InsufficientDataActions = new [] { "insufficientDataActions" },
    MetricName = "metricName",
    Metrics = new [] { new MetricDataQueryProperty {
        Id = "id",

        // the properties below are optional
        AccountId = "accountId",
        Expression = "expression",
        Label = "label",
        MetricStat = new MetricStatProperty {
            Metric = new MetricProperty {
                Dimensions = new [] { new DimensionProperty {
                    Name = "name",
                    Value = "value"
                } },
                MetricName = "metricName",
                Namespace = "namespace"
            },
            Period = 123,
            Stat = "stat",

            // the properties below are optional
            Unit = "unit"
        },
        Period = 123,
        ReturnData = false
    } },
    Namespace = "namespace",
    OkActions = new [] { "okActions" },
    Period = 123,
    Statistic = "statistic",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    Threshold = 123,
    ThresholdMetricId = "thresholdMetricId",
    TreatMissingData = "treatMissingData",
    Unit = "unit",
    WarmUpConfiguration = new WarmUpConfigurationProperty {
        OnlyStartEvaluatingAfterWarmUpPeriodEnds = false,
        WarmUpPeriodDurationInMinutes = 123
    }
});
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"

var slidingWindow interface{}

cfnAlarm := awscdk.Aws_cloudwatch.NewCfnAlarm(this, jsii.String("MyCfnAlarm"), &CfnAlarmProps{
	ActionConfiguration: &ActionConfigurationProperty{
		AlarmTagsPropagation: &AlarmTagsPropagationProperty{
			Enabled: jsii.Boolean(false),

			// the properties below are optional
			ExcludedTagKeys: []*string{
				jsii.String("excludedTagKeys"),
			},
			IncludedTagKeys: []*string{
				jsii.String("includedTagKeys"),
			},
		},
	},
	ActionsEnabled: jsii.Boolean(false),
	AlarmActions: []interface{}{
		jsii.String("alarmActions"),
	},
	AlarmDescription: jsii.String("alarmDescription"),
	AlarmName: jsii.String("alarmName"),
	ComparisonOperator: jsii.String("comparisonOperator"),
	DatapointsToAlarm: jsii.Number(123),
	Dimensions: []interface{}{
		&DimensionProperty{
			Name: jsii.String("name"),
			Value: jsii.String("value"),
		},
	},
	EvaluateLowSampleCountPercentile: jsii.String("evaluateLowSampleCountPercentile"),
	EvaluationCriteria: &EvaluationCriteriaProperty{
		PromQlCriteria: &AlarmPromQLCriteriaProperty{
			PendingPeriod: jsii.Number(123),
			Query: jsii.String("query"),
			RecoveryPeriod: jsii.Number(123),
		},
	},
	EvaluationInterval: jsii.Number(123),
	EvaluationPeriods: jsii.Number(123),
	EvaluationWindow: &EvaluationWindowProperty{
		SlidingWindow: slidingWindow,
		WallClockWindow: &WallClockWindowProperty{
			Timezone: jsii.String("timezone"),
		},
	},
	ExtendedStatistic: jsii.String("extendedStatistic"),
	InsufficientDataActions: []interface{}{
		jsii.String("insufficientDataActions"),
	},
	MetricName: jsii.String("metricName"),
	Metrics: []interface{}{
		&MetricDataQueryProperty{
			Id: jsii.String("id"),

			// the properties below are optional
			AccountId: jsii.String("accountId"),
			Expression: jsii.String("expression"),
			Label: jsii.String("label"),
			MetricStat: &MetricStatProperty{
				Metric: &MetricProperty{
					Dimensions: []interface{}{
						&DimensionProperty{
							Name: jsii.String("name"),
							Value: jsii.String("value"),
						},
					},
					MetricName: jsii.String("metricName"),
					Namespace: jsii.String("namespace"),
				},
				Period: jsii.Number(123),
				Stat: jsii.String("stat"),

				// the properties below are optional
				Unit: jsii.String("unit"),
			},
			Period: jsii.Number(123),
			ReturnData: jsii.Boolean(false),
		},
	},
	Namespace: jsii.String("namespace"),
	OkActions: []interface{}{
		jsii.String("okActions"),
	},
	Period: jsii.Number(123),
	Statistic: jsii.String("statistic"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	Threshold: jsii.Number(123),
	ThresholdMetricId: jsii.String("thresholdMetricId"),
	TreatMissingData: jsii.String("treatMissingData"),
	Unit: jsii.String("unit"),
	WarmUpConfiguration: &WarmUpConfigurationProperty{
		OnlyStartEvaluatingAfterWarmUpPeriodEnds: jsii.Boolean(false),
		WarmUpPeriodDurationInMinutes: jsii.Number(123),
	},
})

Initializer ​

ts
new CfnAlarm(scope: Construct, id: string, props?: CfnAlarmProps)
python
CfnAlarm(scope: Construct, id: str, props: typing.Optional[CfnAlarmProps] = None)
java
new CfnAlarm(Construct scope, String id, CfnAlarmProps props)
csharp
new CfnAlarm(Construct scope, string id, CfnAlarmProps? props = null)
go
NewCfnAlarm(Scope Construct, Id *string, Props CfnAlarmProps)

Construct Props ​

actionConfigurationoptionalIResolvable | CfnAlarm.ActionConfigurationPropertyaction_configurationoptionaltyping.Union[IResolvable, ActionConfigurationProperty]actionConfigurationoptionalIResolvableActionConfigurationoptionalIResolvableActionConfigurationoptionalinterface{} #
actionsEnabledoptionalboolean | IResolvableactions_enabledoptionaltyping.Union[bool, IResolvable]actionsEnabledoptionalBooleanActionsEnabledoptionalboolActionsEnabledoptionalinterface{} = true #
Indicates whether actions should be executed during any changes to the alarm state.

The default is TRUE.

alarmActionsoptionalstring | IScalingPolicyRef | ITopicRef[]alarm_actionsoptionaltyping.List[typing.Union[str, IScalingPolicyRef, ITopicRef]]alarmActionsoptionalList<String>AlarmActionsoptionalstring[]AlarmActionsoptional*[]interface{} #
The list of actions to execute when this alarm transitions into an ALARM state from any other state.
notes

Specify each action as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see PutMetricAlarm in the Amazon CloudWatch API Reference .

alarmDescriptionoptionalstringalarm_descriptionoptionalstralarmDescriptionoptionalStringAlarmDescriptionoptionalstringAlarmDescriptionoptional*string #
The description of the alarm.
alarmNameoptionalstringalarm_nameoptionalstralarmNameoptionalStringAlarmNameoptionalstringAlarmNameoptional*string #
The name of the alarm.
notes

If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the alarm name.

If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

comparisonOperatoroptionalstringcomparison_operatoroptionalstrcomparisonOperatoroptionalStringComparisonOperatoroptionalstringComparisonOperatoroptional*string #
The arithmetic operation to use when comparing the specified statistic and threshold.

The specified statistic value is used as the first operand.

datapointsToAlarmoptionalnumberdatapoints_to_alarmoptionalint | floatdatapointsToAlarmoptionalNumberDatapointsToAlarmoptionaldoubleDatapointsToAlarmoptional*float64 #
The number of datapoints that must be breaching to trigger the alarm.
notes

This is used only if you are setting an "M out of N" alarm. In that case, this value is the M, and the value that you set for EvaluationPeriods is the N value. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide .

If you omit this parameter, CloudWatch uses the same value here that you set for EvaluationPeriods , and the alarm goes to alarm state if that many consecutive periods are breaching.

dimensionsoptionalIResolvable | IResolvable | CfnAlarm.DimensionProperty[]dimensionsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, DimensionProperty]]]dimensionsoptionalIResolvableDimensionsoptionalIResolvableDimensionsoptionalinterface{} #
The dimensions for the metric associated with the alarm.

For an alarm based on a math expression, you can't specify Dimensions . Instead, you use Metrics .

evaluateLowSampleCountPercentileoptionalstringevaluate_low_sample_count_percentileoptionalstrevaluateLowSampleCountPercentileoptionalStringEvaluateLowSampleCountPercentileoptionalstringEvaluateLowSampleCountPercentileoptional*string #
Used only for alarms based on percentiles.
notes

If ignore , the alarm state does not change during periods with too few data points to be statistically significant. If evaluate or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.

evaluationCriteriaoptionalIResolvable | CfnAlarm.EvaluationCriteriaPropertyevaluation_criteriaoptionaltyping.Union[IResolvable, EvaluationCriteriaProperty]evaluationCriteriaoptionalIResolvableEvaluationCriteriaoptionalIResolvableEvaluationCriteriaoptionalinterface{} #
The evaluation criteria for an alarm.

This is a union type that currently supports PromQLCriteria.

evaluationIntervaloptionalnumberevaluation_intervaloptionalint | floatevaluationIntervaloptionalNumberEvaluationIntervaloptionaldoubleEvaluationIntervaloptional*float64 #
The frequency, in seconds, at which the alarm is evaluated.
evaluationPeriodsoptionalnumberevaluation_periodsoptionalint | floatevaluationPeriodsoptionalNumberEvaluationPeriodsoptionaldoubleEvaluationPeriodsoptional*float64 #
The number of periods over which data is compared to the specified threshold.
notes

If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N, and DatapointsToAlarm is the M.

For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide .

evaluationWindowoptionalIResolvable | CfnAlarm.EvaluationWindowPropertyevaluation_windowoptionaltyping.Union[IResolvable, EvaluationWindowProperty]evaluationWindowoptionalIResolvableEvaluationWindowoptionalIResolvableEvaluationWindowoptionalinterface{} #
The evaluation window that an alarm uses to select the range of metric data that it evaluates each time it runs.
notes

This is a union type. Set exactly one of its members, SlidingWindow or WallClockWindow. If you don't set EvaluationWindow, the alarm uses a SlidingWindow by default. For more information, see Alarm evaluation windows in the CloudWatch User Guide.

extendedStatisticoptionalstringextended_statisticoptionalstrextendedStatisticoptionalStringExtendedStatisticoptionalstringExtendedStatisticoptional*string #
The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.

For an alarm based on a metric, you must specify either Statistic or ExtendedStatistic but not both.

For an alarm based on a math expression, you can't specify ExtendedStatistic . Instead, you use Metrics .

insufficientDataActionsoptionalstring | ITopicRef[]insufficient_data_actionsoptionaltyping.List[typing.Union[str, ITopicRef]]insufficientDataActionsoptionalList<String>InsufficientDataActionsoptionalstring[]InsufficientDataActionsoptional*[]interface{} #
The actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state.

Each action is specified as an Amazon Resource Name (ARN).

metricNameoptionalstringmetric_nameoptionalstrmetricNameoptionalStringMetricNameoptionalstringMetricNameoptional*string #
The name of the metric associated with the alarm.

This is required for an alarm based on a metric. For an alarm based on a math expression, you use Metrics instead and you can't specify MetricName .

metricsoptionalIResolvable | IResolvable | CfnAlarm.MetricDataQueryProperty[]metricsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, MetricDataQueryProperty]]]metricsoptionalIResolvableMetricsoptionalIResolvableMetricsoptionalinterface{} #
An array that enables you to create an alarm based on the result of a metric math expression.
notes

Each item in the array either retrieves a metric or performs a math expression.

If you specify the Metrics parameter, you cannot specify MetricName , Dimensions , Period , Namespace , Statistic , ExtendedStatistic , or Unit .

namespaceoptionalstringnamespaceoptionalstrnamespaceoptionalStringNamespaceoptionalstringNamespaceoptional*string #
The namespace of the metric associated with the alarm.
notes

This is required for an alarm based on a metric. For an alarm based on a math expression, you can't specify Namespace and you use Metrics instead.

For a list of namespaces for metrics from AWS services, see AWS Services That Publish CloudWatch Metrics.

okActionsoptionalstring | ITopicRef[]ok_actionsoptionaltyping.List[typing.Union[str, ITopicRef]]okActionsoptionalList<String>OkActionsoptionalstring[]OkActionsoptional*[]interface{} #
The actions to execute when this alarm transitions to the `OK` state from any other state.

Each action is specified as an Amazon Resource Name (ARN).

periodoptionalnumberperiodoptionalint | floatperiodoptionalNumberPeriodoptionaldoublePeriodoptional*float64 #
The period, in seconds, over which the statistic is applied.

This is required for an alarm based on a metric. Valid values are 10, 20, 30, 60, and any multiple of 60.

For an alarm based on a math expression, you can't specify Period , and instead you use the Metrics parameter.

Minimum: 10

statisticoptionalstringstatisticoptionalstrstatisticoptionalStringStatisticoptionalstringStatisticoptional*string #
The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use `ExtendedStatistic` .

For an alarm based on a metric, you must specify either Statistic or ExtendedStatistic but not both.

For an alarm based on a math expression, you can't specify Statistic . Instead, you use Metrics .

tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
A list of key-value pairs to associate with the alarm.
notes

You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the cloudwatch:TagResource permission.

Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.

thresholdoptionalnumberthresholdoptionalint | floatthresholdoptionalNumberThresholdoptionaldoubleThresholdoptional*float64 #
The value to compare with the specified statistic.
thresholdMetricIdoptionalstringthreshold_metric_idoptionalstrthresholdMetricIdoptionalStringThresholdMetricIdoptionalstringThresholdMetricIdoptional*string #
In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.
treatMissingDataoptionalstringtreat_missing_dataoptionalstrtreatMissingDataoptionalStringTreatMissingDataoptionalstringTreatMissingDataoptional*string #
Sets how this alarm is to handle missing data points.
notes

Valid values are breaching , notBreaching , ignore , and missing . For more information, see Configuring How CloudWatch Alarms Treat Missing Data in the Amazon CloudWatch User Guide .

If you omit this parameter, the default behavior of missing is used.

unitoptionalstringunitoptionalstrunitoptionalStringUnitoptionalstringUnitoptional*string #
The unit of the metric associated with the alarm.
notes

Specify this only if you are creating an alarm based on a single metric. Do not specify this if you are specifying a Metrics array.

You can specify the following values: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None.

warmUpConfigurationoptionalIResolvable | CfnAlarm.WarmUpConfigurationPropertywarm_up_configurationoptionaltyping.Union[IResolvable, WarmUpConfigurationProperty]warmUpConfigurationoptionalIResolvableWarmUpConfigurationoptionalIResolvableWarmUpConfigurationoptionalinterface{} #
The configuration settings that define the warm-up behavior for an alarm.
notes

Use these settings to delay alarm evaluation after you create or update the alarm, which reduces alarm noise while a new resource or service starts publishing data. During the warm-up period, the alarm stays in INSUFFICIENT_DATA and does not perform alarm actions.

Properties ​

actionConfigurationmay be undefinedIResolvable | CfnAlarm.ActionConfigurationPropertyaction_configurationmay be undefinedtyping.Union[IResolvable, ActionConfigurationProperty]actionConfigurationmay be undefinedIResolvableActionConfigurationmay be undefinedIResolvableActionConfigurationmay be undefinedinterface{} #
actionsEnabledmay be undefinedboolean | IResolvableactions_enabledmay be undefinedtyping.Union[bool, IResolvable]actionsEnabledmay be undefinedBooleanActionsEnabledmay be undefinedboolActionsEnabledmay be undefinedinterface{} #
Indicates whether actions should be executed during any changes to the alarm state.
alarmActionsmay be undefinedstring[]alarm_actionsmay be undefinedtyping.List[str]alarmActionsmay be undefinedList<String>AlarmActionsmay be undefinedstring[]AlarmActionsmay be undefined*[]*string #
The list of actions to execute when this alarm transitions into an ALARM state from any other state.
alarmDescriptionmay be undefinedstringalarm_descriptionmay be undefinedstralarmDescriptionmay be undefinedStringAlarmDescriptionmay be undefinedstringAlarmDescriptionmay be undefined*string #
The description of the alarm.
alarmNamemay be undefinedstringalarm_namemay be undefinedstralarmNamemay be undefinedStringAlarmNamemay be undefinedstringAlarmNamemay be undefined*string #
The name of the alarm.
A reference to a Alarm resource.
attrArnstringattr_arnstrattrArnStringAttrArnstringAttrArn*string #
The ARN of the CloudWatch alarm, such as `arn:aws:cloudwatch:us-west-2:123456789012:alarm:myCloudWatchAlarm-CPUAlarm-UXMMZK36R55Z` .
cdkTagManagerTagManagercdk_tag_managerTagManagercdkTagManagerTagManagerCdkTagManagerTagManagerCdkTagManagerTagManager #
Tag Manager which manages the tags for this resource.
CFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAMEstrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*string static #
The CloudFormation resource type name for this resource class.
Options for this resource, such as condition, update policy etc.
cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*string #
AWS resource type.
comparisonOperatormay be undefinedstringcomparison_operatormay be undefinedstrcomparisonOperatormay be undefinedStringComparisonOperatormay be undefinedstringComparisonOperatormay be undefined*string #
The arithmetic operation to use when comparing the specified statistic and threshold.
creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*string #
datapointsToAlarmmay be undefinednumberdatapoints_to_alarmmay be undefinedint | floatdatapointsToAlarmmay be undefinedNumberDatapointsToAlarmmay be undefineddoubleDatapointsToAlarmmay be undefined*float64 #
The number of datapoints that must be breaching to trigger the alarm.
dimensionsmay be undefinedIResolvable | IResolvable | CfnAlarm.DimensionProperty[]dimensionsmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, DimensionProperty]]]dimensionsmay be undefinedIResolvableDimensionsmay be undefinedIResolvableDimensionsmay be undefinedinterface{} #
The dimensions for the metric associated with the alarm.
evaluateLowSampleCountPercentilemay be undefinedstringevaluate_low_sample_count_percentilemay be undefinedstrevaluateLowSampleCountPercentilemay be undefinedStringEvaluateLowSampleCountPercentilemay be undefinedstringEvaluateLowSampleCountPercentilemay be undefined*string #
Used only for alarms based on percentiles.
evaluationCriteriamay be undefinedIResolvable | CfnAlarm.EvaluationCriteriaPropertyevaluation_criteriamay be undefinedtyping.Union[IResolvable, EvaluationCriteriaProperty]evaluationCriteriamay be undefinedIResolvableEvaluationCriteriamay be undefinedIResolvableEvaluationCriteriamay be undefinedinterface{} #
The evaluation criteria for an alarm.
evaluationIntervalmay be undefinednumberevaluation_intervalmay be undefinedint | floatevaluationIntervalmay be undefinedNumberEvaluationIntervalmay be undefineddoubleEvaluationIntervalmay be undefined*float64 #
The frequency, in seconds, at which the alarm is evaluated.
evaluationPeriodsmay be undefinednumberevaluation_periodsmay be undefinedint | floatevaluationPeriodsmay be undefinedNumberEvaluationPeriodsmay be undefineddoubleEvaluationPeriodsmay be undefined*float64 #
The number of periods over which data is compared to the specified threshold.
evaluationWindowmay be undefinedIResolvable | CfnAlarm.EvaluationWindowPropertyevaluation_windowmay be undefinedtyping.Union[IResolvable, EvaluationWindowProperty]evaluationWindowmay be undefinedIResolvableEvaluationWindowmay be undefinedIResolvableEvaluationWindowmay be undefinedinterface{} #
The evaluation window that an alarm uses to select the range of metric data that it evaluates each time it runs.
extendedStatisticmay be undefinedstringextended_statisticmay be undefinedstrextendedStatisticmay be undefinedStringExtendedStatisticmay be undefinedstringExtendedStatisticmay be undefined*string #
The percentile statistic for the metric associated with the alarm.

Specify a value between p0.0 and p100.

insufficientDataActionsmay be undefinedstring[]insufficient_data_actionsmay be undefinedtyping.List[str]insufficientDataActionsmay be undefinedList<String>InsufficientDataActionsmay be undefinedstring[]InsufficientDataActionsmay be undefined*[]*string #
The actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state.
logicalIdstringlogical_idstrlogicalIdStringLogicalIdstringLogicalId*string #
The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

metricNamemay be undefinedstringmetric_namemay be undefinedstrmetricNamemay be undefinedStringMetricNamemay be undefinedstringMetricNamemay be undefined*string #
The name of the metric associated with the alarm.
metricsmay be undefinedIResolvable | IResolvable | CfnAlarm.MetricDataQueryProperty[]metricsmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, MetricDataQueryProperty]]]metricsmay be undefinedIResolvableMetricsmay be undefinedIResolvableMetricsmay be undefinedinterface{} #
An array that enables you to create an alarm based on the result of a metric math expression.
namespacemay be undefinedstringnamespacemay be undefinedstrnamespacemay be undefinedStringNamespacemay be undefinedstringNamespacemay be undefined*string #
The namespace of the metric associated with the alarm.
nodeNodenodeNodenodeNodeNodeNodeNodeNode #
The tree node.
okActionsmay be undefinedstring[]ok_actionsmay be undefinedtyping.List[str]okActionsmay be undefinedList<String>OkActionsmay be undefinedstring[]OkActionsmay be undefined*[]*string #
The actions to execute when this alarm transitions to the `OK` state from any other state.
periodmay be undefinednumberperiodmay be undefinedint | floatperiodmay be undefinedNumberPeriodmay be undefineddoublePeriodmay be undefined*float64 #
The period, in seconds, over which the statistic is applied.
refstringrefstrrefStringRefstringRef*string #
Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

stackStackstackStackstackStackStackStackStackStack #
The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

statisticmay be undefinedstringstatisticmay be undefinedstrstatisticmay be undefinedStringStatisticmay be undefinedstringStatisticmay be undefined*string #
The statistic for the metric associated with the alarm, other than percentile.

For percentile statistics, use ExtendedStatistic .

tagsmay be undefinedCfnTag[]tagsmay be undefinedtyping.List[CfnTag]tagsmay be undefinedList<CfnTag>Tagsmay be undefinedCfnTag[]Tagsmay be undefined*[]CfnTag #
A list of key-value pairs to associate with the alarm.
thresholdmay be undefinednumberthresholdmay be undefinedint | floatthresholdmay be undefinedNumberThresholdmay be undefineddoubleThresholdmay be undefined*float64 #
The value to compare with the specified statistic.
thresholdMetricIdmay be undefinedstringthreshold_metric_idmay be undefinedstrthresholdMetricIdmay be undefinedStringThresholdMetricIdmay be undefinedstringThresholdMetricIdmay be undefined*string #
In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.
treatMissingDatamay be undefinedstringtreat_missing_datamay be undefinedstrtreatMissingDatamay be undefinedStringTreatMissingDatamay be undefinedstringTreatMissingDatamay be undefined*string #
Sets how this alarm is to handle missing data points.
unitmay be undefinedstringunitmay be undefinedstrunitmay be undefinedStringUnitmay be undefinedstringUnitmay be undefined*string #
The unit of the metric associated with the alarm.
warmUpConfigurationmay be undefinedIResolvable | CfnAlarm.WarmUpConfigurationPropertywarm_up_configurationmay be undefinedtyping.Union[IResolvable, WarmUpConfigurationProperty]warmUpConfigurationmay be undefinedIResolvableWarmUpConfigurationmay be undefinedIResolvableWarmUpConfigurationmay be undefinedinterface{} #
The configuration settings that define the warm-up behavior for an alarm.

Methods ​

addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string) #
Syntactic sugar for `addOverride(path, undefined)`.
1 parameter

Parameters

  • pathpathpathpathPath — The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource) deprecated #
Use `addResourceDependency` instead.

This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.

addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource) deprecated #
Use `addResourceDependency` instead.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.

addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{}) #
Add a value to the CloudFormation Resource Metadata.
addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{}) #
Adds an override to the synthesized CloudFormation resource.
notes · 2 parameters

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

json
"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters

  • pathpathpathpathPath — - The path of the property, you can use dot notation to override values in complex types.
  • valuevaluevaluevalueValue — - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string) #
Adds an override that deletes the value of a property from the resource definition.
1 parameter

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{}) #
Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

2 parameters

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path of the property.
  • valuevaluevaluevalueValue — The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string) #
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength) #
Sets the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.

1 parameter

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions) #
Sets the deletion policy of the resource based on the removal policy specified.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

arnForAlarm(resource: IAlarmRef): string@staticmethod def arn_for_alarm(resource: IAlarmRef) -> strpublic static String arnForAlarm(IAlarmRef resource)public static string ArnForAlarm(IAlarmRef resource)func ArnForAlarm(Resource IAlarmRef) *string static #
cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string #
fromAlarmArn(scope: Construct, id: string, arn: string): IAlarmRef@staticmethod def from_alarm_arn(scope: Construct, id: str, arn: str) -> IAlarmRefpublic static IAlarmRef fromAlarmArn(Construct scope, String id, String arn)public static IAlarmRef FromAlarmArn(Construct scope, string id, string arn)func FromAlarmArn(Scope Construct, Id *string, Arn *string) IAlarmRef static #
Creates a new IAlarmRef from an ARN.
fromAlarmName(scope: Construct, id: string, alarmName: string): IAlarmRef@staticmethod def from_alarm_name(scope: Construct, id: str, alarm_name: str) -> IAlarmRefpublic static IAlarmRef fromAlarmName(Construct scope, String id, String alarmName)public static IAlarmRef FromAlarmName(Construct scope, string id, string alarmName)func FromAlarmName(Scope Construct, Id *string, AlarmName *string) IAlarmRef static #
Creates a new IAlarmRef from a alarmName.
getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference #
Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

1 parameter

Parameters

  • attributeNameattribute_nameattributeNameattributeNameAttributeName — The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{} #
Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector) #
Examines the CloudFormation resource and discloses attributes.
1 parameter

Parameters

  • inspectorinspectorinspectorinspectorInspector — tree inspector to collect and process attributes.
isCfnAlarm(x: any): boolean@staticmethod def is_cfn_alarm(x: Any) -> boolpublic static Boolean isCfnAlarm(Object x)public static bool IsCfnAlarm(object x)func IsCfnAlarm(X interface{}) *bool static #
Checks whether the given object is a CfnAlarm.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *bool static #
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

returns

Returns: The construct as a stack element or undefined if it is not a stack element.

isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *bool static #
Check whether the given object is a CfnResource.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *bool static #
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{} #
Retrieves an array of resources and stacks this resource depends on.

For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.

overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string) #
Overrides the auto-generated logical ID with a specific ID.
1 parameter

Parameters

  • newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId — The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource) deprecated #
Use `removeResourceDependency` instead

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource) #
Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource) #
Replaces one dependency with another.
2 parameters

Parameters

  • targettargettargettargetTarget — The dependency to replace.
  • newTargetnew_targetnewTargetnewTargetNewTarget — The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string #
Returns a string representation of this construct.
returns

Returns: a string representation of this resource

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct #
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.