Codemagic builds are not triggered from CodeCommit

Viewed 48

I was following the instructions provided by Codemagic to add a WebHook to CodeCommit. Which includes creating a topic, adding to it a subscription and then configuring Notify in repository.

Anyhow, after merging or changing my master directly no build is still triggered.

Here is my setup: Webhook in Codemagic: enter image description here Topic with a subscription: enter image description here

Notification rule targets:

What I did notice is that notification target status is unreachable. But I have no clue what it actually means.

Does my problem occur because of the unreachable status? What exactly does it mean then?

enter image description here

2 Answers

Well, apparently the documentation here has been updated: https://docs.codemagic.io/configuration/webhooks/#setting-up-webhooks-for-aws-codecommit

There is a configuration that you have to update for your topic's access policy:

{
  "Version": "2008-10-17",
  "Statement": [
    {
      "Sid": "CodeNotification_publish",
      "Effect": "Allow",
      "Principal": {
        "Service": "codestar-notifications.amazonaws.com"
      },
      "Action": "SNS:Publish",
      "Resource": "arn:aws:sns:REGION:ACCOUNT_ID:REPOSITORY"
    }
  ]
}

Make sure to update Resource! "Resource": "arn:aws:sns:REGION:ACCOUNT_ID:REPOSITORY"

Copy ARN from your topic: enter image description here

Apart from that(as said above) this step is important:

Under Recent deliveries (in Codemagic -> App -> Webhooks), choose the most recent webhook, and copy the subscription link under the Results tab to your browser.

Related