Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

FormidableLabs/terraform-aws-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-platform — Formidable, We build the modern web

Maintenance Status

Purpose

This module is designed to output the AWS account ID, partition and region. In addition, it converts AWS region names into a shortened name. The shortened region name is created using a regex that matches the first part, the abbreviated ordinal direction and the numeric identifier. Examples of the region_short output are below.

AWS Region Name Shortened Name
ap-southeast-1 apse1
eu-central-1 euc1
us-east-1 use1

Note: this conversion does not currently work for regions that contain four parts, like the us-gov-east-1 regions.

Example Usage

locals {
  account_id   = module.platform.account_id
  partition    = module.platform.partition
  region       = module.platform.region
  region_short = module.platform.region_short
}

module "platform" {
  source = "github.com/FormidableLabs/terraform-aws-platform?ref=v0.1"
}

resource "aws_lambda_function" "test_lambda" {
  filename      = "lambda_function_payload.zip"
  function_name = "${local.region_short}-lambda_function_name"
  handler       = "index.test"
  ...

}

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_caller_identity.this data source
aws_partition.this data source
aws_region.this data source

Inputs

No inputs.

Outputs

Name Description
account_id Outputs
partition n/a
region n/a
region_short n/a

Maintenance Status

Active: Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.

About

Common AWS Platform Utility module

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published