generated from dxw/terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial variables, locals and provider
* Adds the project name, infrastructure name and environment variables to be used to create a resource prefix * Adds the aws region variable, to determine which region the resources will be created * Adds default tags * Adds the AWS provider
- Loading branch information
Showing
6 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,13 @@ | ||
locals { | ||
project_name = var.project_name | ||
infrastructure_name = var.infrastructure_name | ||
environment = var.environment | ||
aws_region = var.aws_region | ||
resource_prefix = "${var.project_name}-${var.infrastructure_name}-${var.environment}" | ||
|
||
default_tags = { | ||
Project = local.project_name, | ||
Infrastructure = local.infrastructure_name, | ||
Environment = local.environment, | ||
} | ||
} |
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,7 @@ | ||
provider "aws" { | ||
region = local.aws_region | ||
|
||
default_tags { | ||
tags = local.default_tags | ||
} | ||
} |
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,19 @@ | ||
variable "project_name" { | ||
description = "Project name to be used as a prefix for all resources" | ||
type = string | ||
} | ||
|
||
variable "infrastructure_name" { | ||
description = "The infrastructure name to be used as part of the resource prefix" | ||
type = string | ||
} | ||
|
||
variable "environment" { | ||
description = "The environment name to be used as part of the resource prefix" | ||
type = string | ||
} | ||
|
||
variable "aws_region" { | ||
description = "AWS region in which to launch resources" | ||
type = string | ||
} |
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,5 +1,9 @@ | ||
terraform { | ||
required_version = ">= 1.6.2" | ||
required_version = ">= 1.6.3" | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 5.24.0" | ||
} | ||
} | ||
} |