Skip to content

Commit

Permalink
feat(10): Add account-setup module.
Browse files Browse the repository at this point in the history
  • Loading branch information
flagscript committed Nov 6, 2023
1 parent 2c35d21 commit d7f0183
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/account-setup/iam.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "aws_iam_account_password_policy" "password_policy" {
allow_users_to_change_password = true
hard_expiry = false
max_password_age = 90
minimum_password_length = 14
password_reuse_prevention = 24
require_lowercase_characters = true
require_numbers = true
require_symbols = true
require_uppercase_characters = true
}

resource "aws_iam_account_alias" "alias" {
account_alias = var.name
}
12 changes: 12 additions & 0 deletions modules/account-setup/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
locals {
common_tags = {
"flagscript:account-owner:owner" = var.client_id
"flagscript:automation:environment" = "root"
"flagscript:cost-allocation:application-id" = var.application_id
"flagscript:cost-allocation:owner" = var.client_id
"flagscript:data-owner:owner" = var.client_id
"flagscript:operations:owner" = var.org_owner
"github:module:repository" = "flagscript/terraform-aws-flagscript-organization"
"terraform:module" = "terraform-aws-flagscript-organization//account-setup"
}
}
6 changes: 6 additions & 0 deletions modules/account-setup/s3.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "aws_s3_account_public_access_block" "account_s3_public_access_block" {
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
24 changes: 24 additions & 0 deletions modules/account-setup/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# REQUIRED PARAMETERS
# These parameters must be supplied when consuming this module.
variable "application_id" {
description = "Application Id"
type = string
}

variable "client_id" {
description = "The id for the client."
type = string
}

variable "name" {
description = "The name for the aws account."
type = string
}

# OPTIONAL PARAMETERS
# These parameters have reasonable defaults.
variable "org_owner" {
default = "flagscript"
description = "Owner moniker for the flagscript organization."
type = string
}
10 changes: 10 additions & 0 deletions modules/account-setup/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# names required TF version
terraform {
required_version = ">= 1.6"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}

0 comments on commit d7f0183

Please sign in to comment.