Skip to content

v1.8.0: add feature iam-account-settings #14

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@
- ses-domain
- add code to enable mail_from
- change `ses_enable_production` to `enable_production`

* v1.8.0 -- 20210329
- iam-account-settings created
2 changes: 1 addition & 1 deletion common/version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "1.7.5"
_module_version = "1.8.0"
}
1 change: 1 addition & 0 deletions iam-account-setings/data.tf
1 change: 1 addition & 0 deletions iam-account-setings/defaults.tf
46 changes: 46 additions & 0 deletions iam-account-setings/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* # aws-inf-setup :: iam-account-settings
*
* # Usage
* Here is a simple example, the one most commonly expected to be used.
*
* ```hcl
* module "settings" {
* source = "git@github.e.it.census.gov:terraform-modules/aws-inf-setup.git//iam-account-settings"
*
* account_alias = "ma5-gov"
* account_usage = "GovCloud Management Account"
* }
* ```
*/

locals {
account_id = var.account_id != "" ? var.account_id : data.aws_caller_identity.current.account_id
account_environment = data.aws_arn.current.partition == "aws-us-gov" ? "gov" : "ew"
console_url_selector = local.account_environment == "gov" ? "-us-gov" : ""
console_url = format("https://%v.signin.amazonaws%v.com/console", var.account_alias, local.console_url_selector)

base_tags = {
"boc:tf_module_version" = local._module_version
"boc:created_by" = "terraform"
}
}

#---
# IAM account specific configurations
#---
resource "aws_iam_account_alias" "alias" {
account_alias = var.account_alias
}

resource "aws_iam_account_password_policy" "account_settings" {
allow_users_to_change_password = true
hard_expiry = false
max_password_age = 89
minimum_password_length = 14
password_reuse_prevention = 24
require_lowercase_characters = true
require_numbers = true
require_symbols = true
require_uppercase_characters = true
}
4 changes: 4 additions & 0 deletions iam-account-setings/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "console_url" {
description = "AWS Console URL"
value = local.console_url
}
1 change: 1 addition & 0 deletions iam-account-setings/prefixes.tf
1 change: 1 addition & 0 deletions iam-account-setings/variables.common.tf
5 changes: 5 additions & 0 deletions iam-account-setings/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
variable "account_usage" {
description = "AWS Account Usage (what we are using it for)"
type = string
default = ""
}
1 change: 1 addition & 0 deletions iam-account-setings/version.tf