Class Effect
The Effect element of an IAM policy.
Inheritance
System.Object
Effect
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class Effect : Enum
Syntax (vb)
Public NotInheritable Class Effect
Inherits
Enum
Remarks
See: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_effect.html
ExampleMetadata: infused
Examples
Resource books;
User iamUser;
var getBooks = books.AddMethod("GET", new HttpIntegration("http://amazon.com"), new MethodOptions {
AuthorizationType = AuthorizationType.IAM
});
iamUser.AttachInlinePolicy(new Policy(this, "AllowBooks", new PolicyProps {
Statements = new [] {
new PolicyStatement(new PolicyStatementProps {
Actions = new [] { "execute-api:Invoke" },
Effect = Effect.ALLOW,
Resources = new [] { getBooks.MethodArn }
}) }
}));
Synopsis
Fields
ALLOW | Allows access to a resource in an IAM policy statement. |
DENY | Explicitly deny access to a resource. |
value__ |
Fields
ALLOW
Allows access to a resource in an IAM policy statement.
public const Effect ALLOW
Field Value
Type | Description |
---|---|
Effect |
Remarks
By default, access to resources are denied.
DENY
Explicitly deny access to a resource.
public const Effect DENY
Field Value
Type | Description |
---|---|
Effect |
Remarks
By default, all requests are denied implicitly.
See: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |