Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudWatch Events: new classes for Targets #1663

Closed
rix0rrr opened this issue Feb 4, 2019 · 2 comments · May be fixed by MechanicalRock/account-reaper#6
Closed

CloudWatch Events: new classes for Targets #1663

rix0rrr opened this issue Feb 4, 2019 · 2 comments · May be fixed by MechanicalRock/account-reaper#6
Labels
@aws-cdk/aws-events Related to CloudWatch Events

Comments

@rix0rrr
Copy link
Contributor

rix0rrr commented Feb 4, 2019

It probably makes more sense for CloudWatch Events to introduce special "integration classes" that allow typesafe specification of the inputTemplate blob that goes to the target. See for example this PR:

#1571

The following is pretty awkward and could be typesafe:

    rule.addTarget(target, {
      jsonTemplate: JSON.stringify({
        containerOverrides: [{
          name: 'TheContainer',
          environment: [{ name: 'I_WAS_TRIGGERED', value: 'From CloudWatch Events' }]
        }]
      })
    });
@rix0rrr rix0rrr added pr/breaking-change This PR is a breaking change. It needs to be modified to be allowed in the current major version. @aws-cdk/aws-events Related to CloudWatch Events and removed pr/breaking-change This PR is a breaking change. It needs to be modified to be allowed in the current major version. labels Feb 4, 2019
@rix0rrr
Copy link
Contributor Author

rix0rrr commented Feb 4, 2019

Could be a non-breaking change if simply model it as an IEventTarget that has a template built-in, and we disallow combination of target-provided inputTemplate and user-provided inputTemplate.

eladb pushed a commit that referenced this issue Apr 22, 2019
The `LambdaFunction` class can be used to bind an AWS Lambda function as an event
rule target.

Related #1663 

BREAKING CHANGE: `lambda.Function` no longer implements `IEventRuleTarget`. Instead, use
`@aws-cdk/aws-events-targets.LambdaFunction`.
piradeepk pushed a commit to piradeepk/aws-cdk that referenced this issue Apr 25, 2019
The `LambdaFunction` class can be used to bind an AWS Lambda function as an event
rule target.

Related aws#1663 

BREAKING CHANGE: `lambda.Function` no longer implements `IEventRuleTarget`. Instead, use
`@aws-cdk/aws-events-targets.LambdaFunction`.
@eladb
Copy link
Contributor

eladb commented May 1, 2019

Superseded by #2403 #2404 #2405

@eladb eladb closed this as completed May 1, 2019
SanderKnape pushed a commit to SanderKnape/aws-cdk that referenced this issue May 14, 2019
The `LambdaFunction` class can be used to bind an AWS Lambda function as an event
rule target.

Related aws#1663 

BREAKING CHANGE: `lambda.Function` no longer implements `IEventRuleTarget`. Instead, use
`@aws-cdk/aws-events-targets.LambdaFunction`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-events Related to CloudWatch Events
Projects
None yet
2 participants