Skip to content

Instantly share code, notes, and snippets.

@schosterbarak
Created November 22, 2021 16:22
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 schosterbarak/c6c3738ceff6b065acc36a2025cfea3a to your computer and use it in GitHub Desktop.
Save schosterbarak/c6c3738ceff6b065acc36a2025cfea3a to your computer and use it in GitHub Desktop.
AWSTemplateFormatVersion: 2010-09-09
Description: IAM policy
Resources:
ExamplePolicy:
Type: 'AWS::IAM::Policy'
Properties:
PolicyName: root
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- "iam:PassRole"
- "lambda:CreateFunction"
- "lambda:CreateEventSourceMapping"
- "dynamodb:CreateTable"
- "dynamodb:PutItem"
Resource: '*'
provider:
name: aws
runtime: nodejs10.x
resources:
Resources:
ExamplePolicy:
Type: 'AWS::IAM::Policy'
Properties:
PolicyName: root
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- "iam:PassRole"
- "lambda:CreateFunction"
- "lambda:CreateEventSourceMapping"
- "dynamodb:CreateTable"
- "dynamodb:PutItem"
Resource: '*'
data "aws_iam_policy_document" "example" {
statement {
sid = "1"
effect = "Allow"
actions = [
"iam:PassRole",
"lambda:CreateFunction",
"lambda:CreateEventSourceMapping",
"dynamodb:CreateTable",
"dynamodb:PutItem",
]
resources = [
"*",
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment