# Effect

The Effect element of an IAM policy.

- Source: [`aws-iam/lib/policy-statement.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-iam/lib/policy-statement.ts#L729)

## Example

```ts
declare const books: apigateway.Resource;
declare const iamUser: iam.User;

const getBooks = books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
  authorizationType: apigateway.AuthorizationType.IAM
});

iamUser.attachInlinePolicy(new iam.Policy(this, 'AllowBooks', {
  statements: [
    new iam.PolicyStatement({
      actions: [ 'execute-api:Invoke' ],
      effect: iam.Effect.ALLOW,
      resources: [ getBooks.methodArn ]
    })
  ]
}))
```

## Members

| Member | Description |
| --- | --- |
| `ALLOW` | Allows access to a resource in an IAM policy statement. |
| `DENY` | Explicitly deny access to a resource. |

## Referenced by

- [`PolicyStatement`](/v2/docs/aws-cdk-lib.aws_iam.PolicyStatement).effect
- [`PolicyStatementProps`](/v2/docs/aws-cdk-lib.aws_iam.PolicyStatementProps).effect
