cloudcomponents / cdk-constructs

A collection of higher-level reusable cdk constructs
MIT License
625 stars 104 forks source link

Pipeline Notifications - can't update stack - Internal Error #130

Closed brettswift closed 2 years ago

brettswift commented 2 years ago

Hey,

First off thanks for publishing all these resources.

My issue is that I can't update a template with the PipelineNotificationRule in it.

I'm attempting to hook up our pipelines to MS Teams, and am running into a cloudformation "Internal Failure" error when I update the stack.

I'm guessing you have run into this - and it might be an error with the template.

The cdk code:

     // This is wrapped in a construct of my own. 

        const pipeline = Pipeline.fromPipelineArn(this, 'pipeline', props.pipeline.pipelineArn)

        const webhook = new chatops.MSTeamsIncomingWebhookConfiguration(
            scope,
            `MSTeamsWebhook${id}`,
            {
                url: props.webhookUrl,
                accountLabelMode: chatops.AccountLabelMode.ID_AND_ALIAS,
                themeColor: props.themeColour || '#FF0000',
            },
        );

        const PIPELINE_EVENTS_DEFAULT =     [
                notifications.PipelineEvent.PIPELINE_EXECUTION_FAILED,
                notifications.PipelineEvent.MANUAL_APPROVAL_NEEDED,
        ]

        new notifications.PipelineNotificationRule(this, 'PipelineNotificationRule', {
            name: `MSTeams${id}`,
            pipeline,
            events: props.events || PIPELINE_EVENTS_DEFAULT,
            targets: [
                new notifications.MSTeamsIncomingWebhook(webhook),
            ],
        });

I've poked around in CloudTrail to see what API is failing but haven't had any luck so far.

Is this working for you on:

brettswift commented 2 years ago

This one goes deep it seems. The failure has so far been isolated to a tag on the AWS::CodeStarNotifications::NotificationRule resource, and when that tag changes, things go BOOM.

Cloudformation is supposed to do a REPLACE action on the resource when a tag changes, however that doesn't seem to happen.

The product team is fixing the cloudformation bug, so I'll close this. By the time anyone else finds this post - hopefully it'll be fixed. :)

bazediol commented 2 years ago

Looks like this issue is still relevant. During attempt to update tag for CodeStartNotification Rule deployment fails with "Internal fail" error. Are there any workarounds available?