Monitor Class
Defines monitors that will be associated with an AWS AppConfig environment.
| Source | aws-appconfig/lib/environment.ts |
|---|---|
| Type last changed |
Example
ts
declare const application: appconfig.Application;
declare const alarm: cloudwatch.Alarm;
declare const compositeAlarm: cloudwatch.CompositeAlarm;
new appconfig.Environment(this, 'MyEnvironment', {
application,
monitors: [
appconfig.Monitor.fromCloudWatchAlarm(alarm),
appconfig.Monitor.fromCloudWatchAlarm(compositeAlarm),
],
});
python
# application: appconfig.Application
# alarm: cloudwatch.Alarm
# composite_alarm: cloudwatch.CompositeAlarm
appconfig.Environment(self, "MyEnvironment",
application=application,
monitors=[
appconfig.Monitor.from_cloud_watch_alarm(alarm),
appconfig.Monitor.from_cloud_watch_alarm(composite_alarm)
]
)
java
Application application;
Alarm alarm;
CompositeAlarm compositeAlarm;
Environment.Builder.create(this, "MyEnvironment")
.application(application)
.monitors(List.of(Monitor.fromCloudWatchAlarm(alarm), Monitor.fromCloudWatchAlarm(compositeAlarm)))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Application application;
Alarm alarm;
CompositeAlarm compositeAlarm;
new Environment(this, "MyEnvironment", new EnvironmentProps {
Application = application,
Monitors = new [] { Monitor.FromCloudWatchAlarm(alarm), Monitor.FromCloudWatchAlarm(compositeAlarm) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var application Application
var alarm Alarm
var compositeAlarm CompositeAlarm
appconfig.NewEnvironment(this, jsii.String("MyEnvironment"), &EnvironmentProps{
Application: Application,
Monitors: []Monitor{
appconfig.Monitor_FromCloudWatchAlarm(alarm),
appconfig.Monitor_*FromCloudWatchAlarm(compositeAlarm),
},
})
Initializer
ts
new Monitor()
python
Monitor()
java
new Monitor()
csharp
new Monitor()
go
NewMonitor()
Properties
The alarm ARN for AWS AppConfig to monitor.
alarmRoleArnmay be undefinedstringalarm_role_arnmay be undefinedstralarmRoleArnmay be undefinedStringAlarmRoleArnmay be undefinedstringAlarmRoleArnmay be undefined*string #The IAM role ARN for AWS AppConfig to view the alarm state.
isCompositeAlarmmay be undefinedbooleanis_composite_alarmmay be undefinedboolisCompositeAlarmmay be undefinedBooleanIsCompositeAlarmmay be undefinedboolIsCompositeAlarmmay be undefined*bool #Indicates whether a CloudWatch alarm is a composite alarm.
monitorTypeMonitorTypemonitor_typeMonitorTypemonitorTypeMonitorTypeMonitorTypeMonitorTypeMonitorTypeMonitorType #The type of monitor.
Methods
fromCfnMonitorsProperty(monitorsProperty: CfnEnvironment.MonitorsProperty): Monitor // chainable@staticmethod def from_cfn_monitors_property(monitors_property: MonitorsProperty) -> Monitorpublic static Monitor fromCfnMonitorsProperty(MonitorsProperty monitorsProperty)public static Monitor FromCfnMonitorsProperty(MonitorsProperty monitorsProperty)func FromCfnMonitorsProperty(MonitorsProperty MonitorsProperty) Monitor static #Creates a Monitor from a CfnEnvironment.MonitorsProperty construct.
1 parameter
Parameters
monitorsPropertymonitors_propertymonitorsPropertymonitorsPropertyMonitorsProperty— The monitors property.
fromCloudWatchAlarm(alarm: IAlarmRef, alarmRole?: IRoleRef): Monitor // chainable@staticmethod def from_cloud_watch_alarm(alarm: IAlarmRef, alarm_role: typing.Optional[IRoleRef] = None) -> Monitorpublic static Monitor fromCloudWatchAlarm(IAlarmRef alarm, IRoleRef alarmRole)public static Monitor FromCloudWatchAlarm(IAlarmRef alarm, IRoleRef? alarmRole = null)func FromCloudWatchAlarm(Alarm IAlarmRef, AlarmRole IRoleRef) Monitor static #Creates a Monitor from a CloudWatch alarm.
If the alarm role is not specified, a role will be generated.
2 parameters
Parameters
alarmalarmalarmalarmAlarm— The Amazon CloudWatch alarm.alarmRolealarm_rolealarmRolealarmRoleAlarmRole— The IAM role for AWS AppConfig to view the alarm state.