Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use managedpolicies and slice them, fixes: #2703 #2883

Merged
merged 1 commit into from
Nov 30, 2019
Merged

fix: use managedpolicies and slice them, fixes: #2703 #2883

merged 1 commit into from
Nov 30, 2019

Conversation

attilah
Copy link
Contributor

@attilah attilah commented Nov 30, 2019

Issue #, if available:

fixed: #2703

Description of changes:

Use managed policies instead of policies for GraphQL API policy generation for auth and unauth roles. Also take into account the policy size and create multiple policies of needed. This means that 6144 bytes long can be 1 policy and 10 Managed Policies can be attached to a single role and that 10 can be raised to 20 by AWS Support, which raises the maximum policy size to ~120kb, which is 10 times the currently supported size.

This PR does not solve the policy size issue for API Gateway (#2084), but since sizes are adding up, perhaps customers can be unblocked by this change.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@lgtm-com
Copy link

lgtm-com bot commented Nov 30, 2019

This pull request fixes 2 alerts when merging 2db05b3 into 4a97971 - view on LGTM.com

fixed alerts:

  • 2 for Unused variable, import, function or class

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@4a97971). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2883   +/-   ##
=========================================
  Coverage          ?   59.82%           
=========================================
  Files             ?      217           
  Lines             ?    11048           
  Branches          ?     2139           
=========================================
  Hits              ?     6609           
  Misses            ?     4141           
  Partials          ?      298
Impacted Files Coverage Δ
packages/graphql-auth-transformer/src/resources.ts 88.84% <100%> (ø)
...aphql-auth-transformer/src/ModelAuthTransformer.ts 87.16% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a97971...2db05b3. Read the comment docs.

// 6144 bytes is the maximum policy payload size, but there is structural overhead, hence the 6000 bytes
const MAX_BUILT_SIZE_BYTES = 6000;
// The overhead is the amount of static policy arn contents like region, accountid, etc.
const RESOURCE_OVERHEAD = 90;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add the math how we came up with the size

@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IAM policy size exceeded
3 participants