diff --git a/assets/lokomotive-kubernetes/dns/route53/main.tf b/assets/lokomotive-kubernetes/dns/route53/main.tf index 3db98a726..dd98ca3f9 100644 --- a/assets/lokomotive-kubernetes/dns/route53/main.tf +++ b/assets/lokomotive-kubernetes/dns/route53/main.tf @@ -1,10 +1,3 @@ -provider "aws" { - # The Route 53 service doesn't need a specific region to operate, however - # the AWS Terraform provider needs it and the documentation suggests to use - # "us-east-1": https://docs.aws.amazon.com/general/latest/gr/r53.html. - region = "us-east-1" -} - data "aws_route53_zone" "selected" { name = "${var.dns_zone}." } diff --git a/pkg/assets/generated_assets.go b/pkg/assets/generated_assets.go index fcf3ed0b9..9c1e682a5 100644 --- a/pkg/assets/generated_assets.go +++ b/pkg/assets/generated_assets.go @@ -4391,9 +4391,9 @@ var vfsgenAssets = func() http.FileSystem { "/lokomotive-kubernetes/dns/route53/main.tf": &vfsgen۰CompressedFileInfo{ name: "main.tf", modTime: time.Date(1970, 1, 1, 0, 0, 1, 0, time.UTC), - uncompressedSize: 1133, + uncompressedSize: 863, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x92\xc1\x6a\xdc\x30\x10\x86\xef\x7e\x8a\x41\x6d\x68\x02\x59\x39\x65\xbb\x97\xc0\x1e\xf2\x0a\x6d\xa0\x87\x10\xcc\x54\x9a\xd8\x02\x59\x32\x33\x63\x6f\x9b\xb0\xef\x5e\x64\x7b\x4b\x5a\x68\x68\x69\xe8\x51\x66\xe6\x9b\xef\xff\xf1\xc0\x79\x0a\x9e\x18\x0c\x1e\xc4\xc0\x53\x05\xf0\x06\x6e\x3b\x82\x8f\x79\x54\x82\xdd\x16\x84\x78\x0a\x8e\xc0\x67\x92\xf4\x4e\x21\x11\x79\x40\x90\x81\x5c\x78\x08\x0e\x98\xda\x90\x13\x68\x86\x3c\x10\xa3\xd2\x25\x74\xf9\x40\x13\xf1\xcc\xd2\x8e\xe0\xe6\xf3\x27\xb8\x25\x66\x7c\xc8\xdc\xc3\x8f\x93\x85\x24\x10\x14\x30\xf9\x79\xce\x67\x37\xf6\x94\x14\xb5\x10\x65\x6c\x5b\x12\x95\x82\x1e\x85\x66\x9a\x19\x65\x43\x28\xba\x79\x6f\xae\xa1\x53\x1d\xe4\xba\xae\x7d\x76\x62\xf1\x20\x16\x7b\x7c\xcc\xc9\xba\xdc\xd7\x2d\x25\x62\x8c\x75\x44\x25\xd1\xba\xe5\x9a\x77\x5b\xdb\x69\x1f\x6d\x05\x27\xe7\xfd\x73\x5e\x75\xac\x2a\x8f\x8a\x73\x13\x0d\x97\xf8\xbb\x6d\xf3\x98\x13\x19\x30\x42\x91\x9c\x92\x5f\x1a\x4a\xd8\x53\x59\x7e\xfb\x34\x21\x5b\x9f\x64\x1e\x3b\xda\x99\xc1\x24\x79\x64\x47\x3f\x73\x98\x5c\x66\x6f\xc0\xe0\x10\x4a\xa3\xc4\xcd\x30\x7e\x89\xc1\x2d\xc4\xb2\xdf\x04\x0f\x7b\x28\x0a\xf6\x57\x03\x7b\xba\x6f\xd7\xc1\x93\x04\x00\xec\xa1\xb4\x8a\x7a\x6e\xce\xc4\x9e\x89\x35\x97\x50\xac\x5c\x1c\x45\x89\x9b\x32\xb6\x7c\x39\x79\x5e\x54\x00\xfa\x6d\x58\x97\xcd\x8d\x29\x6f\x8d\xb0\xbc\xb7\x57\x57\x73\x41\x45\x57\x60\xbf\xb0\x72\x52\xce\x31\x12\xcb\x6a\xdd\x84\x61\xfa\xf0\x77\x69\x39\x4c\xa8\xf4\xaa\x71\x37\x2b\xf4\x7f\xc4\x5e\x2e\xfd\x69\x6e\x52\xb7\xfe\x2b\x2e\x8f\x49\x61\x0f\x91\x52\xab\xdd\xf9\x4b\xdc\x8b\xea\x15\xab\x29\x06\x67\xfe\xb7\xcd\xcc\x5a\x36\x24\x4f\x5f\xff\xa5\xa6\xbb\x97\xf2\xdc\x3d\x3b\x72\x7f\x5f\x1d\xab\xef\x01\x00\x00\xff\xff\x50\x09\x63\xe5\x6d\x04\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x92\xdf\x4a\x33\x31\x10\xc5\xef\xf3\x14\xc3\xf0\x15\x5a\xf8\x0c\x85\xea\xe5\x5e\xf8\x1c\xa5\x84\x98\x8c\x1a\x48\x93\x65\x32\xbb\xfe\x29\x7d\x77\x49\xb3\x0b\x2a\x58\x14\x8b\x97\x13\x66\xce\xf9\x9d\x43\xbc\x15\x0b\x68\x9f\x8a\xe1\x3c\x08\xdd\x6c\xcc\x6b\x4e\x84\x80\x85\x22\x39\x21\x8f\x70\x50\x00\xc9\xee\x09\x3a\xc0\x7f\x87\xd1\xb2\xf6\xa9\x9c\xd6\x8e\x1a\xd5\x51\x29\xa6\x92\x07\x76\xf4\x51\x87\xc9\x65\xf6\x08\x68\xfb\x50\x88\x47\x62\xd3\x0f\x77\x31\xb8\xa6\x58\xef\x4d\xf0\xd0\x41\x45\xd0\x9f\x09\xf4\xec\xaf\xa7\xc5\x19\x02\x00\x3a\xb8\xcf\xbc\xb7\xb2\xc4\x45\xd1\x8b\xa2\xf1\x3f\x54\x2a\x17\x87\x22\xc4\xa6\xae\xb5\x97\x99\x73\xa5\x00\xe4\xa5\x9f\x8e\xf1\x16\xeb\x2c\x11\xda\xbc\x59\xaf\x15\x40\xc3\x2d\xd0\x35\xad\x9c\x84\x73\x8c\xc4\x65\xa2\x36\xa1\x1f\xaf\x7f\x96\x96\xc3\x68\x85\x2e\x1a\xf7\x6a\x12\xfd\x8b\xd8\xcd\xe9\xbb\xb9\x49\xdc\xf4\x57\x5c\x1e\x92\x40\x07\x91\xd2\x83\x3c\x2e\xcf\xe9\xae\xd4\x05\xab\xa9\x04\x0b\xff\x65\x33\x27\x2c\x1d\x92\xa7\xe7\xdf\xd4\xb4\x3d\x97\x67\xfb\xce\x64\xb7\x53\x47\xf5\x16\x00\x00\xff\xff\xe7\x66\xe2\x5a\x5f\x03\x00\x00"), }, "/lokomotive-kubernetes/dns/route53/require.tf": &vfsgen۰FileInfo{ name: "require.tf", diff --git a/pkg/platform/packet/template.go b/pkg/platform/packet/template.go index a225abed5..e3e6d572b 100644 --- a/pkg/platform/packet/template.go +++ b/pkg/platform/packet/template.go @@ -207,6 +207,12 @@ module "worker-{{ $pool.Name }}" { module "dns" { source = "../lokomotive-kubernetes/dns/{{.Config.DNS.Provider}}" + {{ if eq .Config.DNS.Provider "route53" -}} + providers = { + aws = aws.default + } + + {{ end -}} cluster_name = "{{ .Config.ClusterName }}" controllers_public_ipv4 = module.packet-{{.Config.ClusterName}}.controllers_public_ipv4 controllers_private_ipv4 = module.packet-{{.Config.ClusterName}}.controllers_private_ipv4 @@ -220,6 +226,17 @@ output "dns_entries" { } {{- end }} +{{- if eq .Config.DNS.Provider "route53" }} +provider "aws" { + version = "2.48.0" + alias = "default" + # The Route 53 service doesn't need a specific region to operate, however + # the AWS Terraform provider needs it and the documentation suggests to use + # "us-east-1": https://docs.aws.amazon.com/general/latest/gr/r53.html. + region = "us-east-1" +} +{{- end }} + provider "ct" { version = "~> 0.3" }