-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for remote-store feature in OpenSearch (#38)
Signed-off-by: Rishabh Singh <sngri@amazon.com>
- Loading branch information
1 parent
7e7d6cf
commit d1adf6d
Showing
6 changed files
with
219 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { RemovalPolicy, Stack } from 'aws-cdk-lib'; | ||
import { Bucket } from 'aws-cdk-lib/aws-s3'; | ||
import { Effect, Policy, PolicyStatement } from 'aws-cdk-lib/aws-iam'; | ||
|
||
export class RemoteStoreResources { | ||
private readonly snapshotS3Bucket: Bucket | ||
|
||
private readonly bucketPolicyStatement: PolicyStatement | ||
|
||
constructor(scope: Stack) { | ||
this.snapshotS3Bucket = new Bucket(scope, `remote-store-${scope.stackName}`, { | ||
removalPolicy: RemovalPolicy.DESTROY, | ||
autoDeleteObjects: true, | ||
bucketName: `${scope.stackName}`, | ||
}); | ||
|
||
this.bucketPolicyStatement = new PolicyStatement({ | ||
effect: Effect.ALLOW, | ||
actions: [ | ||
's3:ListBucket', | ||
's3:GetBucketLocation', | ||
's3:ListBucketMultipartUploads', | ||
's3:ListBucketVersions', | ||
's3:GetObject', | ||
's3:PutObject', | ||
's3:DeleteObject', | ||
's3:AbortMultipartUpload', | ||
's3:ListMultipartUploadParts', | ||
], | ||
resources: [this.snapshotS3Bucket.bucketArn, `${this.snapshotS3Bucket.bucketArn}/*`], | ||
}); | ||
} | ||
|
||
public getRemoteStoreBucketPolicy() { | ||
return this.bucketPolicyStatement; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters