Skip to content

Commit

Permalink
Merge pull request #62 from astronomer/fix_tfdeprications
Browse files Browse the repository at this point in the history
fix resource deprecations
  • Loading branch information
pgvishnuram authored Jul 28, 2022
2 parents a6088d3 + 89e87f9 commit 1b0a00e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions bastion.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ resource "aws_key_pair" "bastion_ssh_key" {
public_key = tls_private_key.ssh_key[0].public_key_openssh
}

resource "local_file" "bastion_ssh_key_private" {
count = var.enable_bastion ? 1 : 0
filename = pathexpand(format("~/.ssh/%s_bastion_ssh_key", var.deployment_id))
sensitive_content = tls_private_key.ssh_key[0].private_key_pem
resource "local_sensitive_file" "bastion_ssh_key_private" {
count = var.enable_bastion ? 1 : 0
filename = pathexpand(format("~/.ssh/%s_bastion_ssh_key", var.deployment_id))
content = tls_private_key.ssh_key[0].private_key_pem

# make correct permissions on file
# make correct permissions on file
provisioner "local-exec" {
command = "chmod 400 ${local_file.bastion_ssh_key_private[0].filename}"
command = "chmod 400 ${local_sensitive_file.bastion_ssh_key_private[0].filename}"
}
}

Expand Down
1 change: 0 additions & 1 deletion certificate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ resource "tls_private_key" "cert_private_key" {
}

resource "tls_cert_request" "req" {
key_algorithm = "RSA"
private_key_pem = tls_private_key.cert_private_key.private_key_pem
dns_names = ["*.${var.deployment_id}.${var.route53_domain}"]

Expand Down
4 changes: 2 additions & 2 deletions examples/from_scratch/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module "astronomer_aws_with_vpc" {
}
}

resource "local_file" "kubeconfig" {
resource "local_sensitive_file" "kubeconfig" {
depends_on = [module.astronomer_aws_with_vpc]
content = module.astronomer_aws_with_vpc.kubeconfig
filename = "${path.root}/kubeconfig-${var.deployment_id}"
Expand All @@ -29,7 +29,7 @@ resource "local_file" "kubeconfig" {
terraform {
required_providers {
acme = {
source = "terraform-providers/acme"
source = "vancluever/acme"
}
}
required_version = ">= 0.13"
Expand Down

0 comments on commit 1b0a00e

Please sign in to comment.