Skip to content

Commit

Permalink
Exempt from deny creating expensive ec2 (#1200)
Browse files Browse the repository at this point in the history
* Allow creating g4dn.12xlarge instances

* Exempt from deny creating expensive ec2

* Make ec2_exempted_accounts optional
  • Loading branch information
aleksandra-fromm authored Nov 15, 2023
1 parent e2be940 commit b60bee2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions security/org-policies/preventive.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ data "aws_iam_policy_document" "preventive" {
"*.metal",
]
}

condition {
test = "StringNotLike"
variable = "aws:PrincipalArn"
values = var.ec2_exempted_accounts
}
}

statement {
Expand Down
5 changes: 5 additions & 0 deletions security/org-policies/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ variable "reservation_policy_attach_targets" {
variable "resource_owner_tag_value" {
type = string
}

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

0 comments on commit b60bee2

Please sign in to comment.