OpenAI ChatGPT를 기반으로 하는 Terraform-ai
지능적인 대화형 도우미를 제공하여 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
(Azure의 경우 배포 이름은gpt-35-turbo-0301
이어야 함)gpt-3.5-turbo
gpt-35-turbo-0301
gpt-4-0314
gpt-4-32k-0314
Azure OpenAI 서비스의 경우 다음 환경 변수를 사용할 수 있습니다.
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
플래그 또는 REQUIRE_CONFIRMATION
환경 변수를 설정하여 매니페스트를 적용하기 전에 사용자에게 확인 메시지를 표시할 수 있습니다. 기본값은 true입니다.
--temperature
플래그 또는 TEMPERATURE
환경 변수는 0에서 1 사이로 설정할 수 있습니다. 온도가 높을수록 더 창의적인 완성이 가능합니다. 온도가 낮을수록 더 결정적인 완료가 이루어집니다. 기본값은 0입니다.
--working-dir
플래그 또는 Terraform 프로젝트 경로에 설정할 수 있는 WORKING_DIR
환경 변수입니다.
--exec-dir
플래그 또는 Terraform 실행 바이너리 파일에 설정할 수 있는 EXEC_DIR
환경 변수입니다.
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
플래그 저는 https://github.com/sozercan/kubectl-ai에 호스팅된 저장소에서 영감을 얻었으며 @sozercan의 귀중한 창의성에 감사를 표하고 싶습니다. 또한 https://github.com/simongottschlag/azure-openai-gpt-slack-bot에서 사용할 수 있는 Azure OpenAI 포크에 대한 @simongottschlag의 작업에 감사를 표하고 싶습니다. github.com/PullRequestInc/go-gpt3.