Skip to content

Instantly share code, notes, and snippets.

@nukopy
Created November 13, 2020 02:39
Show Gist options
  • Save nukopy/b8dd0930d07e2fcf7094ea34856478d2 to your computer and use it in GitHub Desktop.
Save nukopy/b8dd0930d07e2fcf7094ea34856478d2 to your computer and use it in GitHub Desktop.
CFn template
Resources:
# IAM Policy
PolicyLambdaBasicExecution:
Type: AWS::IAM::ManagedPolicy
Properties:
ManagedPolicyName: !Sub "${Prefix}-policy-lambda-basic-execution"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: "*"
Users:
- !Ref IAMUser
# Roles:
# - 本当はここにロールを置きたいけど,ロールが作成されていないので渋々 IAM ユーザy.okuwaki@jxpress.net を指定している
# IAM Role
RoleLambdaEntryPoint:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub "${Prefix}-role-lambda-entry-point"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- !Ref PolicyLambdaBasicExecution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment