Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
platform/packet: Fix missing AWS provider on upgrade
Browse files Browse the repository at this point in the history
In #422 the AWS provider was removed from the root Terraform module.
This breaks upgrades from versions which don't include #422.
  • Loading branch information
johananl committed Jun 2, 2020
1 parent 5f73c24 commit e3ff664
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
7 changes: 0 additions & 7 deletions assets/lokomotive-kubernetes/dns/route53/main.tf
Original file line number Diff line number Diff line change
@@ -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}."
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/assets/generated_assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions pkg/platform/packet/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}
Expand Down

0 comments on commit e3ff664

Please sign in to comment.