When a package is created or revised in a Quilt stack bucket, the stack emits a package-revision event on the default EventBridge bus. These events have the following structure:
You can create an EventBridge rule similar to the following to respond to package-revision events:
Example: send email on package creation
Description:> Demonstrate how to respond to package events. Modify `EventBridgeRule` to customize event processing. See https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html for event pattern syntax. See https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html for rule targets.Parameters:PackageBucket:Type:StringPackageNamePrefix:Type:StringDescription:Leave empty to match every package.EmailToSubscribe:Type:StringDescription:> Confirm subscription over email to receive a copy of package events that occur under `PackageNamePrefix` in `PackageBucket`.Resources:EventBridgeRule:Type:AWS::Events::RuleProperties:EventPattern:source: - "com.quiltdata"detail-type: - "package-revision"detail:type: - "created"handle: - prefix:!RefPackageNamePrefixbucket: - !RefPackageBucketTargets: - Arn:!RefSNSTopicId:"OpsTopic"SNSTopic:Type:AWS::SNS::TopicSNSTopicPolicy:Type:AWS::SNS::TopicPolicyProperties:PolicyDocument:Statement: - Effect:AllowPrincipal:Service:events.amazonaws.comAction:'sns:Publish'Resource:'*'Topics: - !RefSNSTopicSNSTopicSubscription:Type:AWS::SNS::SubscriptionProperties:Endpoint:!RefEmailToSubscribeProtocol:emailTopicArn:!RefSNSTopic