Module cloudwatch
This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the
pulumi/pulumi-awsrepo; however, if that doesn’t turn up anything, please consult the sourceterraform-providers/terraform-provider-awsrepo.
Resources
- Dashboard
- EventPermission
- EventRule
- EventTarget
- LogDestination
- LogDestinationPolicy
- LogGroup
- LogMetricFilter
- LogResourcePolicy
- LogStream
- LogSubscriptionFilter
- MetricAlarm
Functions
Others
- DashboardArgs
- DashboardState
- DecodedLogGroupEvent
- EventPermissionArgs
- EventPermissionState
- EventRuleArgs
- EventRuleEvent
- EventRuleEventHandler
- EventRuleEventSubscription
- EventRuleEventSubscriptionArgs
- EventRuleState
- EventTargetArgs
- EventTargetState
- GetLogGroupArgs
- GetLogGroupResult
- LogDestinationArgs
- LogDestinationPolicyArgs
- LogDestinationPolicyState
- LogDestinationState
- LogGroupArgs
- LogGroupEvent
- LogGroupEventHandler
- LogGroupEventRecord
- LogGroupEventSubscription
- LogGroupEventSubscriptionArgs
- LogGroupState
- LogMetricFilterArgs
- LogMetricFilterState
- LogResourcePolicyArgs
- LogResourcePolicyState
- LogStreamArgs
- LogStreamState
- LogSubscriptionFilterArgs
- LogSubscriptionFilterState
- MetricAlarmArgs
- MetricAlarmState
- onSchedule
Resources
Resource Dashboard
class Dashboard extends CustomResourceProvides a CloudWatch Dashboard resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const main = new aws.cloudwatch.Dashboard("main", {
dashboardBody: ` {
"widgets": [
{
"type":"metric",
"x":0,
"y":0,
"width":12,
"height":6,
"properties":{
"metrics":[
[
"AWS/EC2",
"CPUUtilization",
"InstanceId",
"i-012345"
]
],
"period":300,
"stat":"Average",
"region":"us-east-1",
"title":"EC2 Instance CPU"
}
},
{
"type":"text",
"x":0,
"y":7,
"width":3,
"height":3,
"properties":{
"markdown":"Hello world"
}
}
]
}
`,
dashboardName: "my-dashboard",
});constructor
new Dashboard(name: string, args: DashboardArgs, opts?: pulumi.CustomResourceOptions)Create a Dashboard resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DashboardState, opts?: pulumi.CustomResourceOptions): DashboardGet an existing Dashboard resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is DashboardReturns true if the given object is an instance of Dashboard. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property dashboardArn
public dashboardArn: pulumi.Output<string>;The Amazon Resource Name (ARN) of the dashboard.
property dashboardBody
public dashboardBody: pulumi.Output<string>;The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.
property dashboardName
public dashboardName: pulumi.Output<string>;The name of the dashboard.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource EventPermission
class EventPermission extends CustomResourceProvides a resource to create a CloudWatch Events permission to support cross-account events in the current account default event bus.
Example Usage
Account Access
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const devAccountAccess = new aws.cloudwatch.EventPermission("DevAccountAccess", {
principal: "123456789012",
statementId: "DevAccountAccess",
});Organization Access
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const organizationAccess = new aws.cloudwatch.EventPermission("OrganizationAccess", {
condition: {
key: "aws:PrincipalOrgID",
type: "StringEquals",
value: aws_organizations_organization_example.id,
},
principal: "*",
statementId: "OrganizationAccess",
});constructor
new EventPermission(name: string, args: EventPermissionArgs, opts?: pulumi.CustomResourceOptions)Create a EventPermission resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EventPermissionState, opts?: pulumi.CustomResourceOptions): EventPermissionGet an existing EventPermission resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is EventPermissionReturns true if the given object is an instance of EventPermission. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property action
public action: pulumi.Output<string | undefined>;The action that you are enabling the other account to perform. Defaults to events:PutEvents.
property condition
public condition: pulumi.Output<EventPermissionCondition | undefined>;Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property principal
public principal: pulumi.Output<string>;The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.
property statementId
public statementId: pulumi.Output<string>;An identifier string for the external account that you are granting permissions to.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource EventRule
class EventRule extends CustomResourceProvides a CloudWatch Event Rule resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const console = new aws.cloudwatch.EventRule("console", {
description: "Capture each AWS Console Sign In",
eventPattern: `{
"detail-type": [
"AWS Console Sign In via CloudTrail"
]
}
`,
});
const awsLogins = new aws.sns.Topic("aws_logins", {});
const sns = new aws.cloudwatch.EventTarget("sns", {
arn: awsLogins.arn,
rule: console.name,
});
const snsTopicPolicy = awsLogins.arn.apply(arn => aws.iam.getPolicyDocument({
statements: [{
actions: ["SNS:Publish"],
effect: "Allow",
principals: [{
identifiers: ["events.amazonaws.com"],
type: "Service",
}],
resources: [arn],
}],
}, { async: true }));
const defaultTopicPolicy = new aws.sns.TopicPolicy("default", {
arn: awsLogins.arn,
policy: snsTopicPolicy.json,
});constructor
new EventRule(name: string, args?: EventRuleArgs, opts?: pulumi.CustomResourceOptions)Create a EventRule resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EventRuleState, opts?: pulumi.CustomResourceOptions): EventRuleGet an existing EventRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is EventRuleReturns true if the given object is an instance of EventRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
method onEvent
onEvent(name: string, handler: EventRuleEventHandler, args?: EventRuleEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): EventRuleEventSubscriptionCreates a new subscription to events fired from this EventRule to the handler provided, along with options to control the behavior of the subscription.
property arn
public arn: pulumi.Output<string>;The Amazon Resource Name (ARN) of the rule.
property description
public description: pulumi.Output<string | undefined>;The description of the rule.
property eventPattern
public eventPattern: pulumi.Output<string | undefined>;Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property isEnabled
public isEnabled: pulumi.Output<boolean | undefined>;Whether the rule should be enabled (defaults to true).
property name
public name: pulumi.Output<string>;The rule’s name. By default generated by this provider.
property namePrefix
public namePrefix: pulumi.Output<string | undefined>;The rule’s name. Conflicts with name.
property roleArn
public roleArn: pulumi.Output<string | undefined>;The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
property scheduleExpression
public scheduleExpression: pulumi.Output<string | undefined>;The scheduling expression.
For example, cron(0 20 * * ? *) or rate(5 minutes).
property tags
public tags: pulumi.Output<{[key: string]: any} | undefined>;A map of tags to assign to the resource.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource EventTarget
class EventTarget extends CustomResourceProvides a CloudWatch Event Target resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const console = new aws.cloudwatch.EventRule("console", {
description: "Capture all EC2 scaling events",
eventPattern: `{
"source": [
"aws.autoscaling"
],
"detail-type": [
"EC2 Instance Launch Successful",
"EC2 Instance Terminate Successful",
"EC2 Instance Launch Unsuccessful",
"EC2 Instance Terminate Unsuccessful"
]
}
`,
});
const testStream = new aws.kinesis.Stream("test_stream", {
shardCount: 1,
});
const yada = new aws.cloudwatch.EventTarget("yada", {
arn: testStream.arn,
rule: console.name,
runCommandTargets: [
{
key: "tag:Name",
values: ["FooBar"],
},
{
key: "InstanceIds",
values: ["i-162058cd308bffec2"],
},
],
});Example SSM Document Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ssmLifecycleTrust = pulumi.output(aws.iam.getPolicyDocument({
statements: [{
actions: ["sts:AssumeRole"],
principals: [{
identifiers: ["events.amazonaws.com"],
type: "Service",
}],
}],
}, { async: true }));
const stopInstance = new aws.ssm.Document("stop_instance", {
content: ` {
"schemaVersion": "1.2",
"description": "Stop an instance",
"parameters": {
},
"runtimeConfig": {
"aws:runShellScript": {
"properties": [
{
"id": "0.aws:runShellScript",
"runCommand": ["halt"]
}
]
}
}
}
`,
documentType: "Command",
});
const ssmLifecyclePolicyDocument = stopInstance.arn.apply(arn => aws.iam.getPolicyDocument({
statements: [
{
actions: ["ssm:SendCommand"],
conditions: [{
test: "StringEquals",
values: ["*"],
variable: "ec2:ResourceTag/Terminate",
}],
effect: "Allow",
resources: ["arn:aws:ec2:eu-west-1:1234567890:instance/*"],
},
{
actions: ["ssm:SendCommand"],
effect: "Allow",
resources: [arn],
},
],
}, { async: true }));
const ssmLifecycleRole = new aws.iam.Role("ssm_lifecycle", {
assumeRolePolicy: ssmLifecycleTrust.json,
});
const ssmLifecyclePolicy = new aws.iam.Policy("ssm_lifecycle", {
policy: ssmLifecyclePolicyDocument.json,
});
const stopInstancesEventRule = new aws.cloudwatch.EventRule("stop_instances", {
description: "Stop instances nightly",
scheduleExpression: "cron(0 0 * * ? *)",
});
const stopInstancesEventTarget = new aws.cloudwatch.EventTarget("stop_instances", {
arn: stopInstance.arn,
roleArn: ssmLifecycleRole.arn,
rule: stopInstancesEventRule.name,
runCommandTargets: [{
key: "tag:Terminate",
values: ["midnight"],
}],
});Example RunCommand Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const stopInstancesEventRule = new aws.cloudwatch.EventRule("stop_instances", {
description: "Stop instances nightly",
scheduleExpression: "cron(0 0 * * ? *)",
});
const stopInstancesEventTarget = new aws.cloudwatch.EventTarget("stop_instances", {
arn: `arn:aws:ssm:${var_aws_region}::document/AWS-RunShellScript`,
input: "{\"commands\":[\"halt\"]}",
roleArn: aws_iam_role_ssm_lifecycle.arn,
rule: stopInstancesEventRule.name,
runCommandTargets: [{
key: "tag:Terminate",
values: ["midnight"],
}],
});Example ECS Run Task with Role and Task Override Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ecsEvents = new aws.iam.Role("ecs_events", {
assumeRolePolicy: `{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "events.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
`,
});
const ecsEventsRunTaskWithAnyRole = new aws.iam.RolePolicy("ecs_events_run_task_with_any_role", {
policy: aws_ecs_task_definition_task_name.arn.apply(arn => `{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:PassRole",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "ecs:RunTask",
"Resource": "${arn.replace(/:\d+$/, ":*")}"
}
]
}
`),
role: ecsEvents.id,
});
const ecsScheduledTask = new aws.cloudwatch.EventTarget("ecs_scheduled_task", {
arn: aws_ecs_cluster_cluster_name.arn,
ecsTarget: {
taskCount: 1,
taskDefinitionArn: aws_ecs_task_definition_task_name.arn,
},
input: `{
"containerOverrides": [
{
"name": "name-of-container-to-override",
"command": ["bin/console", "scheduled-task"]
}
]
}
`,
roleArn: ecsEvents.arn,
rule: aws_cloudwatch_event_rule_every_hour.name,
});constructor
new EventTarget(name: string, args: EventTargetArgs, opts?: pulumi.CustomResourceOptions)Create a EventTarget resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EventTargetState, opts?: pulumi.CustomResourceOptions): EventTargetGet an existing EventTarget resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is EventTargetReturns true if the given object is an instance of EventTarget. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property arn
public arn: pulumi.Output<string>;The Amazon Resource Name (ARN) associated of the target.
property batchTarget
public batchTarget: pulumi.Output<EventTargetBatchTarget | undefined>;Parameters used when you are using the rule to invoke an Amazon Batch Job. Documented below. A maximum of 1 are allowed.
property ecsTarget
public ecsTarget: pulumi.Output<EventTargetEcsTarget | undefined>;Parameters used when you are using the rule to invoke Amazon ECS Task. Documented below. A maximum of 1 are allowed.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property input
public input: pulumi.Output<string | undefined>;Valid JSON text passed to the target.
property inputPath
public inputPath: pulumi.Output<string | undefined>;The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.
property inputTransformer
public inputTransformer: pulumi.Output<EventTargetInputTransformer | undefined>;Parameters used when you are providing a custom input to a target based on certain event data.
property kinesisTarget
public kinesisTarget: pulumi.Output<EventTargetKinesisTarget | undefined>;Parameters used when you are using the rule to invoke an Amazon Kinesis Stream. Documented below. A maximum of 1 are allowed.
property roleArn
public roleArn: pulumi.Output<string | undefined>;The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. Required if ecsTarget is used.
property rule
public rule: pulumi.Output<string>;The name of the rule you want to add targets to.
property runCommandTargets
public runCommandTargets: pulumi.Output<EventTargetRunCommandTarget[] | undefined>;Parameters used when you are using the rule to invoke Amazon EC2 Run Command. Documented below. A maximum of 5 are allowed.
property sqsTarget
public sqsTarget: pulumi.Output<EventTargetSqsTarget | undefined>;Parameters used when you are using the rule to invoke an Amazon SQS Queue. Documented below. A maximum of 1 are allowed.
property targetId
public targetId: pulumi.Output<string>;The unique target assignment ID. If missing, will generate a random, unique id.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource LogDestination
class LogDestination extends CustomResourceProvides a CloudWatch Logs destination resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const testDestination = new aws.cloudwatch.LogDestination("test_destination", {
roleArn: aws_iam_role_iam_for_cloudwatch.arn,
targetArn: aws_kinesis_stream_kinesis_for_cloudwatch.arn,
});constructor
new LogDestination(name: string, args: LogDestinationArgs, opts?: pulumi.CustomResourceOptions)Create a LogDestination resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogDestinationState, opts?: pulumi.CustomResourceOptions): LogDestinationGet an existing LogDestination resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is LogDestinationReturns true if the given object is an instance of LogDestination. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property arn
public arn: pulumi.Output<string>;The Amazon Resource Name (ARN) specifying the log destination.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property name
public name: pulumi.Output<string>;A name for the log destination
property roleArn
public roleArn: pulumi.Output<string>;The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target
property targetArn
public targetArn: pulumi.Output<string>;The ARN of the target Amazon Kinesis stream resource for the destination
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource LogDestinationPolicy
class LogDestinationPolicy extends CustomResourceProvides a CloudWatch Logs destination policy resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const testDestination = new aws.cloudwatch.LogDestination("test_destination", {
roleArn: aws_iam_role_iam_for_cloudwatch.arn,
targetArn: aws_kinesis_stream_kinesis_for_cloudwatch.arn,
});
const testDestinationPolicyPolicyDocument = testDestination.arn.apply(arn => aws.iam.getPolicyDocument({
statements: [{
actions: ["logs:PutSubscriptionFilter"],
effect: "Allow",
principals: [{
identifiers: ["123456789012"],
type: "AWS",
}],
resources: [arn],
}],
}, { async: true }));
const testDestinationPolicyLogDestinationPolicy = new aws.cloudwatch.LogDestinationPolicy("test_destination_policy", {
accessPolicy: testDestinationPolicyPolicyDocument.json,
destinationName: testDestination.name,
});constructor
new LogDestinationPolicy(name: string, args: LogDestinationPolicyArgs, opts?: pulumi.CustomResourceOptions)Create a LogDestinationPolicy resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogDestinationPolicyState, opts?: pulumi.CustomResourceOptions): LogDestinationPolicyGet an existing LogDestinationPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is LogDestinationPolicyReturns true if the given object is an instance of LogDestinationPolicy. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property accessPolicy
public accessPolicy: pulumi.Output<string>;The policy document. This is a JSON formatted string.
property destinationName
public destinationName: pulumi.Output<string>;A name for the subscription filter
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource LogGroup
class LogGroup extends CustomResourceProvides a CloudWatch Log Group resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const yada = new aws.cloudwatch.LogGroup("yada", {
tags: {
Application: "serviceA",
Environment: "production",
},
});constructor
new LogGroup(name: string, args?: LogGroupArgs, opts?: pulumi.CustomResourceOptions)Create a LogGroup resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogGroupState, opts?: pulumi.CustomResourceOptions): LogGroupGet an existing LogGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is LogGroupReturns true if the given object is an instance of LogGroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
method onDecodedEvent
onDecodedEvent(name: string, callback: lambda.Callback<DecodedLogGroupEvent, void>, args?: LogGroupEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): LogGroupEventSubscriptionCreates a new subscription to events fired from this LogGroup to the callback provided, along with options to control the behavior of the subscription.
The events will be provided in their decoded form. Because this event hookup needs to execute code to convert the raw messages, it can only be passed an [EntryPoint] callback, not a [lambda.Function] instance.
method onEvent
onEvent(name: string, handler: LogGroupEventHandler, args?: LogGroupEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): LogGroupEventSubscriptionCreates a new subscription to events fired from this LogGroup to the handler provided, along with options to control the behavior of the subscription.
The events will be produced in raw (gzipped + base64 encoded) form.
property arn
public arn: pulumi.Output<string>;The Amazon Resource Name (ARN) specifying the log group.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property kmsKeyId
public kmsKeyId: pulumi.Output<string | undefined>;The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.
property name
public name: pulumi.Output<string>;The name of the log group. If omitted, this provider will assign a random, unique name.
property namePrefix
public namePrefix: pulumi.Output<string | undefined>;Creates a unique name beginning with the specified prefix. Conflicts with name.
property retentionInDays
public retentionInDays: pulumi.Output<number | undefined>;Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.
property tags
public tags: pulumi.Output<{[key: string]: any} | undefined>;A map of tags to assign to the resource.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource LogMetricFilter
class LogMetricFilter extends CustomResourceProvides a CloudWatch Log Metric Filter resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const dada = new aws.cloudwatch.LogGroup("dada", {});
const yada = new aws.cloudwatch.LogMetricFilter("yada", {
logGroupName: dada.name,
metricTransformation: {
name: "EventCount",
namespace: "YourNamespace",
value: "1",
},
pattern: "",
});constructor
new LogMetricFilter(name: string, args: LogMetricFilterArgs, opts?: pulumi.CustomResourceOptions)Create a LogMetricFilter resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogMetricFilterState, opts?: pulumi.CustomResourceOptions): LogMetricFilterGet an existing LogMetricFilter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is LogMetricFilterReturns true if the given object is an instance of LogMetricFilter. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property logGroupName
public logGroupName: pulumi.Output<string>;The name of the log group to associate the metric filter with.
property metricTransformation
public metricTransformation: pulumi.Output<LogMetricFilterMetricTransformation>;A block defining collection of information needed to define how metric data gets emitted. See below.
property name
public name: pulumi.Output<string>;A name for the metric filter.
property pattern
public pattern: pulumi.Output<string>;A valid CloudWatch Logs filter pattern for extracting metric data out of ingested log events.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource LogResourcePolicy
class LogResourcePolicy extends CustomResourceProvides a resource to manage a CloudWatch log resource policy.
Example Usage
Elasticsearch Log Publishing
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const elasticsearch_log_publishing_policyPolicyDocument = pulumi.output(aws.iam.getPolicyDocument({
statements: [{
actions: [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
],
principals: [{
identifiers: ["es.amazonaws.com"],
type: "Service",
}],
resources: ["arn:aws:logs:*"],
}],
}, { async: true }));
const elasticsearch_log_publishing_policyLogResourcePolicy = new aws.cloudwatch.LogResourcePolicy("elasticsearch-log-publishing-policy", {
policyDocument: elasticsearch_log_publishing_policyPolicyDocument.json,
policyName: "elasticsearch-log-publishing-policy",
});Route53 Query Logging
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const route53_query_logging_policyPolicyDocument = pulumi.output(aws.iam.getPolicyDocument({
statements: [{
actions: [
"logs:CreateLogStream",
"logs:PutLogEvents",
],
principals: [{
identifiers: ["route53.amazonaws.com"],
type: "Service",
}],
resources: ["arn:aws:logs:*:*:log-group:/aws/route53/*"],
}],
}, { async: true }));
const route53_query_logging_policyLogResourcePolicy = new aws.cloudwatch.LogResourcePolicy("route53-query-logging-policy", {
policyDocument: route53_query_logging_policyPolicyDocument.json,
policyName: "route53-query-logging-policy",
});constructor
new LogResourcePolicy(name: string, args: LogResourcePolicyArgs, opts?: pulumi.CustomResourceOptions)Create a LogResourcePolicy resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogResourcePolicyState, opts?: pulumi.CustomResourceOptions): LogResourcePolicyGet an existing LogResourcePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is LogResourcePolicyReturns true if the given object is an instance of LogResourcePolicy. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property policyDocument
public policyDocument: pulumi.Output<string>;Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
property policyName
public policyName: pulumi.Output<string>;Name of the resource policy.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource LogStream
class LogStream extends CustomResourceProvides a CloudWatch Log Stream resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const yada = new aws.cloudwatch.LogGroup("yada", {});
const foo = new aws.cloudwatch.LogStream("foo", {
logGroupName: yada.name,
});constructor
new LogStream(name: string, args: LogStreamArgs, opts?: pulumi.CustomResourceOptions)Create a LogStream resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogStreamState, opts?: pulumi.CustomResourceOptions): LogStreamGet an existing LogStream resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is LogStreamReturns true if the given object is an instance of LogStream. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property arn
public arn: pulumi.Output<string>;The Amazon Resource Name (ARN) specifying the log stream.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property logGroupName
public logGroupName: pulumi.Output<string>;The name of the log group under which the log stream is to be created.
property name
public name: pulumi.Output<string>;The name of the log stream. Must not be longer than 512 characters and must not contain :
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource LogSubscriptionFilter
class LogSubscriptionFilter extends CustomResourceProvides a CloudWatch Logs subscription filter resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const testLambdafunctionLogfilter = new aws.cloudwatch.LogSubscriptionFilter("test_lambdafunction_logfilter", {
destinationArn: aws_kinesis_stream_test_logstream.arn,
distribution: "Random",
filterPattern: "logtype test",
logGroup: "/aws/lambda/example_lambda_name",
roleArn: aws_iam_role_iam_for_lambda.arn,
});constructor
new LogSubscriptionFilter(name: string, args: LogSubscriptionFilterArgs, opts?: pulumi.CustomResourceOptions)Create a LogSubscriptionFilter resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogSubscriptionFilterState, opts?: pulumi.CustomResourceOptions): LogSubscriptionFilterGet an existing LogSubscriptionFilter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is LogSubscriptionFilterReturns true if the given object is an instance of LogSubscriptionFilter. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property destinationArn
public destinationArn: pulumi.Output<string>;The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
property distribution
public distribution: pulumi.Output<string | undefined>;The method used to distribute log data to the destination. By default log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream. Valid values are “Random” and “ByLogStream”.
property filterPattern
public filterPattern: pulumi.Output<string>;A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property logGroup
public logGroup: pulumi.Output<string>;The name of the log group to associate the subscription filter with
property name
public name: pulumi.Output<string>;A name for the subscription filter
property roleArn
public roleArn: pulumi.Output<string>;The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to deliver ingested log events to the destination. If you use Lambda as a destination, you should skip this argument and use aws.lambda.Permission resource for granting access from CloudWatch logs to the destination Lambda function.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource MetricAlarm
class MetricAlarm extends CustomResourceProvides a CloudWatch Metric Alarm resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const foobar = new aws.cloudwatch.MetricAlarm("foobar", {
alarmDescription: "This metric monitors ec2 cpu utilization",
comparisonOperator: "GreaterThanOrEqualToThreshold",
evaluationPeriods: 2,
insufficientDataActions: [],
metricName: "CPUUtilization",
namespace: "AWS/EC2",
period: 120,
statistic: "Average",
threshold: 80,
});Example in Conjunction with Scaling Policies
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const batPolicy = new aws.autoscaling.Policy("bat", {
adjustmentType: "ChangeInCapacity",
autoscalingGroupName: aws_autoscaling_group_bar.name,
cooldown: 300,
scalingAdjustment: 4,
});
const batMetricAlarm = new aws.cloudwatch.MetricAlarm("bat", {
alarmActions: [batPolicy.arn],
alarmDescription: "This metric monitors ec2 cpu utilization",
comparisonOperator: "GreaterThanOrEqualToThreshold",
dimensions: {
AutoScalingGroupName: aws_autoscaling_group_bar.name,
},
evaluationPeriods: 2,
metricName: "CPUUtilization",
namespace: "AWS/EC2",
period: 120,
statistic: "Average",
threshold: 80,
});Example with an Expression
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const foobar = new aws.cloudwatch.MetricAlarm("foobar", {
alarmDescription: "Request error rate has exceeded 10%",
comparisonOperator: "GreaterThanOrEqualToThreshold",
evaluationPeriods: 2,
insufficientDataActions: [],
metricQueries: [
{
expression: "m2/m1*100",
id: "e1",
label: "Error Rate",
returnData: true,
},
{
id: "m1",
metric: {
dimensions: {
LoadBalancer: "app/web",
},
metricName: "RequestCount",
namespace: "AWS/ApplicationELB",
period: 120,
stat: "Sum",
unit: "Count",
},
},
{
id: "m2",
metric: {
dimensions: {
LoadBalancer: "app/web",
},
metricName: "HTTPCode_ELB_5XX_Count",
namespace: "AWS/ApplicationELB",
period: 120,
stat: "Sum",
unit: "Count",
},
},
],
threshold: 10,
});import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const xxAnomalyDetection = new aws.cloudwatch.MetricAlarm("xx_anomaly_detection", {
alarmDescription: "This metric monitors ec2 cpu utilization",
comparisonOperator: "GreaterThanUpperThreshold",
evaluationPeriods: 2,
insufficientDataActions: [],
metricQueries: [
{
expression: "ANOMALY_DETECTION_BAND(m1)",
id: "e1",
label: "CPUUtilization (Expected)",
returnData: true,
},
{
id: "m1",
metric: {
dimensions: {
InstanceId: "i-abc123",
},
metricName: "CPUUtilization",
namespace: "AWS/EC2",
period: 120,
stat: "Average",
unit: "Count",
},
returnData: true,
},
],
thresholdMetricId: "e1",
});Example of monitoring Healthy Hosts on NLB using Target Group and NLB
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const xxxNlbHealthyhosts = new aws.cloudwatch.MetricAlarm("xxxNlbHealthyhosts", {
comparisonOperator: "LessThanThreshold",
evaluationPeriods: "1",
metricName: "HealthyHostCount",
namespace: "AWS/NetworkELB",
period: "60",
statistic: "Average",
threshold: _var.logstash_servers_count,
alarmDescription: "Number of XXXX nodes healthy in Target Group",
actionsEnabled: "true",
alarmActions: [aws_sns_topic.sns.arn],
okActions: [aws_sns_topic.sns.arn],
dimensions: {
TargetGroup: aws_lb_target_group["lb-tg"].arn_suffix,
LoadBalancer: aws_lb.lb.arn_suffix,
},
});NOTE: You cannot create a metric alarm consisting of both
statisticandextendedStatisticparameters. You must choose one or the other
constructor
new MetricAlarm(name: string, args: MetricAlarmArgs, opts?: pulumi.CustomResourceOptions)Create a MetricAlarm resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: MetricAlarmState, opts?: pulumi.CustomResourceOptions): MetricAlarmGet an existing MetricAlarm resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is MetricAlarmReturns true if the given object is an instance of MetricAlarm. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property actionsEnabled
public actionsEnabled: pulumi.Output<boolean | undefined>;Indicates whether or not actions should be executed during any changes to the alarm’s state. Defaults to true.
property alarmActions
public alarmActions: pulumi.Output<string[] | undefined>;The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property alarmDescription
public alarmDescription: pulumi.Output<string | undefined>;The description for the alarm.
property arn
public arn: pulumi.Output<string>;The ARN of the cloudwatch metric alarm.
property comparisonOperator
public comparisonOperator: pulumi.Output<string>;The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold. Additionally, the values LessThanLowerOrGreaterThanUpperThreshold, LessThanLowerThreshold, and GreaterThanUpperThreshold are used only for alarms based on anomaly detection models.
property datapointsToAlarm
public datapointsToAlarm: pulumi.Output<number | undefined>;The number of datapoints that must be breaching to trigger the alarm.
property dimensions
public dimensions: pulumi.Output<{[key: string]: any} | undefined>;The dimensions for this metric. For the list of available dimensions see the AWS documentation here.
property evaluateLowSampleCountPercentiles
public evaluateLowSampleCountPercentiles: pulumi.Output<string>;Used only for alarms
based on percentiles. If you specify ignore, the alarm state will not
change during periods with too few data points to be statistically significant.
If you specify evaluate or omit this parameter, the alarm will always be
evaluated and possibly change state no matter how many data points are available.
The following values are supported: ignore, and evaluate.
property evaluationPeriods
public evaluationPeriods: pulumi.Output<number>;The number of periods over which data is compared to the specified threshold.
property extendedStatistic
public extendedStatistic: pulumi.Output<string | undefined>;The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property insufficientDataActions
public insufficientDataActions: pulumi.Output<string[] | undefined>;The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property metricName
public metricName: pulumi.Output<string | undefined>;The name for this metric. See docs for supported metrics.
property metricQueries
public metricQueries: pulumi.Output<MetricAlarmMetricQuery[] | undefined>;Enables you to create an alarm based on a metric math expression. You may specify at most 20.
property name
public name: pulumi.Output<string>;The descriptive name for the alarm. This name must be unique within the user’s AWS account
property namespace
public namespace: pulumi.Output<string | undefined>;The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.
property okActions
public okActions: pulumi.Output<string[] | undefined>;The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property period
public period: pulumi.Output<number | undefined>;The period in seconds over which the specified stat is applied.
property statistic
public statistic: pulumi.Output<string | undefined>;The statistic to apply to the alarm’s associated metric.
Either of the following is supported: SampleCount, Average, Sum, Minimum, Maximum
property tags
public tags: pulumi.Output<{[key: string]: any} | undefined>;A map of tags to assign to the resource.
property threshold
public threshold: pulumi.Output<number | undefined>;The value against which the specified statistic is compared. This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.
property thresholdMetricId
public thresholdMetricId: pulumi.Output<string | undefined>;If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function.
property treatMissingData
public treatMissingData: pulumi.Output<string | undefined>;Sets how this alarm is to handle missing data points. The following values are supported: missing, ignore, breaching and notBreaching. Defaults to missing.
property unit
public unit: pulumi.Output<string | undefined>;The unit for this metric.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Functions
Function getLogGroup
getLogGroup(args: GetLogGroupArgs, opts?: pulumi.InvokeOptions): Promise<GetLogGroupResult>Use this data source to get information about an AWS Cloudwatch Log Group
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = pulumi.output(aws.cloudwatch.getLogGroup({
name: "MyImportantLogs",
}, { async: true }));Others
interface DashboardArgs
interface DashboardArgsThe set of arguments for constructing a Dashboard resource.
property dashboardBody
dashboardBody: pulumi.Input<string>;The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.
property dashboardName
dashboardName: pulumi.Input<string>;The name of the dashboard.
interface DashboardState
interface DashboardStateInput properties used for looking up and filtering Dashboard resources.
property dashboardArn
dashboardArn?: pulumi.Input<string>;The Amazon Resource Name (ARN) of the dashboard.
property dashboardBody
dashboardBody?: pulumi.Input<string>;The detailed information about the dashboard, including what widgets are included and their location on the dashboard. You can read more about the body structure in the documentation.
property dashboardName
dashboardName?: pulumi.Input<string>;The name of the dashboard.
interface DecodedLogGroupEvent
interface DecodedLogGroupEventproperty logEvents
logEvents: LogGroupEventRecord[];property logGroup
logGroup: string;property logStream
logStream: string;property messageType
messageType: string;property owner
owner: string;property subscriptionFilters
subscriptionFilters: string[];interface EventPermissionArgs
interface EventPermissionArgsThe set of arguments for constructing a EventPermission resource.
property action
action?: pulumi.Input<string>;The action that you are enabling the other account to perform. Defaults to events:PutEvents.
property condition
condition?: pulumi.Input<EventPermissionCondition>;Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.
property principal
principal: pulumi.Input<string>;The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.
property statementId
statementId: pulumi.Input<string>;An identifier string for the external account that you are granting permissions to.
interface EventPermissionState
interface EventPermissionStateInput properties used for looking up and filtering EventPermission resources.
property action
action?: pulumi.Input<string>;The action that you are enabling the other account to perform. Defaults to events:PutEvents.
property condition
condition?: pulumi.Input<EventPermissionCondition>;Configuration block to limit the event bus permissions you are granting to only accounts that fulfill the condition. Specified below.
property principal
principal?: pulumi.Input<string>;The 12-digit AWS account ID that you are permitting to put events to your default event bus. Specify * to permit any account to put events to your default event bus, optionally limited by condition.
property statementId
statementId?: pulumi.Input<string>;An identifier string for the external account that you are granting permissions to.
interface EventRuleArgs
interface EventRuleArgsThe set of arguments for constructing a EventRule resource.
property description
description?: pulumi.Input<string>;The description of the rule.
property eventPattern
eventPattern?: pulumi.Input<string>;Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details.
property isEnabled
isEnabled?: pulumi.Input<boolean>;Whether the rule should be enabled (defaults to true).
property name
name?: pulumi.Input<string>;The rule’s name. By default generated by this provider.
property namePrefix
namePrefix?: pulumi.Input<string>;The rule’s name. Conflicts with name.
property roleArn
roleArn?: pulumi.Input<string>;The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
property scheduleExpression
scheduleExpression?: pulumi.Input<string>;The scheduling expression.
For example, cron(0 20 * * ? *) or rate(5 minutes).
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
interface EventRuleEvent
interface EventRuleEventproperty account
account: string;property detail
detail: Record<string, any>;property detail-type
detail-type: string;property id
id: string;property region
region: string;property resources
resources: string[];property source
source: string;property time
time: string;property version
version: string;type EventRuleEventHandler
type EventRuleEventHandler = lambda.EventHandler<EventRuleEvent, void>;class EventRuleEventSubscription
class EventRuleEventSubscription extends EventSubscriptionconstructor
public new EventRuleEventSubscription(name: string, eventRuleOrSchedule: EventRule | string, handler: EventRuleEventHandler, args?: EventRuleEventSubscriptionArgs, opts: ComponentResourceOptions)method getData
protected getData(): Promise<TData>Retrieves the data produces by [initialize]. The data is immediately available in a
derived class’s constructor after the super(...) call to ComponentResource.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod initialize
protected initialize(args: Inputs): Promise<TData>Can be overridden by a subclass to asynchronously initialize data for this Component
automatically when constructed. The data will be available immediately for subclass
constructors to use. To access the data use .getData.
method isInstance
static isInstance(obj: any): obj is ComponentResourceReturns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
method registerOutputs
protected registerOutputs(outputs?: Inputs | Promise<Inputs> | Output<Inputs>): voidregisterOutputs registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.
ComponentResources can call this at the end of their constructor to indicate that they are
done creating child resources. This is not strictly necessary as this will automatically be
called after the initialize method completes.
property eventRule
public eventRule: EventRule;property func
public func: LambdaFunction;property permission
public permission: Permission;property target
public target: EventTarget;property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
interface EventRuleEventSubscriptionArgs
interface EventRuleEventSubscriptionArgsArguments to control the event rule subscription. Currently empty, but still defined in case of future need.
interface EventRuleState
interface EventRuleStateInput properties used for looking up and filtering EventRule resources.
property arn
arn?: pulumi.Input<string>;The Amazon Resource Name (ARN) of the rule.
property description
description?: pulumi.Input<string>;The description of the rule.
property eventPattern
eventPattern?: pulumi.Input<string>;Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details.
property isEnabled
isEnabled?: pulumi.Input<boolean>;Whether the rule should be enabled (defaults to true).
property name
name?: pulumi.Input<string>;The rule’s name. By default generated by this provider.
property namePrefix
namePrefix?: pulumi.Input<string>;The rule’s name. Conflicts with name.
property roleArn
roleArn?: pulumi.Input<string>;The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
property scheduleExpression
scheduleExpression?: pulumi.Input<string>;The scheduling expression.
For example, cron(0 20 * * ? *) or rate(5 minutes).
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
interface EventTargetArgs
interface EventTargetArgsThe set of arguments for constructing a EventTarget resource.
property arn
arn: pulumi.Input<string>;The Amazon Resource Name (ARN) associated of the target.
property batchTarget
batchTarget?: pulumi.Input<EventTargetBatchTarget>;Parameters used when you are using the rule to invoke an Amazon Batch Job. Documented below. A maximum of 1 are allowed.
property ecsTarget
ecsTarget?: pulumi.Input<EventTargetEcsTarget>;Parameters used when you are using the rule to invoke Amazon ECS Task. Documented below. A maximum of 1 are allowed.
property input
input?: pulumi.Input<string>;Valid JSON text passed to the target.
property inputPath
inputPath?: pulumi.Input<string>;The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.
property inputTransformer
inputTransformer?: pulumi.Input<EventTargetInputTransformer>;Parameters used when you are providing a custom input to a target based on certain event data.
property kinesisTarget
kinesisTarget?: pulumi.Input<EventTargetKinesisTarget>;Parameters used when you are using the rule to invoke an Amazon Kinesis Stream. Documented below. A maximum of 1 are allowed.
property roleArn
roleArn?: pulumi.Input<string>;The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. Required if ecsTarget is used.
property rule
rule: pulumi.Input<string>;The name of the rule you want to add targets to.
property runCommandTargets
runCommandTargets?: pulumi.Input<pulumi.Input<EventTargetRunCommandTarget>[]>;Parameters used when you are using the rule to invoke Amazon EC2 Run Command. Documented below. A maximum of 5 are allowed.
property sqsTarget
sqsTarget?: pulumi.Input<EventTargetSqsTarget>;Parameters used when you are using the rule to invoke an Amazon SQS Queue. Documented below. A maximum of 1 are allowed.
property targetId
targetId?: pulumi.Input<string>;The unique target assignment ID. If missing, will generate a random, unique id.
interface EventTargetState
interface EventTargetStateInput properties used for looking up and filtering EventTarget resources.
property arn
arn?: pulumi.Input<string>;The Amazon Resource Name (ARN) associated of the target.
property batchTarget
batchTarget?: pulumi.Input<EventTargetBatchTarget>;Parameters used when you are using the rule to invoke an Amazon Batch Job. Documented below. A maximum of 1 are allowed.
property ecsTarget
ecsTarget?: pulumi.Input<EventTargetEcsTarget>;Parameters used when you are using the rule to invoke Amazon ECS Task. Documented below. A maximum of 1 are allowed.
property input
input?: pulumi.Input<string>;Valid JSON text passed to the target.
property inputPath
inputPath?: pulumi.Input<string>;The value of the JSONPath that is used for extracting part of the matched event when passing it to the target.
property inputTransformer
inputTransformer?: pulumi.Input<EventTargetInputTransformer>;Parameters used when you are providing a custom input to a target based on certain event data.
property kinesisTarget
kinesisTarget?: pulumi.Input<EventTargetKinesisTarget>;Parameters used when you are using the rule to invoke an Amazon Kinesis Stream. Documented below. A maximum of 1 are allowed.
property roleArn
roleArn?: pulumi.Input<string>;The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. Required if ecsTarget is used.
property rule
rule?: pulumi.Input<string>;The name of the rule you want to add targets to.
property runCommandTargets
runCommandTargets?: pulumi.Input<pulumi.Input<EventTargetRunCommandTarget>[]>;Parameters used when you are using the rule to invoke Amazon EC2 Run Command. Documented below. A maximum of 5 are allowed.
property sqsTarget
sqsTarget?: pulumi.Input<EventTargetSqsTarget>;Parameters used when you are using the rule to invoke an Amazon SQS Queue. Documented below. A maximum of 1 are allowed.
property targetId
targetId?: pulumi.Input<string>;The unique target assignment ID. If missing, will generate a random, unique id.
interface GetLogGroupArgs
interface GetLogGroupArgsA collection of arguments for invoking getLogGroup.
property name
name: string;The name of the Cloudwatch log group
property tags
tags?: undefined | {[key: string]: any};A map of tags to assign to the resource.
interface GetLogGroupResult
interface GetLogGroupResultA collection of values returned by getLogGroup.
property arn
arn: string;The ARN of the Cloudwatch log group
property creationTime
creationTime: number;The creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
property id
id: string;The provider-assigned unique ID for this managed resource.
property kmsKeyId
kmsKeyId: string;The ARN of the KMS Key to use when encrypting log data.
property name
name: string;property retentionInDays
retentionInDays: number;The number of days log events retained in the specified log group.
property tags
tags: {[key: string]: any};A map of tags to assign to the resource.
interface LogDestinationArgs
interface LogDestinationArgsThe set of arguments for constructing a LogDestination resource.
property name
name?: pulumi.Input<string>;A name for the log destination
property roleArn
roleArn: pulumi.Input<string>;The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target
property targetArn
targetArn: pulumi.Input<string>;The ARN of the target Amazon Kinesis stream resource for the destination
interface LogDestinationPolicyArgs
interface LogDestinationPolicyArgsThe set of arguments for constructing a LogDestinationPolicy resource.
property accessPolicy
accessPolicy: pulumi.Input<string>;The policy document. This is a JSON formatted string.
property destinationName
destinationName: pulumi.Input<string>;A name for the subscription filter
interface LogDestinationPolicyState
interface LogDestinationPolicyStateInput properties used for looking up and filtering LogDestinationPolicy resources.
property accessPolicy
accessPolicy?: pulumi.Input<string>;The policy document. This is a JSON formatted string.
property destinationName
destinationName?: pulumi.Input<string>;A name for the subscription filter
interface LogDestinationState
interface LogDestinationStateInput properties used for looking up and filtering LogDestination resources.
property arn
arn?: pulumi.Input<string>;The Amazon Resource Name (ARN) specifying the log destination.
property name
name?: pulumi.Input<string>;A name for the log destination
property roleArn
roleArn?: pulumi.Input<string>;The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to put data into the target
property targetArn
targetArn?: pulumi.Input<string>;The ARN of the target Amazon Kinesis stream resource for the destination
interface LogGroupArgs
interface LogGroupArgsThe set of arguments for constructing a LogGroup resource.
property kmsKeyId
kmsKeyId?: pulumi.Input<string>;The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.
property name
name?: pulumi.Input<string>;The name of the log group. If omitted, this provider will assign a random, unique name.
property namePrefix
namePrefix?: pulumi.Input<string>;Creates a unique name beginning with the specified prefix. Conflicts with name.
property retentionInDays
retentionInDays?: pulumi.Input<number>;Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
interface LogGroupEvent
interface LogGroupEventproperty awslogs
awslogs: {
data: string;
};type LogGroupEventHandler
type LogGroupEventHandler = lambda.EventHandler<LogGroupEvent, void>;interface LogGroupEventRecord
interface LogGroupEventRecordproperty id
id: string;property message
message: string;property timestamp
timestamp: number;class LogGroupEventSubscription
class LogGroupEventSubscription extends EventSubscriptionconstructor
new LogGroupEventSubscription(name: string, logGroup: LogGroup, handler: LogGroupEventHandler, args: LogGroupEventSubscriptionArgs, opts: ComponentResourceOptions)method getData
protected getData(): Promise<TData>Retrieves the data produces by [initialize]. The data is immediately available in a
derived class’s constructor after the super(...) call to ComponentResource.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod initialize
protected initialize(args: Inputs): Promise<TData>Can be overridden by a subclass to asynchronously initialize data for this Component
automatically when constructed. The data will be available immediately for subclass
constructors to use. To access the data use .getData.
method isInstance
static isInstance(obj: any): obj is ComponentResourceReturns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
method registerOutputs
protected registerOutputs(outputs?: Inputs | Promise<Inputs> | Output<Inputs>): voidregisterOutputs registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.
ComponentResources can call this at the end of their constructor to indicate that they are
done creating child resources. This is not strictly necessary as this will automatically be
called after the initialize method completes.
property func
public func: LambdaFunction;property logGroup
public logGroup: LogGroup;property logSubscriptionFilter
public logSubscriptionFilter: LogSubscriptionFilter;property permission
public permission: Permission;property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
interface LogGroupEventSubscriptionArgs
interface LogGroupEventSubscriptionArgsArguments to control the event rule subscription. Currently empty, but still defined in case of future need.
property filterPattern
filterPattern?: undefined | string;A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events. If not provided, the empty-string pattern will be used.
interface LogGroupState
interface LogGroupStateInput properties used for looking up and filtering LogGroup resources.
property arn
arn?: pulumi.Input<string>;The Amazon Resource Name (ARN) specifying the log group.
property kmsKeyId
kmsKeyId?: pulumi.Input<string>;The ARN of the KMS Key to use when encrypting log data. Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.
property name
name?: pulumi.Input<string>;The name of the log group. If omitted, this provider will assign a random, unique name.
property namePrefix
namePrefix?: pulumi.Input<string>;Creates a unique name beginning with the specified prefix. Conflicts with name.
property retentionInDays
retentionInDays?: pulumi.Input<number>;Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
interface LogMetricFilterArgs
interface LogMetricFilterArgsThe set of arguments for constructing a LogMetricFilter resource.
property logGroupName
logGroupName: pulumi.Input<string>;The name of the log group to associate the metric filter with.
property metricTransformation
metricTransformation: pulumi.Input<LogMetricFilterMetricTransformation>;A block defining collection of information needed to define how metric data gets emitted. See below.
property name
name?: pulumi.Input<string>;A name for the metric filter.
property pattern
pattern: pulumi.Input<string>;A valid CloudWatch Logs filter pattern for extracting metric data out of ingested log events.
interface LogMetricFilterState
interface LogMetricFilterStateInput properties used for looking up and filtering LogMetricFilter resources.
property logGroupName
logGroupName?: pulumi.Input<string>;The name of the log group to associate the metric filter with.
property metricTransformation
metricTransformation?: pulumi.Input<LogMetricFilterMetricTransformation>;A block defining collection of information needed to define how metric data gets emitted. See below.
property name
name?: pulumi.Input<string>;A name for the metric filter.
property pattern
pattern?: pulumi.Input<string>;A valid CloudWatch Logs filter pattern for extracting metric data out of ingested log events.
interface LogResourcePolicyArgs
interface LogResourcePolicyArgsThe set of arguments for constructing a LogResourcePolicy resource.
property policyDocument
policyDocument: pulumi.Input<string>;Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
property policyName
policyName: pulumi.Input<string>;Name of the resource policy.
interface LogResourcePolicyState
interface LogResourcePolicyStateInput properties used for looking up and filtering LogResourcePolicy resources.
property policyDocument
policyDocument?: pulumi.Input<string>;Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters.
property policyName
policyName?: pulumi.Input<string>;Name of the resource policy.
interface LogStreamArgs
interface LogStreamArgsThe set of arguments for constructing a LogStream resource.
property logGroupName
logGroupName: pulumi.Input<string>;The name of the log group under which the log stream is to be created.
property name
name?: pulumi.Input<string>;The name of the log stream. Must not be longer than 512 characters and must not contain :
interface LogStreamState
interface LogStreamStateInput properties used for looking up and filtering LogStream resources.
property arn
arn?: pulumi.Input<string>;The Amazon Resource Name (ARN) specifying the log stream.
property logGroupName
logGroupName?: pulumi.Input<string>;The name of the log group under which the log stream is to be created.
property name
name?: pulumi.Input<string>;The name of the log stream. Must not be longer than 512 characters and must not contain :
interface LogSubscriptionFilterArgs
interface LogSubscriptionFilterArgsThe set of arguments for constructing a LogSubscriptionFilter resource.
property destinationArn
destinationArn: pulumi.Input<string>;The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
property distribution
distribution?: pulumi.Input<string>;The method used to distribute log data to the destination. By default log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream. Valid values are “Random” and “ByLogStream”.
property filterPattern
filterPattern: pulumi.Input<string>;A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
property logGroup
logGroup: pulumi.Input<string | LogGroup>;The name of the log group to associate the subscription filter with
property name
name?: pulumi.Input<string>;A name for the subscription filter
property roleArn
roleArn?: pulumi.Input<string>;The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to deliver ingested log events to the destination. If you use Lambda as a destination, you should skip this argument and use aws.lambda.Permission resource for granting access from CloudWatch logs to the destination Lambda function.
interface LogSubscriptionFilterState
interface LogSubscriptionFilterStateInput properties used for looking up and filtering LogSubscriptionFilter resources.
property destinationArn
destinationArn?: pulumi.Input<string>;The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN.
property distribution
distribution?: pulumi.Input<string>;The method used to distribute log data to the destination. By default log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream. Valid values are “Random” and “ByLogStream”.
property filterPattern
filterPattern?: pulumi.Input<string>;A valid CloudWatch Logs filter pattern for subscribing to a filtered stream of log events.
property logGroup
logGroup?: pulumi.Input<string | LogGroup>;The name of the log group to associate the subscription filter with
property name
name?: pulumi.Input<string>;A name for the subscription filter
property roleArn
roleArn?: pulumi.Input<string>;The ARN of an IAM role that grants Amazon CloudWatch Logs permissions to deliver ingested log events to the destination. If you use Lambda as a destination, you should skip this argument and use aws.lambda.Permission resource for granting access from CloudWatch logs to the destination Lambda function.
interface MetricAlarmArgs
interface MetricAlarmArgsThe set of arguments for constructing a MetricAlarm resource.
property actionsEnabled
actionsEnabled?: pulumi.Input<boolean>;Indicates whether or not actions should be executed during any changes to the alarm’s state. Defaults to true.
property alarmActions
alarmActions?: pulumi.Input<pulumi.Input<string | Topic>[]>;The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property alarmDescription
alarmDescription?: pulumi.Input<string>;The description for the alarm.
property comparisonOperator
comparisonOperator: pulumi.Input<string>;The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold. Additionally, the values LessThanLowerOrGreaterThanUpperThreshold, LessThanLowerThreshold, and GreaterThanUpperThreshold are used only for alarms based on anomaly detection models.
property datapointsToAlarm
datapointsToAlarm?: pulumi.Input<number>;The number of datapoints that must be breaching to trigger the alarm.
property dimensions
dimensions?: pulumi.Input<{[key: string]: any}>;The dimensions for this metric. For the list of available dimensions see the AWS documentation here.
property evaluateLowSampleCountPercentiles
evaluateLowSampleCountPercentiles?: pulumi.Input<string>;Used only for alarms
based on percentiles. If you specify ignore, the alarm state will not
change during periods with too few data points to be statistically significant.
If you specify evaluate or omit this parameter, the alarm will always be
evaluated and possibly change state no matter how many data points are available.
The following values are supported: ignore, and evaluate.
property evaluationPeriods
evaluationPeriods: pulumi.Input<number>;The number of periods over which data is compared to the specified threshold.
property extendedStatistic
extendedStatistic?: pulumi.Input<string>;The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
property insufficientDataActions
insufficientDataActions?: pulumi.Input<pulumi.Input<string | Topic>[]>;The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property metricName
metricName?: pulumi.Input<string>;The name for this metric. See docs for supported metrics.
property metricQueries
metricQueries?: pulumi.Input<pulumi.Input<MetricAlarmMetricQuery>[]>;Enables you to create an alarm based on a metric math expression. You may specify at most 20.
property name
name?: pulumi.Input<string>;The descriptive name for the alarm. This name must be unique within the user’s AWS account
property namespace
namespace?: pulumi.Input<string>;The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.
property okActions
okActions?: pulumi.Input<pulumi.Input<string | Topic>[]>;The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property period
period?: pulumi.Input<number>;The period in seconds over which the specified stat is applied.
property statistic
statistic?: pulumi.Input<string>;The statistic to apply to the alarm’s associated metric.
Either of the following is supported: SampleCount, Average, Sum, Minimum, Maximum
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
property threshold
threshold?: pulumi.Input<number>;The value against which the specified statistic is compared. This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.
property thresholdMetricId
thresholdMetricId?: pulumi.Input<string>;If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function.
property treatMissingData
treatMissingData?: pulumi.Input<string>;Sets how this alarm is to handle missing data points. The following values are supported: missing, ignore, breaching and notBreaching. Defaults to missing.
property unit
unit?: pulumi.Input<string>;The unit for this metric.
interface MetricAlarmState
interface MetricAlarmStateInput properties used for looking up and filtering MetricAlarm resources.
property actionsEnabled
actionsEnabled?: pulumi.Input<boolean>;Indicates whether or not actions should be executed during any changes to the alarm’s state. Defaults to true.
property alarmActions
alarmActions?: pulumi.Input<pulumi.Input<string | Topic>[]>;The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property alarmDescription
alarmDescription?: pulumi.Input<string>;The description for the alarm.
property arn
arn?: pulumi.Input<string>;The ARN of the cloudwatch metric alarm.
property comparisonOperator
comparisonOperator?: pulumi.Input<string>;The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold. Additionally, the values LessThanLowerOrGreaterThanUpperThreshold, LessThanLowerThreshold, and GreaterThanUpperThreshold are used only for alarms based on anomaly detection models.
property datapointsToAlarm
datapointsToAlarm?: pulumi.Input<number>;The number of datapoints that must be breaching to trigger the alarm.
property dimensions
dimensions?: pulumi.Input<{[key: string]: any}>;The dimensions for this metric. For the list of available dimensions see the AWS documentation here.
property evaluateLowSampleCountPercentiles
evaluateLowSampleCountPercentiles?: pulumi.Input<string>;Used only for alarms
based on percentiles. If you specify ignore, the alarm state will not
change during periods with too few data points to be statistically significant.
If you specify evaluate or omit this parameter, the alarm will always be
evaluated and possibly change state no matter how many data points are available.
The following values are supported: ignore, and evaluate.
property evaluationPeriods
evaluationPeriods?: pulumi.Input<number>;The number of periods over which data is compared to the specified threshold.
property extendedStatistic
extendedStatistic?: pulumi.Input<string>;The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
property insufficientDataActions
insufficientDataActions?: pulumi.Input<pulumi.Input<string | Topic>[]>;The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property metricName
metricName?: pulumi.Input<string>;The name for this metric. See docs for supported metrics.
property metricQueries
metricQueries?: pulumi.Input<pulumi.Input<MetricAlarmMetricQuery>[]>;Enables you to create an alarm based on a metric math expression. You may specify at most 20.
property name
name?: pulumi.Input<string>;The descriptive name for the alarm. This name must be unique within the user’s AWS account
property namespace
namespace?: pulumi.Input<string>;The namespace for this metric. See docs for the list of namespaces. See docs for supported metrics.
property okActions
okActions?: pulumi.Input<pulumi.Input<string | Topic>[]>;The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN).
property period
period?: pulumi.Input<number>;The period in seconds over which the specified stat is applied.
property statistic
statistic?: pulumi.Input<string>;The statistic to apply to the alarm’s associated metric.
Either of the following is supported: SampleCount, Average, Sum, Minimum, Maximum
property tags
tags?: pulumi.Input<{[key: string]: any}>;A map of tags to assign to the resource.
property threshold
threshold?: pulumi.Input<number>;The value against which the specified statistic is compared. This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.
property thresholdMetricId
thresholdMetricId?: pulumi.Input<string>;If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function.
property treatMissingData
treatMissingData?: pulumi.Input<string>;Sets how this alarm is to handle missing data points. The following values are supported: missing, ignore, breaching and notBreaching. Defaults to missing.
property unit
unit?: pulumi.Input<string>;The unit for this metric.
function onSchedule
onSchedule(name: string, schedule: string, handler: eventRule.EventRuleEventHandler, args?: eventRule.EventRuleEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): EventRuleEventSubscriptionCreates a CloudWatch event that will fire based on the specified schedule. This will create an EventRule which will then invoke the provided handler every time it fires.