Skip to content

Commit 915183d

Browse files
authored
chore: add managed policy to cfn template (#2012)
1 parent b8f29f9 commit 915183d

1 file changed

Lines changed: 72 additions & 5 deletions

File tree

cfn/CI.yaml

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ Resources:
5959
KeyType: "HASH"
6060
- AttributeName: "sort_key"
6161
KeyType: "RANGE"
62-
ProvisionedThroughput:
63-
ReadCapacityUnits: "5"
64-
WriteCapacityUnits: "5"
6562
TableName: !Ref TableName
6663

6764
# These tables were manually created but not used in CI
@@ -88,7 +85,26 @@ Resources:
8885
AttributeType: "S"
8986
- AttributeName: "aws_dbe_b_stateAndHasSensitiveData"
9087
AttributeType: "S"
88+
- AttributeName: "aws_dbe_b_address"
89+
AttributeType: "S"
90+
- AttributeName: "aws_dbe_b_birthday"
91+
AttributeType: "S"
92+
- AttributeName: "aws_dbe_b_buildingAndFloor"
93+
AttributeType: "S"
94+
- AttributeName: "aws_dbe_b_email"
95+
AttributeType: "S"
96+
- AttributeName: "aws_dbe_b_stateAndHasTestResult"
97+
AttributeType: "S"
9198
GlobalSecondaryIndexes:
99+
- IndexName: "stateAndHasTestResult-index"
100+
KeySchema:
101+
- AttributeName: "aws_dbe_b_stateAndHasTestResult"
102+
KeyType: "HASH"
103+
Projection:
104+
ProjectionType: ALL
105+
ProvisionedThroughput:
106+
ReadCapacityUnits: "5"
107+
WriteCapacityUnits: "5"
92108
- IndexName: "state-zip-index"
93109
KeySchema:
94110
- AttributeName: "aws_dbe_b_state"
@@ -118,6 +134,37 @@ Resources:
118134
ProvisionedThroughput:
119135
ReadCapacityUnits: "5"
120136
WriteCapacityUnits: "5"
137+
- IndexName: "buildingAndFloor-index"
138+
KeySchema:
139+
- AttributeName: "aws_dbe_b_buildingAndFloor"
140+
KeyType: "HASH"
141+
Projection:
142+
ProjectionType: ALL
143+
ProvisionedThroughput:
144+
ReadCapacityUnits: "5"
145+
WriteCapacityUnits: "5"
146+
- IndexName: "email-birthday-index"
147+
KeySchema:
148+
- AttributeName: "aws_dbe_b_email"
149+
KeyType: "HASH"
150+
- AttributeName: "aws_dbe_b_birthday"
151+
KeyType: "RANGE"
152+
Projection:
153+
ProjectionType: ALL
154+
ProvisionedThroughput:
155+
ReadCapacityUnits: "5"
156+
WriteCapacityUnits: "5"
157+
- IndexName: "address-birthday-index"
158+
KeySchema:
159+
- AttributeName: "aws_dbe_b_address"
160+
KeyType: "HASH"
161+
- AttributeName: "aws_dbe_b_birthday"
162+
KeyType: "RANGE"
163+
Projection:
164+
ProjectionType: ALL
165+
ProvisionedThroughput:
166+
ReadCapacityUnits: "5"
167+
WriteCapacityUnits: "5"
121168
KeySchema:
122169
- AttributeName: "customer_id"
123170
KeyType: "HASH"
@@ -272,6 +319,8 @@ Resources:
272319
- !Sub "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${SearchTestJavaTableName}/index/*"
273320
- !Sub "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${SearchTestDotnetTableName}"
274321
- !Sub "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${SearchTestDotnetTableName}/index/*"
322+
- "arn:aws:dynamodb:us-west-2:370957321024:table/v2MostRecentKeyProviderPerfTestKeys"
323+
- "arn:aws:dynamodb:us-west-2:370957321024:table/v2MostRecentKeyProviderPerfTestKeys/index/*"
275324

276325
KMSUsage:
277326
Type: "AWS::IAM::ManagedPolicy"
@@ -324,18 +373,35 @@ Resources:
324373
- !Sub "arn:aws:kms:eu-west-1:658956600833:key/*"
325374
- !Sub "arn:aws:kms:eu-west-1:658956600833:alias/*"
326375

376+
PerformanceBenchmarksCloudWatchUsage:
377+
Type: "AWS::IAM::ManagedPolicy"
378+
Properties:
379+
Description: "Allow CloudWatch Logs operations for performance benchmarks"
380+
ManagedPolicyName: !Sub "DBESDK-Performance-Benchmarks-CloudWatch-${AWS::Region}"
381+
PolicyDocument:
382+
Version: "2012-10-17"
383+
Statement:
384+
- Effect: Allow
385+
Action:
386+
- logs:CreateLogGroup
387+
- logs:CreateLogStream
388+
- logs:PutLogEvents
389+
- logs:DescribeLogStreams
390+
Resource: !Sub "arn:aws:logs:*:*:log-group:aws-dbesdk-performance-benchmarks:*"
391+
327392
GitHubCIRole:
328393
Type: "AWS::IAM::Role"
329394
Properties:
330395
RoleName: !Sub "GitHub-CI-${ProjectName}-Role-${AWS::Region}"
331-
Description: "Access DDB, KMS, & CA Resources for CI from GitHub"
396+
Description: "Access DDB, KMS, and CA Resources for CI from GitHub"
332397
ManagedPolicyArns:
333398
- Fn::ImportValue: "Polymorph-CA-GitHubCAReadPolicyArn"
334399
- "arn:aws:iam::370957321024:policy/ESDK-Dafny-DDB-ReadWriteDelete-us-west-2"
335400
- "arn:aws:iam::370957321024:policy/Hierarchical-GitHub-KMS-Key-Policy"
336401
- "arn:aws:iam::370957321024:policy/Github-ECDH-KMS"
337402
- !Ref KMSUsage
338403
- !Ref DDBUsage
404+
- !Ref PerformanceBenchmarksCloudWatchUsage
339405
AssumeRolePolicyDocument: !Sub |
340406
{
341407
"Version": "2012-10-17",
@@ -351,7 +417,8 @@ Resources:
351417
"StringLike": {
352418
"token.actions.githubusercontent.com:sub": [
353419
"repo:aws/aws-database-encryption-sdk-dynamodb:*",
354-
"repo:aws/private-aws-database-encryption-sdk-dynamodb-java-staging:*"
420+
"repo:aws/private-aws-database-encryption-sdk-dynamodb-java-staging:*",
421+
"repo:aws/aws-cryptographic-material-providers-library:*"
355422
]
356423
}
357424
}

0 commit comments

Comments
 (0)