File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
lib/plugins/aws/custom-resources/resources/api-gateway-cloud-watch-role Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ /**
4+ * IMPORTANT: This file is cached, so when you test changes made to this file,
5+ * make sure you delete the .serverless directory, and un-memoize the packaging code.
6+ * For more info search for the "utils/ensure-artifact.js" file in the codebase.
7+ */
8+
39const { wait, MAX_AWS_REQUEST_TRY } = require ( '../utils' ) ;
410const { getEnvironment, handlerWrapper } = require ( '../utils' ) ;
511const {
@@ -52,7 +58,10 @@ async function create(event, context) {
5258 return ( await iam . send ( new ListAttachedRolePoliciesCommand ( { RoleName : roleName } ) ) )
5359 . AttachedPolicies ;
5460 } catch ( error ) {
55- if ( error . code === 'NoSuchEntity' ) {
61+ if (
62+ error . code === 'NoSuchEntity' ||
63+ error . message . includes ( 'cannot be found' )
64+ ) {
5665 // Role doesn't exist yet, create;
5766 await iam . send (
5867 new CreateRoleCommand ( {
You can’t perform that action at this time.
0 commit comments