deployment/real-time-web-analytics-with-kinesis-existing-vpc.yaml [849:931]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  MetricTable:
    Type: AWS::DynamoDB::Table
    Properties:
      AttributeDefinitions:
        - AttributeName: MetricType
          AttributeType: S
      KeySchema:
        - AttributeName: MetricType
          KeyType: HASH
      ProvisionedThroughput:
        ReadCapacityUnits: 1
        WriteCapacityUnits: 1
      TableName: !Sub '${AWS::StackName}-Metrics'
    Metadata:
      cfn_nag:
        rules_to_suppress:
          - id: W28
            reason: "explicit name required"

  MetricDetailsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      AttributeDefinitions:
        - AttributeName: MetricType
          AttributeType: S
        - AttributeName: EventTimestamp
          AttributeType: N
      KeySchema:
        - AttributeName: MetricType
          KeyType: HASH
        - AttributeName: EventTimestamp
          KeyType: RANGE
      ProvisionedThroughput:
        ReadCapacityUnits: !FindInMap [DDB, Scaling, ReadCapacityMin]
        WriteCapacityUnits: !FindInMap [DDB, Scaling, ReadCapacityMin]
      TableName: !Sub '${AWS::StackName}-MetricDetails'
      TimeToLiveSpecification:
        AttributeName: ExpireTime
        Enabled: true
    Metadata:
      cfn_nag:
        rules_to_suppress:
          - id: W28
            reason: "explicit name required"

  DDBScalingRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: Allow
            Principal:
              Service:
                - application-autoscaling.amazonaws.com
            Action:
              - sts:AssumeRole
      Path: "/"
      Policies:
        - PolicyName: "root"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:

              # Allows
              - Effect: "Allow"
                Action:
                  - "cloudwatch:PutMetricAlarm"
                  - "cloudwatch:DescribeAlarms"
                  - "cloudwatch:GetMetricStatistics"
                  - "cloudwatch:SetAlarmState"
                  - "cloudwatch:DeleteAlarms"
                Resource: "*"
              - Effect: "Allow"
                Action:
                  - "dynamodb:DescribeTable"
                  - "dynamodb:UpdateTable"
                Resource:
                  - !GetAtt MetricDetailsTable.Arn
    Metadata:
      cfn_nag:
        rules_to_suppress:
          - id: W11
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



deployment/real-time-web-analytics-with-kinesis.yaml [958:1040]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  MetricTable:
    Type: AWS::DynamoDB::Table
    Properties:
      AttributeDefinitions:
        - AttributeName: MetricType
          AttributeType: S
      KeySchema:
        - AttributeName: MetricType
          KeyType: HASH
      ProvisionedThroughput:
        ReadCapacityUnits: 1
        WriteCapacityUnits: 1
      TableName: !Sub '${AWS::StackName}-Metrics'
    Metadata:
      cfn_nag:
        rules_to_suppress:
          - id: W28
            reason: "explicit name required"

  MetricDetailsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      AttributeDefinitions:
        - AttributeName: MetricType
          AttributeType: S
        - AttributeName: EventTimestamp
          AttributeType: N
      KeySchema:
        - AttributeName: MetricType
          KeyType: HASH
        - AttributeName: EventTimestamp
          KeyType: RANGE
      ProvisionedThroughput:
        ReadCapacityUnits: !FindInMap [DDB, Scaling, ReadCapacityMin]
        WriteCapacityUnits: !FindInMap [DDB, Scaling, ReadCapacityMin]
      TableName: !Sub '${AWS::StackName}-MetricDetails'
      TimeToLiveSpecification:
        AttributeName: ExpireTime
        Enabled: true
    Metadata:
      cfn_nag:
        rules_to_suppress:
          - id: W28
            reason: "explicit name required"

  DDBScalingRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: "2012-10-17"
        Statement:
          - Effect: Allow
            Principal:
              Service:
                - application-autoscaling.amazonaws.com
            Action:
              - sts:AssumeRole
      Path: "/"
      Policies:
        - PolicyName: "root"
          PolicyDocument:
            Version: "2012-10-17"
            Statement:

              # Allows
              - Effect: "Allow"
                Action:
                  - "cloudwatch:PutMetricAlarm"
                  - "cloudwatch:DescribeAlarms"
                  - "cloudwatch:GetMetricStatistics"
                  - "cloudwatch:SetAlarmState"
                  - "cloudwatch:DeleteAlarms"
                Resource: "*"
              - Effect: "Allow"
                Action:
                  - "dynamodb:DescribeTable"
                  - "dynamodb:UpdateTable"
                Resource:
                  - !GetAtt MetricDetailsTable.Arn
    Metadata:
      cfn_nag:
        rules_to_suppress:
          - id: W11
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



