Created
April 27, 2021 00:27
-
-
Save shantanuo/dd7a6aae5bb7211cf827380c0de61808 to your computer and use it in GitHub Desktop.
S3 bucket for ES snapshots
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'Infrastructure for setting up ES snapshots' | |
Resources: | |
EsSnapshotBucket: | |
Type: AWS::S3::Bucket | |
EsSnapshotRole: | |
Type: AWS::IAM::Role | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: "Allow" | |
Principal: | |
Service: | |
- "es.amazonaws.com" | |
Action: | |
- "sts:AssumeRole" | |
Policies: | |
- PolicyName: "es-snapshot-pol1" | |
PolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: Allow | |
Action: "s3:ListBucket" | |
Resource: !GetAtt EsSnapshotBucket.Arn | |
- PolicyName: "es-snapshot-pol2" | |
PolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: Allow | |
Action: | |
- "s3:GetObject" | |
- "s3:PutObject" | |
- "s3:DeleteObject" | |
- "iam:PassRole" | |
Resource: !Sub | |
- '${bucket}/*' | |
- bucket: !GetAtt EsSnapshotBucket.Arn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment