constructor()

in source/lib/events/code_deploy_events_construct.ts [25:58]


  constructor(scope: cdk.Construct, id: string, props: CodeDeployEventsProps) {
    super(scope, id);

    /**
     * Create CloudWatch Events Rule for AWS CodeDeploy
     */
    let codeDeployEventRulePattern = {
      "source": [
        "aws.codedeploy"
      ],
      "detail-type": [
        "CodeDeploy Deployment State-change Notification"
      ]
    }

    let codeDeployEventRuleTarget: events.IRuleTarget = {
      bind: () => ({
        id: '',
        arn: props.firehoseArn,
        role: props.eventsRuleRole
      })
    };

    let codeDeployEventRuleProps = {
      description: 'AWS DevOps Monitoring Dashboard Solution - Event rule for AWS CodeDeploy',
      eventPattern: codeDeployEventRulePattern,
      enabled: true
    }

    const defaultCodeDeployEventsRuleProps = DefaultEventsRuleProps([codeDeployEventRuleTarget]);
    const codeDeployEventsRuleProps = overrideProps(defaultCodeDeployEventsRuleProps, codeDeployEventRuleProps, true);

    new events.Rule(this, 'CodeDeployEventsRule', codeDeployEventsRuleProps);
  }