Error Inappropriate value for attribute content string required

0 votes

Hi Guys,

I am trying to create one SSH key using terraform, but it is showing me the below error.

Error: Incorrect attribute value type
  on task1.tf line 13, in resource "local_file" "mypvkey":
  13:     content         =  tls_private_key.task1_key
    |----------------
    | tls_private_key.task1_key is object with 8 attributes
Inappropriate value for attribute "content": string required.
Jun 15, 2020 in Terraform by MD
• 95,160 points
655 views

1 answer to this question.

0 votes

Hi@MD,

You have to pass in which format you want your private key. There are two types of format available one is .ppk and another one is .pem.  If you want in .ppk format then set content=tls_private_key.task1_key.private_key_ppk or if you want in .pem format then  pass content=tls_private_key.task1_key.private_key_pem.

answered Jun 15, 2020 by akhtar
• 38,170 points

Related Questions In Terraform

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,064 views
+2 votes
1 answer
0 votes
1 answer

How to set an IAM policy for a project in GCP using Terraform?

Hi@akhtar, You can create a policy and give ...READ MORE

answered Sep 13, 2020 in Terraform by akhtar
• 38,170 points
203 views