Skip to content

Instantly share code, notes, and snippets.

@leantorres73
Created January 14, 2021 15:39
Show Gist options
  • Save leantorres73/21b3eca501b2f993b50f8e4f8561bf45 to your computer and use it in GitHub Desktop.
Save leantorres73/21b3eca501b2f993b50f8e4f8561bf45 to your computer and use it in GitHub Desktop.
api policy receiver lambda
const roleapigatewaysocketapi = new iam.Role(this, "roleapigatewaysocketapi", {
assumedBy: new iam.ServicePrincipal("apigateway.amazonaws.com")
});
// access role for the socket api to access the socket lambda
const policy = new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
resources: [lambdaAPIsocket.functionArn],
actions: ["lambda:InvokeFunction"]
});
roleapigatewaysocketapi.addToPolicy(policy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment