diff --git a/api-template.yaml b/api-template.yaml index 06062c70..8445f798 100644 --- a/api-template.yaml +++ b/api-template.yaml @@ -21,8 +21,6 @@ Parameters: Type: 'AWS::SSM::Parameter::Value' ArticlePvUserTableName: Type: 'AWS::SSM::Parameter::Value' - ArticleScoreTableName: - Type: 'AWS::SSM::Parameter::Value' UsersTableName: Type: 'AWS::SSM::Parameter::Value' BetaUsersTableName: @@ -76,7 +74,6 @@ Globals: ARTICLE_LIKED_USER_TABLE_NAME: !Ref ArticleLikedUserTableName ARTICLE_FRAUD_USER_TABLE_NAME: !Ref ArticleFraudUserTableName ARTICLE_PV_USER_TABLE_NAME: !Ref ArticlePvUserTableName - ARTICLE_SCORE_TABLE_NAME: !Ref ArticleScoreTableName USERS_TABLE_NAME: !Ref UsersTableName BETA_USERS_TABLE_NAME: !Ref BetaUsersTableName NOTIFICATION_TABLE_NAME: !Ref NotificationTableName diff --git a/database-template.yaml b/database-template.yaml index fb23cc40..56bb2ab1 100644 --- a/database-template.yaml +++ b/database-template.yaml @@ -254,35 +254,6 @@ Resources: ProvisionedThroughput: ReadCapacityUnits: !Ref MinDynamoReadCapacitty WriteCapacityUnits: !Ref MinDynamoWriteCapacitty - ArticleScore: - Type: AWS::DynamoDB::Table - DependsOn: - - ArticleInfo - Properties: - AttributeDefinitions: - - AttributeName: article_id - AttributeType: S - - AttributeName: evaluated_at - AttributeType: N - - AttributeName: score - AttributeType: N - KeySchema: - - AttributeName: evaluated_at - KeyType: HASH - - AttributeName: article_id - KeyType: RANGE - LocalSecondaryIndexes: - - IndexName: evaluated_at-score-index - KeySchema: - - AttributeName: evaluated_at - KeyType: HASH - - AttributeName: score - KeyType: RANGE - Projection: - ProjectionType: ALL - ProvisionedThroughput: - ReadCapacityUnits: !Ref MinDynamoReadCapacitty - WriteCapacityUnits: !Ref MinDynamoWriteCapacitty ArticleTokenAggregation: Type: AWS::DynamoDB::Table DependsOn: @@ -1165,56 +1136,6 @@ Resources: ScaleOutCooldown: 60 PredefinedMetricSpecification: PredefinedMetricType: DynamoDBWriteCapacityUtilization - ArticleScoreTableReadCapacityScalableTarget: - Type: AWS::ApplicationAutoScaling::ScalableTarget - DependsOn: ScalingRole - Properties: - MaxCapacity: !Ref MaxDynamoReadCapacitty - MinCapacity: !Ref MinDynamoReadCapacitty - ResourceId: !Join - - / - - - table - - !Ref ArticleScore - RoleARN: !GetAtt ScalingRole.Arn - ScalableDimension: dynamodb:table:ReadCapacityUnits - ServiceNamespace: dynamodb - ArticleScoreTableWriteCapacityScalableTarget: - Type: 'AWS::ApplicationAutoScaling::ScalableTarget' - DependsOn: ScalingRole - Properties: - MaxCapacity: !Ref MaxDynamoWriteCapacitty - MinCapacity: !Ref MinDynamoWriteCapacitty - ResourceId: !Join - - / - - - table - - !Ref ArticleScore - RoleARN: !GetAtt ScalingRole.Arn - ScalableDimension: dynamodb:table:WriteCapacityUnits - ServiceNamespace: dynamodb - ArticleScoreTableReadScalingPolicy: - Type: 'AWS::ApplicationAutoScaling::ScalingPolicy' - Properties: - PolicyName: ReadAutoScalingPolicy - PolicyType: TargetTrackingScaling - ScalingTargetId: !Ref ArticleScoreTableReadCapacityScalableTarget - TargetTrackingScalingPolicyConfiguration: - TargetValue: 50.0 - ScaleInCooldown: 60 - ScaleOutCooldown: 60 - PredefinedMetricSpecification: - PredefinedMetricType: DynamoDBReadCapacityUtilization - ArticleScoreTableWriteScalingPolicy: - Type: 'AWS::ApplicationAutoScaling::ScalingPolicy' - Properties: - PolicyName: WriteAutoScalingPolicy - PolicyType: TargetTrackingScaling - ScalingTargetId: !Ref ArticleScoreTableWriteCapacityScalableTarget - TargetTrackingScalingPolicyConfiguration: - TargetValue: 50.0 - ScaleInCooldown: 60 - ScaleOutCooldown: 60 - PredefinedMetricSpecification: - PredefinedMetricType: DynamoDBWriteCapacityUtilization ArticleTokenAggregationTableReadCapacityScalableTarget: Type: AWS::ApplicationAutoScaling::ScalableTarget DependsOn: ScalingRole diff --git a/database.yaml b/database.yaml index 1731715e..817d959b 100644 --- a/database.yaml +++ b/database.yaml @@ -226,35 +226,6 @@ Resources: ProvisionedThroughput: ReadCapacityUnits: 2 WriteCapacityUnits: 2 - ArticleScore: - Type: AWS::DynamoDB::Table - DependsOn: - - ArticleInfo - Properties: - AttributeDefinitions: - - AttributeName: article_id - AttributeType: S - - AttributeName: evaluated_at - AttributeType: N - - AttributeName: score - AttributeType: N - KeySchema: - - AttributeName: evaluated_at - KeyType: HASH - - AttributeName: article_id - KeyType: RANGE - LocalSecondaryIndexes: - - IndexName: evaluated_at-score-index - KeySchema: - - AttributeName: evaluated_at - KeyType: HASH - - AttributeName: score - KeyType: RANGE - Projection: - ProjectionType: ALL - ProvisionedThroughput: - ReadCapacityUnits: 2 - WriteCapacityUnits: 2 ArticleTokenAggregation: Type: AWS::DynamoDB::Table DependsOn: diff --git a/deploy.sh b/deploy.sh index 6a52c752..5b44a03c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -40,7 +40,6 @@ aws cloudformation deploy \ ArticleLikedUserTableName=${SSM_PARAMS_PREFIX}ArticleLikedUserTableName \ ArticleFraudUserTableName=${SSM_PARAMS_PREFIX}ArticleFraudUserTableName \ ArticlePvUserTableName=${SSM_PARAMS_PREFIX}ArticlePvUserTableName \ - ArticleScoreTableName=${SSM_PARAMS_PREFIX}ArticleScoreTableName \ UsersTableName=${SSM_PARAMS_PREFIX}UsersTableName \ BetaUsersTableName=${SSM_PARAMS_PREFIX}BetaUsersTableName \ NotificationTableName=${SSM_PARAMS_PREFIX}NotificationTableName \ diff --git a/tests/tests_common/tests_util.py b/tests/tests_common/tests_util.py index 52a65273..aa814362 100644 --- a/tests/tests_common/tests_util.py +++ b/tests/tests_common/tests_util.py @@ -72,7 +72,6 @@ def get_all_tables(cls): {'env_name': 'ARTICLE_EVALUATED_MANAGE_TABLE_NAME', 'table_name': 'ArticleEvaluatedManage'}, {'env_name': 'ARTICLE_INFO_TABLE_NAME', 'table_name': 'ArticleInfo'}, {'env_name': 'ARTICLE_LIKED_USER_TABLE_NAME', 'table_name': 'ArticleLikedUser'}, - {'env_name': 'ARTICLE_SCORE_TABLE_NAME', 'table_name': 'ArticleScore'}, {'env_name': 'ARTICLE_HISTORY_TABLE_NAME', 'table_name': 'ArticleHistory'}, {'env_name': 'ARTICLE_CONTENT_EDIT_TABLE_NAME', 'table_name': 'ArticleContentEdit'}, {'env_name': 'ARTICLE_FRAUD_USER_TABLE_NAME', 'table_name': 'ArticleFraudUser'},