forked from arielkru/badCode
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDynamoDB_Secondary_Index.yaml
More file actions
64 lines (64 loc) · 2.01 KB
/
DynamoDB_Secondary_Index.yaml
File metadata and controls
64 lines (64 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
License: Apache-2.0
Description: 'AWS CloudFormation Sample Template DynamoDB_Secondary_Indexes: Create
a DynamoDB table with local and global secondary indexes. **WARNING** This template
creates an Amazon DynamoDB table. You will be billed for the AWS resources used
if you create a stack from this template.'
Parameters:
ReadCapacityUnits:
Description: Provisioned read throughput
Type: Number
Default: '5'
MinValue: '5'
MaxValue: '10000'
ConstraintDescription: must be between 5 and 10000
WriteCapacityUnits:
Description: Provisioned write throughput
Type: Number
Default: '10'
MinValue: '5'
MaxValue: '10000'
ConstraintDescription: must be between 5 and 10000
Resources:
TableOfBooks:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
- AttributeName: Title
AttributeType: S
- AttributeName: Category
AttributeType: S
- AttributeName: Language
AttributeType: S
KeySchema:
- AttributeName: Category
KeyType: HASH
- AttributeName: Title
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: !Ref 'ReadCapacityUnits'
WriteCapacityUnits: !Ref 'WriteCapacityUnits'
LocalSecondaryIndexes:
- IndexName: LanguageIndex
KeySchema:
- AttributeName: Category
KeyType: HASH
- AttributeName: Language
KeyType: RANGE
Projection:
ProjectionType: KEYS_ONLY
GlobalSecondaryIndexes:
- IndexName: TitleIndex
KeySchema:
- AttributeName: Title
KeyType: HASH
Projection:
ProjectionType: KEYS_ONLY
ProvisionedThroughput:
ReadCapacityUnits: !Ref 'ReadCapacityUnits'
WriteCapacityUnits: !Ref 'WriteCapacityUnits'
Outputs:
TableName:
Value: !Ref 'TableOfBooks'
Description: Name of the newly created DynamoDB table