UNPKG

@incdevco/framework

Version:
97 lines (96 loc) 2.36 kB
{ "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": { "Export": { "Name": "AssetsAlarmArn" }, "Value": {"Ref": "AlarmTopic"} }, "AssetsBucket": { "Export": { "Name": "AssetsBucket" }, "Value": {"Ref": "Bucket"} } } }