-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(aws-iam): grants support non-identity principals #1623
Merged
Merged
Changes from 34 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
19ad316
Introduce Role -> IIdentity -> IPrincipal
be0ec5d
feat(aws-iam): grants support non-identity principals
fcce210
Forgot to add new file
f3c7827
Merge remote-tracking branch 'origin/master' into huijbers/iam-refactor
rix0rrr d53d794
Undo move of principals to their own file
rix0rrr a445780
Change grants API
rix0rrr a43bf24
Make key interface work with jsii
rix0rrr 2a75620
Splat in the consumer
rix0rrr dd03daf
Merge remote-tracking branch 'origin/master' into huijbers/iam-refactor
rix0rrr 09cffbd
Can't have the same function in 2 interfaces in C#
rix0rrr 295d698
Merge remote-tracking branch 'origin/master' into huijbers/iam-refactor
rix0rrr 554816d
Respect the refactoring
rix0rrr cf68f7d
Add awslint rule to force grant() methods to use helpers
rix0rrr df46221
WIP
rix0rrr 8428937
Update API
rix0rrr 81de979
Update ECS expectations
rix0rrr 0d4ac85
Merge remote-tracking branch 'origin/master' into huijbers/iam-refactor
28945ee
Make statics also return a Grant
c7391f4
Review comments
rix0rrr 53f103b
Merge branch 'huijbers/iam-refactor' of github.com:awslabs/aws-cdk in…
rix0rrr 2006891
Review comments
rix0rrr 3323f08
Merge remote-tracking branch 'origin/master' into huijbers/iam-refactor
rix0rrr b195ac3
IRole implementing both IConstruct and IIdentity leads to a C# build …
rix0rrr 49f996e
Fix unused import
rix0rrr a65d805
awslint should also find indirect interface extensions
rix0rrr f2eab4e
Merge remote-tracking branch 'origin/master' into huijbers/iam-refactor
rix0rrr 77865f5
Fixes
rix0rrr 0192f0f
Merge remote-tracking branch 'origin/master' into huijbers/iam-refactor
rix0rrr c9349f6
Make it build
rix0rrr 929c6fb
Fix failing tests
rix0rrr 753eb84
Make principal in grant methods nonoptional
rix0rrr c2ca705
Adding IGrantable (WIP)
rix0rrr e53474b
Adding IGrantable (WIP)
rix0rrr 1b707b1
Merge branch 'huijbers/iam-refactor' of github.com:awslabs/aws-cdk in…
74bbf35
Finish introduction of IGrantable, rename Grant.withResource -> Grant…
rix0rrr 71964e7
Rename grant methods to be more explicit
rix0rrr 361a92e
Remove dynamodb global
rix0rrr 3772ba4
Update IParameter
rix0rrr 0d24421
Fix stray unrenamed call
rix0rrr b51c76d
Make sure JSON.stringify(principal) doesn't recurse indefinitely
rix0rrr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/Users/huijbers/Workspaces/PublicCDK/aws-cdk/tools/cdk-build-tools/config/nycrc |
98 changes: 98 additions & 0 deletions
98
packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.d.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import dynamodb = require("@aws-cdk/aws-dynamodb"); | ||
import cdk = require("@aws-cdk/cdk"); | ||
import { LambdaGlobalDynamoDBMaker } from "./lambda-global-dynamodb"; | ||
import { MultiDynamoDBStack } from "./multi-dynamodb-stack"; | ||
/** | ||
* NOTE: These props should match dynamodb.TableProps exactly | ||
* EXCEPT for tableName is now required (for global tables to work, the | ||
* table name must match across regions) | ||
rix0rrr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
export interface GlobalDynamoDBProps { | ||
/** | ||
* Partition key attribute definition. | ||
*/ | ||
partitionKey: dynamodb.Attribute; | ||
/** | ||
* Table sort key attribute definition. | ||
* | ||
* @default no sort key | ||
*/ | ||
sortKey?: dynamodb.Attribute; | ||
/** | ||
* The read capacity for the table. Careful if you add Global Secondary Indexes, as | ||
* those will share the table's provisioned throughput. | ||
* | ||
* Can only be provided if billingMode is Provisioned. | ||
* | ||
* @default 5 | ||
*/ | ||
readCapacity?: number; | ||
/** | ||
* The write capacity for the table. Careful if you add Global Secondary Indexes, as | ||
* those will share the table's provisioned throughput. | ||
* | ||
* Can only be provided if billingMode is Provisioned. | ||
* | ||
* @default 5 | ||
*/ | ||
writeCapacity?: number; | ||
/** | ||
* Specify how you are charged for read and write throughput and how you manage capacity. | ||
* @default Provisioned | ||
*/ | ||
billingMode?: dynamodb.BillingMode; | ||
/** | ||
* Enforces a particular physical table name. | ||
* @default <generated> | ||
*/ | ||
tableName: string; | ||
/** | ||
* Whether point-in-time recovery is enabled. | ||
* @default undefined, point-in-time recovery is disabled | ||
*/ | ||
pitrEnabled?: boolean; | ||
/** | ||
* Whether server-side encryption with an AWS managed customer master key is enabled. | ||
* @default undefined, server-side encryption is enabled with an AWS owned customer master key | ||
*/ | ||
sseEnabled?: boolean; | ||
/** | ||
* When an item in the table is modified, StreamViewType determines what information | ||
* is written to the stream for this table. Valid values for StreamViewType are: | ||
* @default dynamodb.StreamViewType.NewAndOldImages, streams must be enabled | ||
*/ | ||
streamSpecification?: dynamodb.StreamViewType; | ||
/** | ||
* The name of TTL attribute. | ||
* @default undefined, TTL is disabled | ||
*/ | ||
ttlAttributeName?: string; | ||
} | ||
/** | ||
* Properties for the mutliple DynamoDB tables to mash together into a | ||
* global table | ||
*/ | ||
export interface DynamoDBGlobalStackProps extends cdk.StackProps { | ||
/** | ||
* Properties for DynamoDB Tables | ||
* All the properties must be exactly the same | ||
* to make the tables mesh together as a global table | ||
*/ | ||
dynamoProps: GlobalDynamoDBProps; | ||
/** | ||
* Array of environments to create DynamoDB tables in | ||
* Accounts should be omitted, or at least all identical | ||
*/ | ||
regions: string[]; | ||
} | ||
export declare class GlobalTable extends cdk.Construct { | ||
/** | ||
* Creates dynamoDB tables across regions that will be able to be globbed together into a global table | ||
*/ | ||
tables: MultiDynamoDBStack[]; | ||
/** | ||
* Creates the cloudformation custom resource that launches a lambda to tie it all together | ||
*/ | ||
lambdaGlobalDynamodbMaker: LambdaGlobalDynamoDBMaker; | ||
constructor(scope: cdk.Construct, id: string, props: DynamoDBGlobalStackProps); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense that we lost these permissions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the user pulling from ECR doesn't need to create logs (they should have never have been part of that grant in the first place).