Enum Effect
The Effect element of an IAM policy.
public enum Effect
Fields
ALLOW = 0
Allows access to a resource in an IAM policy statement.
DENY = 1
Explicitly deny access to a resource.
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 }
}) }
}));
Remarks
See: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_effect.html
ExampleMetadata: infused