Last active
October 27, 2019 15:55
-
-
Save mgjam/a673824061e5d53acb470b0f33921f18 to your computer and use it in GitHub Desktop.
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
private createApi(): appsync.CfnGraphQLApi { | |
const name = 'Api'; | |
const cloudWatchLogsRoleArn = this.createApiCloudWatchRole().roleArn | |
return new appsync.CfnGraphQLApi(this, name, { | |
name: name, | |
authenticationType: 'AWS_IAM', | |
logConfig: { | |
fieldLogLevel: 'ERROR', | |
cloudWatchLogsRoleArn: cloudWatchLogsRoleArn | |
} | |
}); | |
} | |
private createApiCloudWatchRole(): iam.Role { | |
const name = 'ApiCloudWatchRole'; | |
return new iam.Role(this, name, { | |
roleName: name, | |
assumedBy: new iam.ServicePrincipal('appsync.amazonaws.com'), | |
managedPolicies: [iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSAppSyncPushToCloudWatchLogs')] | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment