Skip to content

Commit

Permalink
init new module
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Feb 4, 2026
0 parents commit 0c92f76
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Versions

* v1.0.0 -- {{ yyyy-mm-dd }}
- initial creation

Empty file added README.md
Empty file.
25 changes: 25 additions & 0 deletions availabilty_zones.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
data "aws_availability_zones" "zones" {
state = "available"
}

data "aws_availability_zone" "zone" {
for_each = toset(data.aws_availability_zones.zones.names)
state = "available"
name = each.key
}


output "availability_zone_names" {
description = "VPC Availability zone name list"
value = data.aws_availability_zones.zones.names
}

output "availability_zone_ids" {
description = "VPC Availability zone id list"
value = data.aws_availability_zones.zones.zone_ids
}

output "availability_zone_suffixes" {
description = "VPC Availability zone suffix list"
value = [for k, v in data.aws_availability_zone.zone : v.name_suffix]
}
7 changes: 7 additions & 0 deletions data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "aws_caller_identity" "current" {}

data "aws_arn" "current" {
arn = data.aws_caller_identity.current.arn
}

data "aws_region" "current" {}
3 changes: 3 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Examples

Create directories with specific examples and describe how to use the module in a variety of ways.
9 changes: 9 additions & 0 deletions locals.tf.initial
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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"

base_tags = {
"boc:tf_module_version" = local._module_version
"boc:created_by" = "terraform"
}
}
28 changes: 28 additions & 0 deletions prefixes.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
locals {
_prefixes = {
"efs" = "v-efs-"
"s3" = "v-s3-"
"ebs" = "v-ebs-"
"kms" = "k-kms-"
"role" = "r-"
"policy" = "p-"
"group" = "g-"
"security-group" = "" # "sg-"
# VPC
"vpc" = ""
"dhcp-options" = ""
"vpc-peer" = "vpcp-"
"route-table" = "route-"
"subnet" = ""
"vpc-endpoint" = "vpce-"
"elastic-ip" = "eip-"
"nat-gateway" = "nat-"
"internet-gateway" = "igw-"
"network-acl" = "nacl-"
"customer-gateway" = "cgw-"
"vpn-gateway" = "vpcg-"
"vpn-connection" = "vpn_"
"log-group" = "lg-"
"log-stream" = "lgs-"
}
}
5 changes: 5 additions & 0 deletions variables.common.availability_zones.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
variable "availability_zones" {
description = "AWS Availability Zones to use (by default will use all available)"
type = list(string)
default = []
}
26 changes: 26 additions & 0 deletions variables.common.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#---
# account info
#---
variable "account_id" {
description = "AWS Account ID (default will pull from current user)"
type = string
default = ""
}

variable "account_alias" {
description = "AWS Account Alias"
type = string
default = ""
}

variable "override_prefixes" {
description = "Override built-in prefixes by component. This should be used primarily for common infrastructure things"
type = map(string)
default = {}
}

variable "tags" {
description = "AWS Tags to apply to appropriate resources"
type = map(string)
default = {}
}
3 changes: 3 additions & 0 deletions version.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
locals {
_module_version = "0.0.0"
}
9 changes: 9 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.66.0"
}
}
# required_version = ">= 0.13"
}

0 comments on commit 0c92f76

Please sign in to comment.