@incdevco/framework
Version:
node.js lambda framework
91 lines (90 loc) • 2.24 kB
JSON
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Template For Assets Resources",
"Parameters": {
"EmailAddress": {
"Description": "email address that will e subscribed to the alarm topic.",
"Type": "String"
},
"DisplayName": {
"Description": "name to identify which account the alarms are from",
"Type": "String"
}
},
"Conditions": {
},
"Mappings": {},
"Resources": {
"Bucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"AccessControl": "Private",
"LifecycleConfiguration": {
"Rules": [
{
"Status": "Enabled",
"NoncurrentVersionExpirationInDays": 1,
"Prefix": "",
"Id": "Delete Old Versions"
}
]
},
"VersioningConfiguration": {
"Status": "Enabled"
}
}
},
"AlarmTopic": {
"Type": "AWS::SNS::Topic",
"Properties": {
"Subscription": [
{
"Endpoint": {"Ref": "EmailAddress"},
"Protocol": "email"
}
],
"DisplayName": {"Fn::Join": ["", [
{"Ref": "DisplayName"},
"-Alarms"
]]}
}
},
"ApiGatewayCloudWatchRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "apigateway.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
},
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs"
],
"Path": "/",
"Policies": [],
"RoleName": "ApiGatewayCloudWatchRole"
}
},
"ApiGatewaySetupLogging": {
"Type": "AWS::ApiGateway::Account",
"Properties": {
"CloudWatchRoleArn": {"Fn::GetAtt": ["ApiGatewayCloudWatchRole", "Arn"]}
}
}
},
"Outputs": {
"AssetsAlarmArn": {
"Value": {"Ref": "AlarmTopic"}
},
"AssetsBucket": {
"Value": {"Ref": "Bucket"}
}
}
}