Skip to content

Commit

Permalink
feat(iam): can configure 'deny' for policy statements (#3165)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander Knape authored and rix0rrr committed Jul 3, 2019
1 parent 4667b60 commit 6679e86
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-iam/lib/policy-statement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class PolicyStatement {
private condition: { [key: string]: any } = { };

constructor(props: PolicyStatementProps = {}) {
this.effect = Effect.ALLOW;
this.effect = props.effect || Effect.ALLOW;

this.addActions(...props.actions || []);
this.addPrincipals(...props.principals || []);
Expand Down Expand Up @@ -249,6 +249,13 @@ export interface PolicyStatementProps {
* @default - no condition
*/
readonly conditions?: {[key: string]: any};

/**
* Whether to allow or deny the actions in this statement
*
* @default - allow
*/
readonly effect?: Effect;
}

function noUndef(x: any): any {
Expand Down

0 comments on commit 6679e86

Please sign in to comment.