How to use the @aws-cdk/aws-events.RuleTargetInput.fromObject function in @aws-cdk/aws-events

To help you get started, we’ve selected a few @aws-cdk/aws-events examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudcomponents / cdk-components / packages / cdk-pull-request-check / src / pull_request_check.ts View on Github external
{
                eventPattern: {
                    detail: {
                        event: [
                            'pullRequestSourceBranchUpdated',
                            'pullRequestCreated',
                        ],
                    },
                },
            },
        );

        rule.addTarget(new LambdaFunction(pullRequestFunction));
        rule.addTarget(
            new CodeBuildProject(pullRequestProject, {
                event: RuleTargetInput.fromObject({
                    sourceVersion: EventField.fromPath('$.detail.sourceCommit'),
                    artifactsOverride: { type: 'NO_ARTIFACTS' },
                    environmentVariablesOverride: [
                        {
                            name: 'pullRequestId',
                            value: EventField.fromPath(
                                '$.detail.pullRequestId',
                            ),
                            type: 'PLAINTEXT',
                        },
                        {
                            name: 'repositoryName',
                            value: EventField.fromPath(
                                '$.detail.repositoryNames[0]',
                            ),
                            type: 'PLAINTEXT',
github cloudcomponents / cdk-components / packages / cdk-pull-request-check / src / pull_request_project_target.ts View on Github external
public bind(_rule: IRule): RuleTargetConfig {
        const input = RuleTargetInput.fromObject({
            sourceVersion: EventField.fromPath('$.detail.sourceCommit'),
            artifactsOverride: { type: 'NO_ARTIFACTS' },
            environmentVariablesOverride: [
                {
                    name: 'pullRequestId',
                    value: EventField.fromPath('$.detail.pullRequestId'),
                    type: 'PLAINTEXT',
                },
                {
                    name: 'repositoryName',
                    value: EventField.fromPath('$.detail.repositoryNames[0]'),
                    type: 'PLAINTEXT',
                },
                {
                    name: 'sourceCommit',
                    value: EventField.fromPath('$.detail.sourceCommit'),