Skip to content

Commit

Permalink
feat: add the possibility to restrict service user to specific zones
Browse files Browse the repository at this point in the history
  • Loading branch information
toabi committed Jun 29, 2020
1 parent 582dd88 commit 884bcaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ data "aws_iam_policy_document" "external_dns" {

actions = [
"route53:ChangeResourceRecordSets",
"route53:ListTagsForResource"
]

resources = [
"arn:aws:route53:::hostedzone/*",
]
resources = [ for id in var.policy_allowed_zone_ids: "arn:aws:route53:::hostedzone/${id}"]

effect = "Allow"
}
Expand All @@ -33,6 +30,7 @@ data "aws_iam_policy_document" "external_dns" {
actions = [
"route53:ListHostedZones",
"route53:ListResourceRecordSets",
"route53:ListTagsForResource",
]

resources = [
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ variable "cluster_name" {}
variable "cluster_identity_oidc_issuer" {}
variable "cluster_identity_oidc_issuer_arn" {}

variable "policy_allowed_zone_ids" {
type = list(string)
default = ["*"]
}

# external-dns
variable "enabled" {
type = bool
Expand Down

0 comments on commit 884bcaa

Please sign in to comment.