Skip to content

Instantly share code, notes, and snippets.

@shantanuo
Created April 27, 2021 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shantanuo/dd7a6aae5bb7211cf827380c0de61808 to your computer and use it in GitHub Desktop.
Save shantanuo/dd7a6aae5bb7211cf827380c0de61808 to your computer and use it in GitHub Desktop.
S3 bucket for ES snapshots
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