AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: 'hipchat-sns-bridge deployment' Parameters: Env: Description: The environment name. Type: String Default: dev Resources: HipchatCapabilitiesDescriptorFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/hipchat/capabilities' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-hipchat-capabilities-descriptor' Handler: src/main/js/handlers/hipchat_capabilities_descriptor.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 HipchatCapabilitiesDescriptorFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ HipchatCapabilitiesDescriptorFunction}' RetentionInDays: 7 HipchatInstallDataFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: DeleteByOauthId: Type: Api Properties: Path: '/hipchat/installable/{oauthId}' Method: delete Get: Type: Api Properties: Path: '/hipchat/installable' Method: get Post: Type: Api Properties: Path: '/hipchat/installable' Method: post Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-hipchat-install-data' Handler: src/main/js/handlers/hipchat_install_data.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 HipchatInstallDataFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ HipchatInstallDataFunction}' RetentionInDays: 7 ServiceInfoFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/info' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-service-info' Handler: src/main/js/handlers/service_info.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 ServiceInfoFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ ServiceInfoFunction}' RetentionInDays: 7 SnsNotificationFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: PostByRoomId: Type: Api Properties: Path: '/hipchat/room/{roomId}/notification' Method: post Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-sns-notification' Handler: src/main/js/handlers/sns_notification.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 SnsNotificationFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ SnsNotificationFunction}' RetentionInDays: 7 Outputs: HipchatCapabilitiesDescriptorFunction: Description: The name of the Lambda function for the HipchatCapabilitiesDescriptor model Value: !Ref HipchatCapabilitiesDescriptorFunction Export: Name: !Sub '${AWS::StackName}-functions-HipchatCapabilitiesDescriptor' HipchatCapabilitiesDescriptorFunctionRole: Description: The name of the Lambda function role for the HipchatCapabilitiesDescriptor model Value: !Ref HipchatCapabilitiesDescriptorFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-HipchatCapabilitiesDescriptor' HipchatInstallDataFunction: Description: The name of the Lambda function for the HipchatInstallData model Value: !Ref HipchatInstallDataFunction Export: Name: !Sub '${AWS::StackName}-functions-HipchatInstallData' HipchatInstallDataFunctionRole: Description: The name of the Lambda function role for the HipchatInstallData model Value: !Ref HipchatInstallDataFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-HipchatInstallData' ServiceInfoFunction: Description: The name of the Lambda function for the ServiceInfo model Value: !Ref ServiceInfoFunction Export: Name: !Sub '${AWS::StackName}-functions-ServiceInfo' ServiceInfoFunctionRole: Description: The name of the Lambda function role for the ServiceInfo model Value: !Ref ServiceInfoFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-ServiceInfo' SnsNotificationFunction: Description: The name of the Lambda function for the SnsNotification model Value: !Ref SnsNotificationFunction Export: Name: !Sub '${AWS::StackName}-functions-SnsNotification' SnsNotificationFunctionRole: Description: The name of the Lambda function role for the SnsNotification model Value: !Ref SnsNotificationFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-SnsNotification'