Skip to content

Commit

Permalink
feat: added api policy in example
Browse files Browse the repository at this point in the history
  • Loading branch information
mamrajyadav committed May 19, 2023
1 parent e43db98 commit 546fe75
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions _example/complete/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,29 @@ EOF
# Api Gateway Api Key
key_count = 2
key_names = ["test", "test1"]

## Api Policy

api_policy = data.aws_iam_policy_document.test.json

}

data "aws_iam_policy_document" "test" {
statement {
effect = "Allow"

principals {
type = "AWS"
identifiers = ["*"]
}

actions = ["execute-api:Invoke"]
resources = [module.api-gateway.execution_arn]

condition {
test = "IpAddress"
variable = "aws:SourceIp"
values = ["123.123.123.123/32"]
}
}
}

0 comments on commit 546fe75

Please sign in to comment.