- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch4/cdn-invalidate --path cncb-cdn-invalidate
- Navigate to the cncb-cdn-invalidate directory with cd cncb-cdn-invalidate.
- Review the file named serverless.yml with the following content:
service: cncb-cdn-invalidateprovider: name: aws runtime: nodejs8.10 ...functions: load: ... trigger: handler: handler.trigger events: - sns: arn: Ref: BucketTopic topicName: ${self:service}-${opt:stage}-trigger environment: DISABLED: false DISTRIBUTION_ID: Ref: ApiDistributionresources: Resources: Bucket: Type: AWS::S3::Bucket DependsOn: [ BucketTopic, BucketTopicPolicy ] Properties: NotificationConfiguration ...