NEW: first commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# terraform.tfvars example
|
||||
```
|
||||
aws_access_key = "..."
|
||||
aws_secret_key = "..."
|
||||
aws_region = "ap-east-1"
|
||||
default-tags = {
|
||||
"owner" = "KF"
|
||||
"terraform" = "initial-deployment-only"
|
||||
"environment" = "demo"
|
||||
"project" = "project1"
|
||||
"application" = "network"
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
resource "random_string" "string" {
|
||||
length = 4
|
||||
special = false
|
||||
}
|
||||
|
||||
resource "random_integer" "number" {
|
||||
min = 1000
|
||||
max = 9999
|
||||
}
|
||||
|
||||
output "string" {
|
||||
value = random_string.string.result
|
||||
}
|
||||
|
||||
output "number" {
|
||||
value = random_integer.number.result
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
name,value
|
||||
owner,KF
|
||||
terraform,initial-deploy-only
|
||||
environment,demo
|
||||
project,project1
|
||||
application,network
|
||||
|
@@ -0,0 +1,12 @@
|
||||
variable "aws_access_key" {}
|
||||
variable "aws_secret_key" {}
|
||||
variable "aws_region" {}
|
||||
|
||||
provider "aws" {
|
||||
access_key = var.aws_access_key
|
||||
secret_key = var.aws_secret_key
|
||||
region = var.aws_region
|
||||
version = ">= 2.28.1"
|
||||
}
|
||||
|
||||
variable "default-tags" {}
|
||||
@@ -0,0 +1,23 @@
|
||||
data "aws_availability_zones" "available" {}
|
||||
|
||||
module "random" {
|
||||
source = "./m.random"
|
||||
}
|
||||
|
||||
module "vpc" {
|
||||
source = "terraform-aws-modules/vpc/aws"
|
||||
version = "2.6.0"
|
||||
|
||||
name = "demo-vpc-${module.random.number}"
|
||||
cidr = "172.16.0.0/16"
|
||||
azs = data.aws_availability_zones.available.names
|
||||
private_subnets = cidrsubnets("172.16.18.0/23", 1, 1)
|
||||
public_subnets = cidrsubnets("172.16.20.0/23", 1, 1)
|
||||
enable_nat_gateway = false
|
||||
single_nat_gateway = true
|
||||
enable_dns_hostnames = true
|
||||
|
||||
tags = var.default-tags
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user