serverless-aws-sns-apple-cert-date checks AppleCertificateExpirationDate on AWS SNS and send slack when expiring, powered by AWS Lambda.
Download
Download serverless-aws-sns-apple-cert-date by command below.
$ git clone https://github.com/evalphobia/serverless-aws-sns-apple-cert-date
$ cd serverless-aws-sns-apple-cert-date
$ make init
Config
serverless.yml
Change environment variables below,
$ vim serverless.yml
------------
provider:
name: aws
region: ap-northeast-1 # <- Change to your target region.
...
functions:
check:
handler: bin/serverless
memorySize: 128
timeout: 119
environment:
# Change to your target Application Platform ARN of AWS SNS.
ARN_LIST: >-
arn:aws:sns:ap-northeast-1:000000000000:app/APNS/app1
arn:aws:sns:ap-northeast-1:000000000000:app/APNS/app2
arn:aws:sns:ap-northeast-1:000000000000:app/APNS/app3
arn:aws:sns:ap-northeast-1:000000000000:app/APNS/app4
# Change to your own threshold.
TIME_THRESHOLD: 30d10h # 30days and 10 hours before
# If you want to get report even if it's not in expiring, turn it to true.
FORCE_REPORT: false
# SLACK_WEBHOOK_URL_KMS: 'xxx'
SLACK_WEBHOOK_URL: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
SLACK_CHANNEL: '#channel'
events:
- schedule: cron(0 0 * * ? *) # exec everyday on 00:00
Environment variables
Name
Description
Default
ARN_LIST
Puts Application Platform ARNs on AWS SNS.
-
FORCE_REPORT
A flag to send the report to Slack even if not in expiring.