-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New IAM_policies to prevent users causing huge costs
New IAM_policies to prevent users causing huge costs; created changelog.md
- Loading branch information
Showing
8 changed files
with
165 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
resource "aws_iam_policy" "deny_expensive_ec2_instances" { | ||
name = "${var.create_ec2_limit_policy_name}" | ||
count = "${var.create_ec2_limit_policy}" | ||
description = "Policy to limit creation of expensive EC2 Instances" | ||
|
||
policy = <<EOF | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "DenyLargeEC2", | ||
"Effect": "Deny", | ||
"Action": "ec2:RunInstances", | ||
"Resource": "*", | ||
"Condition": { | ||
"StringLike": { | ||
"ec2:InstanceType": [ | ||
"${var.create_ec2_limit_policy_type}" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
resource "aws_iam_policy" "deny_expensive_RDS_instances" { | ||
name = "${var.create_rds_limit_policy_name}" | ||
count = "${var.create_rds_limit_policy}" | ||
description = "Policy to limit creation of expensive RDS Instances" | ||
|
||
policy = <<EOF | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "DenyXlargeRDS", | ||
"Effect": "Deny", | ||
"Action": "rds:CreateDBInstance", | ||
"Resource": "*", | ||
"Condition": { | ||
"StringLike": { | ||
"rds:DatabaseClass": [ | ||
"${var.create_rds_limit_policy_type}" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
resource "aws_iam_policy" "deny_expensive_RI_instances" { | ||
name = "${var.create_reserved_instances_limit_policy_name}" | ||
count = "${var.create_reserved_instances_limit_policy}" | ||
description = "Policy to limit Reserved Instances" | ||
|
||
policy = <<EOF | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Deny", | ||
"Action": ["ec2:ModifyReservedInstances", "ec2:PurchaseReservedInstancesOffering"], | ||
"Resource": "*" | ||
} | ||
] | ||
} | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
resource "aws_iam_policy" "disable_marketplace" { | ||
name = "${var.create_marketplace_disable_policy_name}" | ||
count = "${var.create_marketplace_disable_policy}" | ||
description = "Policy to deny installing software from the marketplace" | ||
|
||
policy = <<EOF | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"aws-marketplace:Subscribe", | ||
"aws-marketplace:Unsubscribe" | ||
], | ||
"Effect": "Deny", | ||
"Resource": "*" | ||
} | ||
] | ||
} | ||
EOF | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## 0.0.5 (Unreleased) | ||
|
||
NEW FEATURES: | ||
|
||
* Added new policies to prevent users causing huge costs | ||
* Created Changelog.md | ||
|
||
|
||
BACKWARDS INCOMPATIBILITIES / NOTES: | ||
|
||
* n.a. | ||
|
||
|
||
IMPROVEMENTS: | ||
|
||
* formatted tf-files | ||
|
||
|
||
BUG FIXES: | ||
|
||
* n.a. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
provider "aws" { | ||
region = "${var.aws_region}" | ||
region = "${var.aws_region}" | ||
version = "~> 1.6" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters