Closed Dan-Zi closed 1 week ago
@Dan-Zi Thanks for your feedback! We will investigate and update as appropriate.
@Dan-Zi Thanks for bringing this to our attention. I'm going to assign this to the document author so they can take a look at it accordingly.
Thank you for your dedication to our documentation. Unfortunately, at this time we have been unable to review your issue in a timely manner, and we sincerely apologize for the delayed response. The requested updates have not been made since the creation of this issue, and the timeline for resolution may vary based on resourcing, so we've created an internal work item to incorporate your suggestions. We are closing this issue for now, but feel free to comment here as necessary.
Type of issue
Code doesn't work
Feedback
Please fix the following mistakes in the code examples:
Fix/Update the code:
jsondecode
should be removed fromjsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey
inmain.tf
andssh.tf
at Implement the Terraform code section (see Problem 1 below), so that the resulting code would be:azapi_resource_action.ssh_public_key_gen.output.publicKey
-raw
parameter at Verify the results section to generate proper kubeconfig without end of stream "EOF" characters, so that the resulting code would be:echo "$(terraform output -raw kube_config)" > ./azurek8s
(see Problem 2 below)Problem 1
The description and the solution: https://stackoverflow.com/questions/78457405/azapi-resource-action-invalid-value-for-str-parameter-string-required ╷ │ Error: Invalid function argument │ │ on main.tf line 41, in resource "azurerm_kubernetes_cluster" "k8s": │ 41: key_data = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey │ ├──────────────── │ │ while calling jsondecode(str) │ │ azapi_resource_action.ssh_public_key_gen.output is object with 2 attributes │ │ Invalid value for "str" parameter: string required. ╵ ╷ │ Error: Invalid function argument │ │ on ssh.tf line 24, in output "key_data": │ 24: value = jsondecode(azapi_resource_action.ssh_public_key_gen.output).publicKey │ ├──────────────── │ │ while calling jsondecode(str) │ │ azapi_resource_action.ssh_public_key_gen.output is object with 2 attributes │ │ Invalid value for "str" parameter: string required.
Problem 2
(there is a workaround in the main instruction; but it should not be done manually in fact; adding
-raw
parameter solves the problem)Page URL
https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-terraform?tabs=bash
Content source URL
https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/aks/learn/quick-kubernetes-deploy-terraform.md
Author
@schaffererin
Document Id
93009f1b-a279-2a19-5c87-6352d8af10c8
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.