Lab : Resource Dependancies Q6

hi

While doing lab on resource dependencies on Q6 once we run terraform plan we get following warning . Although there is not issue we can still move forward but based on the course taught so fat till this point I was not able to understand why I get this warning and what is the learning from this in simple words .

Can you please explain this in simple wording for a Terrafrom Beginner ?


Warning: Interpolation-only expressions are deprecated

  on key.tf line 3, in resource "local_file" "key_details":
   3:     content = "${tls_private_key.pvtkey.private_key_pem}"

Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.

Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.

The detailed output on my working is as below

iac-server $ 
iac-server $ terrafrom init
bash: terrafrom: command not found
iac-server $ 
iac-server $ terraform init

Initializing the backend...

Initializing provider plugins...
- Using previously-installed hashicorp/tls v3.1.0
- Finding latest version of hashicorp/local...
- Installing hashicorp/local v2.1.0...
- Installed hashicorp/local v2.1.0 (signed by HashiCorp)

The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.

* hashicorp/local: version = "~> 2.1.0"
* hashicorp/tls: version = "~> 3.1.0"


Warning: Interpolation-only expressions are deprecated

  on key.tf line 3, in resource "local_file" "key_details":
   3:     content = "${tls_private_key.pvtkey.private_key_pem}"

Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.

Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
iac-server $ 
iac-server $ 
iac-server $ 
iac-server $ terraform apply
tls_private_key.pvtkey: Refreshing state... [id=5f816cf50d1795b923ddf2832d07c1af32b4a367]

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # local_file.key_details will be created
  + resource "local_file" "key_details" {
      + content              = <<~EOT
            -----BEGIN RSA PRIVATE KEY-----
            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
            -----END RSA PRIVATE KEY-----
        EOT
      + directory_permission = "0777"
      + file_permission      = "0777"
      + filename             = "/root/key.txt"
      + id                   = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.


Warning: Interpolation-only expressions are deprecated

  on key.tf line 3, in resource "local_file" "key_details":
   3:     content = "${tls_private_key.pvtkey.private_key_pem}"

Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.

Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

local_file.key_details: Creating...
local_file.key_details: Creation complete after 0s [id=aac13c8f62e291ef125ff29b25807073a05a2b5d]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
iac-server $ 
iac-server $ 
iac-server $ cat /root/key.txt 
-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEAtpnHua3yPZq8+SL1MSPl5S28zAj7kxxdTKoO3QY6GavthiTs
ZH2q16hK/vZGreZu2tNJCWXNkmUf/2aVS48At3zl4WVgPVrsG1Vh9sBeSavnMd+z
ft+XjrDuEEbXLEGO12utJl7oLCvP6pCsNvAhhs9qncimP7jzeJ7NJqC9/B5uv4QX
99g0Hhu8/woMD3DEjp9c+uniqp51a9xRq3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pQtMZv/sLne7aTfv
hAKrECi0+2tcsoMTwDFAeomhZ71cE0aJUTG0zauo6rw66UWHeF+KJrZsQGSOEJz/
NCU6oQKCAQEA1vcVdgrcDEC2qtehSSVXLswniB3VqYRc4GHmjt8oMF+kWaAbxId6
wkXHMD5UycwvL+lhr9LQncJgoethIqE0NX7Ac1t3epERVX7zBZ67HZEPpzk5xYiz
K+T1EXTgocxcxpudrgFX0As4y8otgIrmT9PGkRK4R17HITqvYXV/hN6xALWz1Za2
isMD0xI4ozLbQOnCJy33LiEpGFEXd1Ddbii4rVM9Lfh0KcOc4xzMvXXrJl6eMEYc
W4Ie4WyDDf3IU6AzhWjRp3vGLh/SZ4qMAtFYydiM7rw0TT5Cz74yLtSJurmroXWP
4vzYXbp897BRrJ4lkV1Timsntecgq0Dh2QKCAQBAnTQR7bVHhKWzOZkfc6autxqg
htfTJYfPfoqYufqpoqBzB79N7c7yzg4Ds6PQxh3kj8EZO4d4gPBOJsDA20u1ADOv
W2NvtBxzFddatlTxJwGwy0+qVQd6qRynqdR+sd3NQ0zWowDSDkAeN9Ca19dUcMPg
AAvxBN2du2lsc9a9zibzuFFDPam1k4nLo+NAgHfnGBF6Nmut6yUBErtzaDGWLdSx
Nfmpe2Sm6zJlBNAmv3jSUjkX1F1kDn0lFaYLT9HJP4VVGF8MHUJQzKeG5MD68C/+
UgWuTR/OQv2VPoBzdfG0QIJpOFcfzDUWxbH9d+995yfiICnkHVrwtyyToW9c
-----END RSA PRIVATE KEY-----
iac-server $ 
iac-server $ 
iac-server $ pwd
/root/terraform-projects/key-generator
iac-server $ 
iac-server $ ls -al
total 36
drwxr-xr-x 3 root root 4096 Feb 26 10:04 .
drwxr-xr-x 4 root root 4096 Feb 26 09:46 ..
drwxr-xr-x 3 root root 4096 Feb 26 09:51 .terraform
-rw-r--r-- 1 root root  212 Feb 26 10:00 key.tf
-rw-r--r-- 1 root root 9673 Feb 26 10:04 terraform.tfstate
-rw-r--r-- 1 root root 5667 Feb 26 10:04 terraform.tfstate.backup
iac-server $ 
iac-server $ cat key.tf  
resource "local_file" "key_details"{
    filename = "/root/key.txt"
    content = "${tls_private_key.pvtkey.private_key_pem}"
}
resource "tls_private_key" "pvtkey"{
    algorithm = "RSA"
    rsa_bits = "4096"
}

iac-server $ 
iac-server $ history
    1  pwd
    2  cd terraform-projects/key-generator/
    3  ls -al
    4  clear
    5  pwd
    6  ls -al
    7  vi key.tf
    8  cat key.tf 
    9  clear
   10  terrafrom init
   11  terraform init
   12  terrafrom plan
   13  clear
   14  terrafrom plan
   15  terraform plan
   16  terraform apply
   17  terraform show
   18  pwd
   19  ls -al
   20  cat key.tf 
   21  vi key.tf 
   22  clear
   23  terrafrom init
   24  terraform init
   25  terraform apply
   26  cat /root/key.txt 
   27  pwd
   28  ls -al
   29  cat key.tf 
   30  history
iac-server $ 
iac-server $ terrafrom show
bash: terrafrom: command not found
iac-server $ 
iac-server $ terraform show
# local_file.key_details:
resource "local_file" "key_details" {
    content              = <<~EOT
        -----BEGIN RSA PRIVATE KEY-----
        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
        -----END RSA PRIVATE KEY-----
    EOT
    directory_permission = "0777"
    file_permission      = "0777"
    filename             = "/root/key.txt"
    id                   = "aac13c8f62e291ef125ff29b25807073a05a2b5d"
}

# tls_private_key.pvtkey:
resource "tls_private_key" "pvtkey" {
    algorithm                  = "RSA"
    ecdsa_curve                = "P224"
    id                         = "5f816cf50d1795b923ddf2832d07c1af32b4a367"
    private_key_pem            = (sensitive value)
    public_key_fingerprint_md5 = "df:c9:58:cd:85:88:3b:24:da:7b:29:9e:0a:9c:0d:34"
    public_key_openssh         = <<~EOT
        ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC2mce5rfI9mrz5IvUxI+XlLbzMCPuTHF1Mqg7dBjoZq+2GJOxkfarXqEr+9kat5m7a00kJZc2SZR//ZpVLjwC3fOXhZWA9WuwbVWH2wF5Jq+cx37N+35eOsO4QRtcsQY7Xa60mXugsK8/qkKw28CGGz2qdyKY/uPN4ns0moL38Hm6/hBf32DQeG7z/CgwPcMSOn1z66eKqnnVr3FGrcN2cATjo5Uq+Qluy2jaJUucZK0qijvbTVuCQ2kei9HN80nrYMwAoaoQ9CIJ3jC7Q5mcFb2Rdh8fA7CeMAynSBasbAwUjdI55Xvtw4ftX0Lo/ETOeyPi2JA0p1WPyuozsMU1q3ZM7cpiZjGnlTEN8nkoBzvwzhg+dGygJevaqZ20xNI/hP4XWmK+IXPFwCW7yeKGrShFjuRyvytFlGnvizsYYw4cWCwvM+/xvSGkZVngiOs3sMUi5X6c65RrxVwtsvBRQQAW7jFiAh5adWvxJ/gt7Kkh/l71WkMYWuAAJ1tW8mAj4PVrubT93AGAynpoEbEmIhes8QHHG+aZ6Ks3CuObR6EOoB/bTML8MJTi+emNIBq7LP3+5jiypyFpYZ07CoCJtycmOF70Ml2xZxYZMNXyIqB2Qerevii3jKc/fpT7EalnnZiSAIstgCnd7yT+1inAeIW90I6mfHw5qr4TbfZfh/Q==
    EOT
    public_key_pem             = <<~EOT
        -----BEGIN PUBLIC KEY-----
        MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtpnHua3yPZq8+SL1MSPl
        5S28zAj7kxxdTKoO3QY6GavthiTsZH2q16hK/vZGreZu2tNJCWXNkmUf/2aVS48A
        t3zl4WVgPVrsG1Vh9sBeSavnMd+zft+XjrDuEEbXLEGO12utJl7oLCvP6pCsNvAh
        hs9qncimP7jzeJ7NJqC9/B5uv4QX99g0Hhu8/woMD3DEjp9c+uniqp51a9xRq3Dd
        nAE46OVKvkJbsto2iVLnGStKoo7201bgkNpHovRzfNJ62DMAKGqEPQiCd4wu0OZn
        BW9kXYfHwOwnjAMp0gWrGwMFI3SOeV77cOH7V9C6PxEznsj4tiQNKdVj8rqM7DFN
        at2TO3KYmYxp5UxDfJ5KAc78M4YPnRsoCXr2qmdtMTSP4T+F1piviFzxcAlu8nih
        q0oRY7kcr8rRZRp74s7GGMOHFgsLzPv8b0hpGVZ4IjrN7DFIuV+nOuUa8VcLbLwU
        UEAFu4xYgIeWnVr8Sf4LeypIf5e9VpDGFrgACdbVvJgI+D1a7m0/dwBgMp6aBGxJ
        iIXrPEBxxvmmeirNwrjm0ehDqAf20zC/DCU4vnpjSAauyz9/uY4sqchaWGdOwqAi
        bcnJjhe9DJdsWcWGTDV8iKgdkHq3r4ot4ynP36U+xGpZ52YkgCLLYAp3e8k/tYpw
        HiFvdCOpnx8Oaq+E232X4f0CAwEAAQ==
        -----END PUBLIC KEY-----
    EOT
    rsa_bits                   = 4096
}
iac-server $ 

Hi @ppnehe, when you have a value formed only by expressions and not concatenated with a string, you don’t need to use interpolations anymore. Ex.:

content = "${tls_private_key.pvtkey.private_key_pem}"

This now can be used like this: tls_private_key.pvtkey.private_key_pem

But, let’s suppose you need to add some string, like, for example, a path to the key:

content = "/path/to/the/key/${tls_private_key.pvtkey.private_key_pem}"

Since you would be using a string joined with the expression, you would have to use interpolation.

Regards,
Vitor Jr.
KodeKloud Support