Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 21, 2022
1 parent 399a3dd commit 26dc142
Show file tree
Hide file tree
Showing 11 changed files with 1,725 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "aws-lambda-ddns-function"]
path = aws-lambda-ddns-function
url = https://github.com/aws-samples/aws-lambda-ddns-function
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Versions

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

1,661 changes: 1,661 additions & 0 deletions code/ddns-lambda.py

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions dynamodb.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
locals {
dynamodb_table = var.dynamodb_table != null ? var.dynamodb_table : local.name
}

resource "aws_dynamodb_table" "table" {
name = local.dynamodb_table
hash_key = "InstanceId"
billing_mode = "PROVISIONED"
read_capacity = 4
write_capacity = 4

attribute {
name = "InstanceId"
type = "S"
}

server_side_encryption {
enabled = true
}

tags = merge(
local.base_tags,
var.tags,
lookup(var.component_tags, "ddb", {}),
map("Name", local.dynamodb_table),
)

lifecycle {
ignore_changes = [tags["boc:tf_module_version"]]
}

}
4 changes: 4 additions & 0 deletions examples/test/test.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module "dynamic-route53" {
source = "git@github.e.it.census.gov:terraform-modules/aws-dynamic-route53.git?ref=initial"

}
3 changes: 3 additions & 0 deletions locals.tf.initial → locals.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
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"
region = data.aws_region.current.name

base_tags = {
"boc:tf_module_version" = local._module_version
"boc:created_by" = "terraform"
}

name = format("%v-%v",var.name,local.region)
}
6 changes: 6 additions & 0 deletions variables.common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ variable "tags" {
type = map(string)
default = {}
}

variable "component_tags" {
description = "Additional tags for Components (s3, kms, ddb)"
type = map(map(string))
default = { "s3" = {}, "kms" = {}, "ddb" = {} }
}
14 changes: 14 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variable "name" {
description = "Name to use within all the created resources (default: inf-dynamic-route53)"
type = string
default = "inf-dynamic-route53"
}


variable "dynamodb_table" {
description = "Different DynamoDB table to override default of var.name)
type = string
default = null
}
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "0.0.0"
_module_version = "1.0.0"
}

0 comments on commit 26dc142

Please sign in to comment.