<reponame>pulumi-bot/pulumi-aws
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import pulumi
import pulumi.runtime

class EventRule(pulumi.CustomResource):
    """
    Provides a CloudWatch Event Rule resource.
    """
    def __init__(__self__, __name__, __opts__=None, description=None, event_pattern=None, is_enabled=None, name=None, name_prefix=None, role_arn=None, schedule_expression=None):
        """Create a EventRule resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if description and not isinstance(description, basestring):
            raise TypeError('Expected property description to be a basestring')
        __self__.description = description
        """
        The description of the rule.
        """
        __props__['description'] = description

        if event_pattern and not isinstance(event_pattern, basestring):
            raise TypeError('Expected property event_pattern to be a basestring')
        __self__.event_pattern = event_pattern
        """
        Event pattern
        described a JSON object.
        See full documentation of [CloudWatch Events and Event Patterns](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CloudWatchEventsandEventPatterns.html) for details.
        """
        __props__['eventPattern'] = event_pattern

        if is_enabled and not isinstance(is_enabled, bool):
            raise TypeError('Expected property is_enabled to be a bool')
        __self__.is_enabled = is_enabled
        """
        Whether the rule should be enabled (defaults to `true`).
        """
        __props__['isEnabled'] = is_enabled

        if name and not isinstance(name, basestring):
            raise TypeError('Expected property name to be a basestring')
        __self__.name = name
        """
        The rule's name. By default generated by Terraform.
        """
        __props__['name'] = name

        if name_prefix and not isinstance(name_prefix, basestring):
            raise TypeError('Expected property name_prefix to be a basestring')
        __self__.name_prefix = name_prefix
        """
        The rule's name. Conflicts with `name`.
        """
        __props__['namePrefix'] = name_prefix

        if role_arn and not isinstance(role_arn, basestring):
            raise TypeError('Expected property role_arn to be a basestring')
        __self__.role_arn = role_arn
        """
        The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
        """
        __props__['roleArn'] = role_arn

        if schedule_expression and not isinstance(schedule_expression, basestring):
            raise TypeError('Expected property schedule_expression to be a basestring')
        __self__.schedule_expression = schedule_expression
        """
        The scheduling expression.
        For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`.
        """
        __props__['scheduleExpression'] = schedule_expression

        __self__.arn = pulumi.runtime.UNKNOWN
        """
        The Amazon Resource Name (ARN) of the rule.
        """

        super(EventRule, __self__).__init__(
            'aws:cloudwatch/eventRule:EventRule',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'arn' in outs:
            self.arn = outs['arn']
        if 'description' in outs:
            self.description = outs['description']
        if 'eventPattern' in outs:
            self.event_pattern = outs['eventPattern']
        if 'isEnabled' in outs:
            self.is_enabled = outs['isEnabled']
        if 'name' in outs:
            self.name = outs['name']
        if 'namePrefix' in outs:
            self.name_prefix = outs['namePrefix']
        if 'roleArn' in outs:
            self.role_arn = outs['roleArn']
        if 'scheduleExpression' in outs:
            self.schedule_expression = outs['scheduleExpression']

# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import pulumi
import pulumi.runtime

class EventRule(pulumi.CustomResource):
    """
    Provides a CloudWatch Event Rule resource.
    """
    def __init__(__self__, __name__, __opts__=None, description=None, event_pattern=None, is_enabled=None, name=None, name_prefix=None, role_arn=None, schedule_expression=None):
        """Create a EventRule resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if description and not isinstance(description, basestring):
            raise TypeError('Expected property description to be a basestring')
        __self__.description = description
        """
        The description of the rule.
        """
        __props__['description'] = description

        if event_pattern and not isinstance(event_pattern, basestring):
            raise TypeError('Expected property event_pattern to be a basestring')
        __self__.event_pattern = event_pattern
        """
        Event pattern
        described a JSON object.
        See full documentation of [CloudWatch Events and Event Patterns](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CloudWatchEventsandEventPatterns.html) for details.
        """
        __props__['eventPattern'] = event_pattern

        if is_enabled and not isinstance(is_enabled, bool):
            raise TypeError('Expected property is_enabled to be a bool')
        __self__.is_enabled = is_enabled
        """
        Whether the rule should be enabled (defaults to `true`).
        """
        __props__['isEnabled'] = is_enabled

        if name and not isinstance(name, basestring):
            raise TypeError('Expected property name to be a basestring')
        __self__.name = name
        """
        The rule's name. By default generated by Terraform.
        """
        __props__['name'] = name

        if name_prefix and not isinstance(name_prefix, basestring):
            raise TypeError('Expected property name_prefix to be a basestring')
        __self__.name_prefix = name_prefix
        """
        The rule's name. Conflicts with `name`.
        """
        __props__['namePrefix'] = name_prefix

        if role_arn and not isinstance(role_arn, basestring):
            raise TypeError('Expected property role_arn to be a basestring')
        __self__.role_arn = role_arn
        """
        The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
        """
        __props__['roleArn'] = role_arn

        if schedule_expression and not isinstance(schedule_expression, basestring):
            raise TypeError('Expected property schedule_expression to be a basestring')
        __self__.schedule_expression = schedule_expression
        """
        The scheduling expression.
        For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`.
        """
        __props__['scheduleExpression'] = schedule_expression

        __self__.arn = pulumi.runtime.UNKNOWN
        """
        The Amazon Resource Name (ARN) of the rule.
        """

        super(EventRule, __self__).__init__(
            'aws:cloudwatch/eventRule:EventRule',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'arn' in outs:
            self.arn = outs['arn']
        if 'description' in outs:
            self.description = outs['description']
        if 'eventPattern' in outs:
            self.event_pattern = outs['eventPattern']
        if 'isEnabled' in outs:
            self.is_enabled = outs['isEnabled']
        if 'name' in outs:
            self.name = outs['name']
        if 'namePrefix' in outs:
            self.name_prefix = outs['namePrefix']
        if 'roleArn' in outs:
            self.role_arn = outs['roleArn']
        if 'scheduleExpression' in outs:
            self.schedule_expression = outs['scheduleExpression']
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** Provides a CloudWatch Event Rule resource. Create a EventRule resource with the given unique name, props, and options. The description of the rule. Event pattern         described a JSON object.         See full documentation of [CloudWatch Events and Event Patterns](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CloudWatchEventsandEventPatterns.html) for details. Whether the rule should be enabled (defaults to `true`). The rule's name. By default generated by Terraform. The rule's name. Conflicts with `name`. The Amazon Resource Name (ARN) associated with the role that is used for target invocation. The scheduling expression.         For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. The Amazon Resource Name (ARN) of the rule.