-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
786 additions
and
0 deletions.
There are no files selected for viewing
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,71 @@ | ||
provider "aws" { | ||
region = "us-east-1" | ||
} | ||
|
||
resource "aws_kms_key" "this" { | ||
customer_master_key_spec = "ECC_NIST_P256" | ||
deletion_window_in_days = 7 | ||
key_usage = "SIGN_VERIFY" | ||
policy = jsonencode({ | ||
Statement = [ | ||
{ | ||
Action = [ | ||
"kms:DescribeKey", | ||
"kms:GetPublicKey", | ||
"kms:Sign", | ||
], | ||
Effect = "Allow" | ||
Principal = { | ||
Service = "dnssec-route53.amazonaws.com" | ||
} | ||
Sid = "Allow Route 53 DNSSEC Service", | ||
Resource = "*" | ||
}, | ||
{ | ||
Action = "kms:CreateGrant", | ||
Effect = "Allow" | ||
Principal = { | ||
Service = "dnssec-route53.amazonaws.com" | ||
} | ||
Sid = "Allow Route 53 DNSSEC Service to CreateGrant", | ||
Resource = "*" | ||
Condition = { | ||
Bool = { | ||
"kms:GrantIsForAWSResource" = "true" | ||
} | ||
} | ||
}, | ||
{ | ||
Action = "kms:*" | ||
Effect = "Allow" | ||
Principal = { | ||
AWS = "*" | ||
} | ||
Resource = "*" | ||
Sid = "IAM User Permissions" | ||
}, | ||
] | ||
Version = "2012-10-17" | ||
}) | ||
|
||
tags = var.tags | ||
} | ||
|
||
resource "aws_route53_zone" "this" { | ||
name = var.domain_name | ||
|
||
tags = var.tags | ||
} | ||
|
||
resource "aws_route53_key_signing_key" "this" { | ||
hosted_zone_id = aws_route53_zone.this.id | ||
key_management_service_arn = aws_kms_key.this.arn | ||
name = "key" | ||
} | ||
|
||
resource "aws_route53_hosted_zone_dnssec" "this" { | ||
depends_on = [ | ||
aws_route53_key_signing_key.this | ||
] | ||
hosted_zone_id = aws_route53_key_signing_key.this.hosted_zone_id | ||
} |
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 @@ | ||
output "zone_id" { | ||
value = aws_route53_zone.this.zone_id | ||
} | ||
|
||
output "name_servers" { | ||
value = aws_route53_zone.this.name_servers | ||
} |
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,8 @@ | ||
module github.com/ManagedKube/kubernetes-ops | ||
|
||
go 1.15 | ||
|
||
require ( | ||
github.com/gruntwork-io/terratest v0.32.24 | ||
github.com/stretchr/testify v1.7.0 | ||
) |
Oops, something went wrong.