Skip to content

Commit

Permalink
feat(amplify-cli-core): allow * in account and region in arn for cust…
Browse files Browse the repository at this point in the history
…om policies (aws-amplify#8722)
  • Loading branch information
ammarkarachi authored and akshbhu committed Nov 10, 2021
1 parent 911185b commit 9683797
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/amplify-cli-core/src/customPoliciesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ function validateCustomPolicies(data: CustomIAMPolicies, categoryName: string, r
for (const customPolicy of data) {
const resources = customPolicy.Resource;
const actions = customPolicy.Action;
const resourceRegex = new RegExp('arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)');
const resourceRegex = new RegExp(
'arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:(([a-z]{2}|\\*)(-gov)?-[a-z-*]+-(\\d{1}|\\*)|\\*)?:(\\d{12}|\\*)?:(.*)',
);
const actionRegex = new RegExp('[a-zA-Z0-9]+:[a-z|A-Z|0-9|*]+');
const wrongResourcesRegex = [];
const wrongActionsRegex = [];
Expand Down

0 comments on commit 9683797

Please sign in to comment.