AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: 'hilltop-api deployment' Parameters: Env: Description: The environment name. Type: String Default: dev Resources: ActiveStakeAmountFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/active_stake_amounts' Method: get GetByPoolBech32Id: Type: Api Properties: Path: '/active_stake_amounts/{pool_bech32_id}' Method: get GetByPoolBech32Id: Type: Api Properties: Path: '/active_stake_amounts/{pool_bech32_id}/addresses' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-active-stake-amount' Handler: src/main/js/handlers/active_stake_amount.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 ActiveStakeAmountFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ ActiveStakeAmountFunction}' RetentionInDays: 7 BlockFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/blocks/blocks_in_day' Method: get GetByBlockNumber: Type: Api Properties: Path: '/blocks/{block_number}' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-block' Handler: src/main/js/handlers/block.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 BlockFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ BlockFunction}' RetentionInDays: 7 DelegationFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: GetByStakingAddress: Type: Api Properties: Path: '/delegations/{staking_address}/safe_payment' Method: get GetByStakingAddress: Type: Api Properties: Path: '/delegations/{staking_address}/stakepool' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-delegation' Handler: src/main/js/handlers/delegation.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 DelegationFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ DelegationFunction}' RetentionInDays: 7 DelegatorsCountFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: GetByPoolBech32Id: Type: Api Properties: Path: '/delegators_counts/{pool_bech32_id}' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-delegators-count' Handler: src/main/js/handlers/delegators_count.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 DelegatorsCountFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ DelegatorsCountFunction}' RetentionInDays: 7 EpochFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/epochs/current' Method: get GetByEpochNumber: Type: Api Properties: Path: '/epochs/{epoch_number}' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-epoch' Handler: src/main/js/handlers/epoch.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 EpochFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ EpochFunction}' RetentionInDays: 7 HealthcheckFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/healthchecks' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-healthcheck' Handler: src/main/js/handlers/healthcheck.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 HealthcheckFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ HealthcheckFunction}' RetentionInDays: 7 NativeAssetFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/native_assets/ids' Method: get GetByPolicyId: Type: Api Properties: Path: '/native_assets/{policy_id}/asset_names' Method: get Get: Type: Api Properties: Path: '/native_assets/nfts' Method: get GetByStakeAddress: Type: Api Properties: Path: '/native_assets/{stake_address}' Method: get Post: Type: Api Properties: Path: '/native_assets/native_assets_details' Method: post Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-native-asset' Handler: src/main/js/handlers/native_asset.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 NativeAssetFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ NativeAssetFunction}' RetentionInDays: 7 PoolUpdateFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Get: Type: Api Properties: Path: '/pool_updates/retiring' Method: get GetByPoolId: Type: Api Properties: Path: '/pool_updates/{pool_id}' Method: get Get: Type: Api Properties: Path: '/pool_updates' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-pool-update' Handler: src/main/js/handlers/pool_update.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 PoolUpdateFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ PoolUpdateFunction}' RetentionInDays: 7 RewardFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: GetByStakingAddress: Type: Api Properties: Path: '/rewards/{staking_address}' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-reward' Handler: src/main/js/handlers/reward.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 RewardFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ RewardFunction}' RetentionInDays: 7 SigmaFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: GetByPoolId: Type: Api Properties: Path: '/sigmas/{pool_id}' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-sigma' Handler: src/main/js/handlers/sigma.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 SigmaFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ SigmaFunction}' RetentionInDays: 7 StakepoolFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: GetByVrfVkeyHash: Type: Api Properties: Path: '/stakepools/vrf_vkey/{vrf_vkey_hash}' Method: get GetByPoolId: Type: Api Properties: Path: '/stakepools/{pool_id}/established_epoch' Method: get GetByPoolId: Type: Api Properties: Path: '/stakepools/{pool_id}/live_stake' Method: get GetByPoolId: Type: Api Properties: Path: '/stakepools/{pool_id}/blocks' Method: get Get: Type: Api Properties: Path: '/stakepools' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-stakepool' Handler: src/main/js/handlers/stakepool.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 StakepoolFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ StakepoolFunction}' RetentionInDays: 7 StakepoolMetadataFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: GetByPoolIdBech32: Type: Api Properties: Path: '/stakepool_metadata/{pool_id_bech32}' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-stakepool-metadata' Handler: src/main/js/handlers/stakepool_metadata.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 StakepoolMetadataFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ StakepoolMetadataFunction}' RetentionInDays: 7 TransactionFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: Post: Type: Api Properties: Path: '/transactions/history' Method: post Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-transaction' Handler: src/main/js/handlers/transaction.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 TransactionFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ TransactionFunction}' RetentionInDays: 7 WalletBalanceFunction: Type: AWS::Serverless::Function Properties: CodeUri: ../../.. Environment: Variables: ENV: !Ref Env Events: GetByStakingAddress: Type: Api Properties: Path: '/wallet_balances/{staking_address}' Method: get Ping: Type: Schedule Properties: Schedule: rate(5 minutes) Input: '{"httpMethod": "PING"}' FunctionName: !Sub '${AWS::StackName}-wallet-balance' Handler: src/main/js/handlers/wallet_balance.handler Policies: - AWSLambdaBasicExecutionRole - Version: 2012-10-17 Statement: - Action: - secretsmanager:GetSecretValue Effect: Allow Resource: '*' - Action: - kms:Decrypt Effect: Allow Resource: '*' Runtime: nodejs8.10 WalletBalanceFunctionLogRetention: Type: AWS::Logs::LogGroup Properties: LogGroupName: !Sub '/aws/lambda/${ WalletBalanceFunction}' RetentionInDays: 7 Outputs: ActiveStakeAmountFunction: Description: The name of the Lambda function for the ActiveStakeAmount model Value: !Ref ActiveStakeAmountFunction Export: Name: !Sub '${AWS::StackName}-functions-ActiveStakeAmount' ActiveStakeAmountFunctionRole: Description: The name of the Lambda function role for the ActiveStakeAmount model Value: !Ref ActiveStakeAmountFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-ActiveStakeAmount' BlockFunction: Description: The name of the Lambda function for the Block model Value: !Ref BlockFunction Export: Name: !Sub '${AWS::StackName}-functions-Block' BlockFunctionRole: Description: The name of the Lambda function role for the Block model Value: !Ref BlockFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Block' DelegationFunction: Description: The name of the Lambda function for the Delegation model Value: !Ref DelegationFunction Export: Name: !Sub '${AWS::StackName}-functions-Delegation' DelegationFunctionRole: Description: The name of the Lambda function role for the Delegation model Value: !Ref DelegationFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Delegation' DelegatorsCountFunction: Description: The name of the Lambda function for the DelegatorsCount model Value: !Ref DelegatorsCountFunction Export: Name: !Sub '${AWS::StackName}-functions-DelegatorsCount' DelegatorsCountFunctionRole: Description: The name of the Lambda function role for the DelegatorsCount model Value: !Ref DelegatorsCountFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-DelegatorsCount' EpochFunction: Description: The name of the Lambda function for the Epoch model Value: !Ref EpochFunction Export: Name: !Sub '${AWS::StackName}-functions-Epoch' EpochFunctionRole: Description: The name of the Lambda function role for the Epoch model Value: !Ref EpochFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Epoch' HealthcheckFunction: Description: The name of the Lambda function for the Healthcheck model Value: !Ref HealthcheckFunction Export: Name: !Sub '${AWS::StackName}-functions-Healthcheck' HealthcheckFunctionRole: Description: The name of the Lambda function role for the Healthcheck model Value: !Ref HealthcheckFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Healthcheck' NativeAssetFunction: Description: The name of the Lambda function for the NativeAsset model Value: !Ref NativeAssetFunction Export: Name: !Sub '${AWS::StackName}-functions-NativeAsset' NativeAssetFunctionRole: Description: The name of the Lambda function role for the NativeAsset model Value: !Ref NativeAssetFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-NativeAsset' PoolUpdateFunction: Description: The name of the Lambda function for the PoolUpdate model Value: !Ref PoolUpdateFunction Export: Name: !Sub '${AWS::StackName}-functions-PoolUpdate' PoolUpdateFunctionRole: Description: The name of the Lambda function role for the PoolUpdate model Value: !Ref PoolUpdateFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-PoolUpdate' RewardFunction: Description: The name of the Lambda function for the Reward model Value: !Ref RewardFunction Export: Name: !Sub '${AWS::StackName}-functions-Reward' RewardFunctionRole: Description: The name of the Lambda function role for the Reward model Value: !Ref RewardFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Reward' SigmaFunction: Description: The name of the Lambda function for the Sigma model Value: !Ref SigmaFunction Export: Name: !Sub '${AWS::StackName}-functions-Sigma' SigmaFunctionRole: Description: The name of the Lambda function role for the Sigma model Value: !Ref SigmaFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Sigma' StakepoolFunction: Description: The name of the Lambda function for the Stakepool model Value: !Ref StakepoolFunction Export: Name: !Sub '${AWS::StackName}-functions-Stakepool' StakepoolFunctionRole: Description: The name of the Lambda function role for the Stakepool model Value: !Ref StakepoolFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Stakepool' StakepoolMetadataFunction: Description: The name of the Lambda function for the StakepoolMetadata model Value: !Ref StakepoolMetadataFunction Export: Name: !Sub '${AWS::StackName}-functions-StakepoolMetadata' StakepoolMetadataFunctionRole: Description: The name of the Lambda function role for the StakepoolMetadata model Value: !Ref StakepoolMetadataFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-StakepoolMetadata' TransactionFunction: Description: The name of the Lambda function for the Transaction model Value: !Ref TransactionFunction Export: Name: !Sub '${AWS::StackName}-functions-Transaction' TransactionFunctionRole: Description: The name of the Lambda function role for the Transaction model Value: !Ref TransactionFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-Transaction' WalletBalanceFunction: Description: The name of the Lambda function for the WalletBalance model Value: !Ref WalletBalanceFunction Export: Name: !Sub '${AWS::StackName}-functions-WalletBalance' WalletBalanceFunctionRole: Description: The name of the Lambda function role for the WalletBalance model Value: !Ref WalletBalanceFunctionRole Export: Name: !Sub '${AWS::StackName}-roles-WalletBalance'