Skip to content

Commit 6679e86

Browse files
Sander Knaperix0rrr
authored andcommitted
feat(iam): can configure 'deny' for policy statements (#3165)
1 parent 4667b60 commit 6679e86

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/@aws-cdk/aws-iam/lib/policy-statement.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class PolicyStatement {
1919
private condition: { [key: string]: any } = { };
2020

2121
constructor(props: PolicyStatementProps = {}) {
22-
this.effect = Effect.ALLOW;
22+
this.effect = props.effect || Effect.ALLOW;
2323

2424
this.addActions(...props.actions || []);
2525
this.addPrincipals(...props.principals || []);
@@ -249,6 +249,13 @@ export interface PolicyStatementProps {
249249
* @default - no condition
250250
*/
251251
readonly conditions?: {[key: string]: any};
252+
253+
/**
254+
* Whether to allow or deny the actions in this statement
255+
*
256+
* @default - allow
257+
*/
258+
readonly effect?: Effect;
252259
}
253260

254261
function noUndef(x: any): any {

0 commit comments

Comments
 (0)