Created
October 27, 2019 16:44
-
-
Save mgjam/d305f80b3458c304f72f1137dbfbb5cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private createApiAccessGroup( | |
api: appsync.CfnGraphQLApi | |
): iam.Group { | |
const name = 'ApiAccessGroup'; | |
const group = new iam.Group(this, name, { | |
groupName: name | |
}); | |
group.attachInlinePolicy(this.createApiAccessPolicy(api)); | |
return group; | |
} | |
private createApiAccessPolicy( | |
api: appsync.CfnGraphQLApi | |
): iam.Policy { | |
const name = 'ApiAccessPolicy'; | |
return new iam.Policy(this, name, { | |
policyName: name, | |
statements: [new iam.PolicyStatement({ | |
effect: iam.Effect.ALLOW, | |
actions: [ 'appsync:GraphQL' ], | |
resources: [ api.attrArn + '/*' ] | |
})] | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment