Terraform-ai
ซึ่งขับเคลื่อนโดย OpenAI ChatGPT ช่วยลดความยุ่งยากในการใช้ไฟล์ Terraform HCL ด้วยการมอบผู้ช่วยที่ชาญฉลาดและโต้ตอบได้
terraform-ai
ต้องใช้คีย์ OpenAI API หรือคีย์ Azure OpenAI Service API และจุดสิ้นสุด
สำหรับทั้ง OpenAI และ Azure OpenAI คุณสามารถใช้ตัวแปรสภาพแวดล้อมต่อไปนี้:
export OPENAI_API_KEY= < your OpenAI key >
export OPENAI_DEPLOYMENT_NAME= < your OpenAI deployment/model name. defaults to " gpt-3.5-turbo " >
รองรับรุ่นต่อไปนี้:
code-davinci-002
text-davinci-003
gpt-3.5-turbo-0301
(การปรับใช้ต้องตั้งชื่อgpt-35-turbo-0301
สำหรับ Azure)gpt-3.5-turbo
gpt-35-turbo-0301
gpt-4-0314
gpt-4-32k-0314
สำหรับ Azure OpenAI Service คุณสามารถใช้ตัวแปรสภาพแวดล้อมต่อไปนี้:
export AZURE_OPENAI_ENDPOINT= < your Azure OpenAI endpoint, like " https://my-aoi-endpoint.openai.azure.com " >
หากมีการตั้งค่าตัวแปร AZURE_OPENAI_ENDPOINT
ตัวแปรนั้นจะใช้บริการ Azure OpenAI มิฉะนั้นจะใช้ OpenAI API
เพิ่มเพื่อ brew
และติดตั้งด้วย:
brew tap hubs-ai/terraform-ai https://github.com/hubs-ai/terraform-ai
brew install terraform-ai
--require-confirmation
flag หรือตัวแปรสภาพแวดล้อม REQUIRE_CONFIRMATION
สามารถตั้งค่าเพื่อให้ผู้ใช้ยืนยันก่อนที่จะใช้รายการ ค่าเริ่มต้นเป็นจริง
--temperature
ตั้งค่าสถานะอุณหภูมิหรือตัวแปรสภาพแวดล้อม TEMPERATURE
สามารถตั้งค่าได้ระหว่าง 0 ถึง 1 อุณหภูมิที่สูงขึ้นจะส่งผลให้การสร้างสรรค์เสร็จสมบูรณ์มากขึ้น อุณหภูมิที่ต่ำกว่าจะส่งผลให้มีความสมบูรณ์ตามที่กำหนดมากขึ้น ค่าเริ่มต้นเป็น 0
--working-dir
flag หรือตัวแปรสภาพแวดล้อม WORKING_DIR
ที่สามารถตั้งค่าสำหรับเส้นทางโปรเจ็กต์ Terraform
--exec-dir
flag หรือตัวแปรสภาพแวดล้อม EXEC_DIR
ที่สามารถตั้งค่าสำหรับไฟล์ไบนารีที่ปฏิบัติการได้ของ Terraform
terraform-ai " create micro ec2 ubuntu image 20.04 with name hello-future "
? Attempting to store the following template:
resource " aws_instance " " hello_future " {
ami = " ami-0f65671a86f061fcd "
instance_type = " t2.micro "
tags = {
Name = " hello-future "
}
}
Use the arrow keys to navigate: ↓ ↑ → ←
? Would you like to apply this ? [Reprompt/Apply/Don ' t Apply]:
+ Reprompt
▸ Apply
Don ' t Apply
terraform-ai init " create aws provider in ohio "
? Attempting to apply the following template:
provider " aws " {
region = " us-east-2 "
alias = " Ohio "
}
Use the arrow keys to navigate: ↓ ↑ → ←
? Would you like to apply this ? [Reprompt/Apply/Don ' t Apply]:
+ Reprompt
▸ Apply
Don ' t Apply
--require-confirmation
flag ฉันพบแรงบันดาลใจจากพื้นที่เก็บข้อมูลที่โฮสต์ที่ https://github.com/sozercan/kubectl-ai และฉันอยากจะแสดงความขอบคุณต่อ @sozercan สำหรับความคิดสร้างสรรค์อันมีค่าของพวกเขา นอกจากนี้ ฉันต้องการรับทราบผลงานของ @simongottschlag บน Azure OpenAI fork ซึ่งมีอยู่ที่ https://github.com/simongottschlag/azure-openai-gpt-slack-bot ซึ่งสร้างขึ้นบนรากฐานที่วางโดย https:// github.com/PullRequestInc/go-gpt3.