Module cloudwatch

@pulumi/aws > cloudwatch

Index ▾

cloudwatch/cloudwatchMixins.ts cloudwatch/dashboard.ts cloudwatch/eventPermission.ts cloudwatch/eventRule.ts cloudwatch/eventRuleMixins.ts cloudwatch/eventTarget.ts cloudwatch/getLogGroup.ts cloudwatch/logDestination.ts cloudwatch/logDestinationPolicy.ts cloudwatch/logGroup.ts cloudwatch/logGroupMixins.ts cloudwatch/logMetricFilter.ts cloudwatch/logResourcePolicy.ts cloudwatch/logStream.ts cloudwatch/logSubscriptionFilter.ts cloudwatch/metricAlarm.ts

class Dashboard

extends CustomResource

Provides 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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): Dashboard

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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.

class EventPermission

extends CustomResource

Provides 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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): EventPermission

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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<{
    key: string;
    type: string;
    value: string;
} | 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.

class EventRule

extends CustomResource

Provides 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],
    }],
}));
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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): EventRule

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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 onEvent

onEvent(name: string, handler: EventRuleEventHandler, args?: EventRuleEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): EventRuleEventSubscription

Creates 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 Terraform.

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 mapping 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.

class EventRuleEventSubscription

extends EventSubscription

constructor

public new EventRuleEventSubscription(name: string, eventRuleOrSchedule: eventRule.EventRule | string, handler: EventRuleEventHandler, args?: EventRuleEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions)

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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>): void

property eventRule

public eventRule: eventRule.EventRule;

property func

public func: LambdaFunction;

property permission

public permission: permission.Permission;

property target

public target: eventTarget.EventTarget;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class EventTarget

extends CustomResource

Provides 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 stopInstancesEventRule = new aws.cloudwatch.EventRule("stop_instances", {
    description: "Stop instances nightly",
    scheduleExpression: "cron(0 0 * * ? *)",
});
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 ssmLifecycleTrust = pulumi.output(aws.iam.getPolicyDocument({
    statements: [{
        actions: ["sts:AssumeRole"],
        principals: [{
            identifiers: ["events.amazonaws.com"],
            type: "Service",
        }],
    }],
}));
const ssmLifecycleRole = new aws.iam.Role("ssm_lifecycle", {
    assumeRolePolicy: ssmLifecycleTrust.json,
});
const stopInstancesEventTarget = new aws.cloudwatch.EventTarget("stop_instances", {
    arn: stopInstance.arn,
    roleArn: ssmLifecycleRole.arn,
    rule: stopInstancesEventRule.name,
    runCommandTargets: [{
        key: "tag:Terminate",
        values: ["midnight"],
    }],
});
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],
        },
    ],
}));
const ssmLifecyclePolicy = new aws.iam.Policy("ssm_lifecycle", {
    policy: ssmLifecyclePolicyDocument.json,
});

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 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,
});
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,
});

constructor

new EventTarget(name: string, args: EventTargetArgs, opts?: pulumi.CustomResourceOptions)

Create a EventTarget resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): EventTarget

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

property arn

public arn: pulumi.Output<string>;

The Amazon Resource Name (ARN) associated of the target.

property batchTarget

public batchTarget: pulumi.Output<{
    arraySize: undefined | number;
    jobAttempts: undefined | number;
    jobDefinition: string;
    jobName: string;
} | 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<{
    group: undefined | string;
    launchType: undefined | string;
    networkConfiguration: undefined | {
        assignPublicIp: undefined | false | true;
        securityGroups: string[];
        subnets: string[];
    };
    platformVersion: undefined | string;
    taskCount: undefined | number;
    taskDefinitionArn: string;
} | 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<{
    inputPaths: undefined | {[key: string]: any};
    inputTemplate: string;
} | undefined>;

Parameters used when you are providing a custom input to a target based on certain event data.

property kinesisTarget

public kinesisTarget: pulumi.Output<{
    partitionKeyPath: undefined | string;
} | 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 ecs_target 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<{
    key: string;
    values: string[];
}[] | 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<{
    messageGroupId: undefined | string;
} | 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.

class LogDestination

extends CustomResource

Provides 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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): LogDestination

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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 or Amazon Lambda 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.

class LogDestinationPolicy

extends CustomResource

Provides 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],
    }],
}));
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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): LogDestinationPolicy

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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.

class LogGroup

extends CustomResource

Provides 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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): LogGroup

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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 onDecodedEvent

onDecodedEvent(name: string, callback: lambda.Callback<DecodedLogGroupEvent, void>, args?: LogGroupEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): LogGroupEventSubscription

Creates 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): LogGroupEventSubscription

Creates 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, Terraform 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.

property tags

public tags: pulumi.Output<{[key: string]: any} | undefined>;

A mapping 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.

class LogGroupEventSubscription

extends EventSubscription

constructor

new LogGroupEventSubscription(name: string, logGroup: logGroup.LogGroup, handler: LogGroupEventHandler, args: LogGroupEventSubscriptionArgs, opts: pulumi.ComponentResourceOptions)

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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>): void

property func

public func: LambdaFunction;

property logGroup

public logGroup: logGroup.LogGroup;

property logSubscriptionFilter

public logSubscriptionFilter: logSubscriptionFilter.LogSubscriptionFilter;

property permission

public permission: permission.Permission;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class LogMetricFilter

extends CustomResource

Provides 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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): LogMetricFilter

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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<{
    defaultValue: undefined | string;
    name: string;
    namespace: string;
    value: string;
}>;

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.

class LogResourcePolicy

extends CustomResource

Provides 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:*"],
    }],
}));
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/*"],
    }],
}));
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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): LogResourcePolicy

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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.

class LogStream

extends CustomResource

Provides 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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): LogStream

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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.

class LogSubscriptionFilter

extends CustomResource

Provides 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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): LogSubscriptionFilter

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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

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.

class MetricAlarm

extends CustomResource

Provides 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,
});

NOTE: You cannot create a metric alarm consisting of both statistic and extended_statistic parameters. 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.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A 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): MetricAlarm

Get 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 | undefined

method isInstance

static isInstance(obj: any): boolean

Returns 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.

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.

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<{
    expression: undefined | string;
    id: string;
    label: undefined | string;
    metric: undefined | {
        dimensions: undefined | {[key: string]: any};
        metricName: string;
        namespace: undefined | string;
        period: number;
        stat: string;
        unit: undefined | string;
    };
    returnData: undefined | false | true;
}[] | 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 mapping of tags to assign to the resource.

property threshold

public threshold: pulumi.Output<number>;

The value against which the specified statistic is compared.

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.

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",
}));

function onSchedule

onSchedule(name: string, schedule: string, handler: eventRule.EventRuleEventHandler, args?: eventRule.EventRuleEventSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): eventRule.EventRuleEventSubscription

Creates 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.

interface DashboardArgs

The 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

Input 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 EventPermissionArgs

The 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<{
    key: pulumi.Input<string>;
    type: pulumi.Input<string>;
    value: pulumi.Input<string>;
}>;

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

Input 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<{
    key: pulumi.Input<string>;
    type: pulumi.Input<string>;
    value: pulumi.Input<string>;
}>;

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

The 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 Terraform.

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 mapping of tags to assign to the resource.

interface EventRuleEvent

interface EventRuleEventSubscriptionArgs

Arguments to control the event rule subscription. Currently empty, but still defined in case of future need.

interface EventRuleState

Input 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 Terraform.

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 mapping of tags to assign to the resource.

interface EventTargetArgs

The 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<{
    arraySize: pulumi.Input<number>;
    jobAttempts: pulumi.Input<number>;
    jobDefinition: pulumi.Input<string>;
    jobName: pulumi.Input<string>;
}>;

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<{
    group: pulumi.Input<string>;
    launchType: pulumi.Input<string>;
    networkConfiguration: pulumi.Input<{
        assignPublicIp: pulumi.Input<boolean>;
        securityGroups: pulumi.Input<pulumi.Input<string>[]>;
        subnets: pulumi.Input<pulumi.Input<string>[]>;
    }>;
    platformVersion: pulumi.Input<string>;
    taskCount: pulumi.Input<number>;
    taskDefinitionArn: pulumi.Input<string>;
}>;

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<{
    inputPaths: pulumi.Input<{[key: string]: any}>;
    inputTemplate: pulumi.Input<string>;
}>;

Parameters used when you are providing a custom input to a target based on certain event data.

property kinesisTarget

kinesisTarget?: pulumi.Input<{
    partitionKeyPath: pulumi.Input<string>;
}>;

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 ecs_target 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<{
    key: pulumi.Input<string>;
    values: pulumi.Input<pulumi.Input<string>[]>;
}>[]>;

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<{
    messageGroupId: pulumi.Input<string>;
}>;

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

Input 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<{
    arraySize: pulumi.Input<number>;
    jobAttempts: pulumi.Input<number>;
    jobDefinition: pulumi.Input<string>;
    jobName: pulumi.Input<string>;
}>;

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<{
    group: pulumi.Input<string>;
    launchType: pulumi.Input<string>;
    networkConfiguration: pulumi.Input<{
        assignPublicIp: pulumi.Input<boolean>;
        securityGroups: pulumi.Input<pulumi.Input<string>[]>;
        subnets: pulumi.Input<pulumi.Input<string>[]>;
    }>;
    platformVersion: pulumi.Input<string>;
    taskCount: pulumi.Input<number>;
    taskDefinitionArn: pulumi.Input<string>;
}>;

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<{
    inputPaths: pulumi.Input<{[key: string]: any}>;
    inputTemplate: pulumi.Input<string>;
}>;

Parameters used when you are providing a custom input to a target based on certain event data.

property kinesisTarget

kinesisTarget?: pulumi.Input<{
    partitionKeyPath: pulumi.Input<string>;
}>;

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 ecs_target 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<{
    key: pulumi.Input<string>;
    values: pulumi.Input<pulumi.Input<string>[]>;
}>[]>;

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<{
    messageGroupId: pulumi.Input<string>;
}>;

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

A collection of arguments for invoking getLogGroup.

property name

name: string;

The name of the Cloudwatch log group

interface GetLogGroupResult

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

id is the provider-assigned unique ID for this managed resource.

property name

name: string;

interface LogDestinationArgs

The 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 or Amazon Lambda resource for the destination

interface LogDestinationPolicyArgs

The 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

Input 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

Input 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 or Amazon Lambda resource for the destination

interface LogGroupArgs

The 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, Terraform 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.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface LogGroupEvent

property awslogs

awslogs: {
    data: string;
};

interface LogGroupEventRecord

interface LogGroupEventSubscriptionArgs

Arguments 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

Input 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, Terraform 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.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface LogMetricFilterArgs

The 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<{
    defaultValue: pulumi.Input<string>;
    name: pulumi.Input<string>;
    namespace: pulumi.Input<string>;
    value: pulumi.Input<string>;
}>;

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

Input 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<{
    defaultValue: pulumi.Input<string>;
    name: pulumi.Input<string>;
    namespace: pulumi.Input<string>;
    value: pulumi.Input<string>;
}>;

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

The 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

Input 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

The 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

Input 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

The 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<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

Input 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<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

The 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.

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<{
    expression: pulumi.Input<string>;
    id: pulumi.Input<string>;
    label: pulumi.Input<string>;
    metric: pulumi.Input<{
        dimensions: pulumi.Input<{[key: string]: any}>;
        metricName: pulumi.Input<string>;
        namespace: pulumi.Input<string>;
        period: pulumi.Input<number>;
        stat: pulumi.Input<string>;
        unit: pulumi.Input<string>;
    }>;
    returnData: pulumi.Input<boolean>;
}>[]>;

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 mapping of tags to assign to the resource.

property threshold

threshold: pulumi.Input<number>;

The value against which the specified statistic is compared.

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

Input 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.

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<{
    expression: pulumi.Input<string>;
    id: pulumi.Input<string>;
    label: pulumi.Input<string>;
    metric: pulumi.Input<{
        dimensions: pulumi.Input<{[key: string]: any}>;
        metricName: pulumi.Input<string>;
        namespace: pulumi.Input<string>;
        period: pulumi.Input<number>;
        stat: pulumi.Input<string>;
        unit: pulumi.Input<string>;
    }>;
    returnData: pulumi.Input<boolean>;
}>[]>;

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 mapping of tags to assign to the resource.

property threshold

threshold?: pulumi.Input<number>;

The value against which the specified statistic is compared.

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.

type EventRuleEventHandler

type EventRuleEventHandler = lambda.EventHandler<EventRuleEvent, void>;

type LogGroupEventHandler

type LogGroupEventHandler = lambda.EventHandler<LogGroupEvent, void>;