Terraform 0.11 - Terraform Commands (CLI)
टेराफॉर्म कमांड्स (सीएलआई)

टेराफॉर्म कमांड्स (सीएलआई)
Terraform कमांड-लाइन इंटरफ़ेस (CLI) का उपयोग करने के लिए बहुत आसान के माध्यम से नियंत्रित किया जाता है। टेराफॉर्म केवल एक कमांड-लाइन एप्लिकेशन है: टेराफॉर्म। यह एप्लिकेशन तब "आवेदन" या "योजना" जैसे एक उपखंड लेता है। उपकमांडों की पूरी सूची बाईं ओर के नेविगेशन में है।
सीढ़ीदार सीएलआई एक अच्छी तरह से व्यवहार किया गया कमांड लाइन आवेदन है। गलत मामलों में, एक गैर-शून्य निकास स्थिति वापस आ जाएगी। यह भी -h और --help का जवाब देता है क्योंकि आप सबसे अधिक संभावना रखते हैं।
किसी भी समय उपलब्ध आदेशों की एक सूची देखने के लिए, बिना किसी तर्क के केवल टेराफ़ॉर्म चलाएँ:
$ terraform Usage: terraform [--version] [--help] <command> [args] The available commands for execution are listed below. The most common, useful commands are shown first, followed by less common or more advanced commands. If you're just getting started with Terraform, stick with the common commands. For the other commands, please read the help and docs before usage. Common commands: apply Builds or changes infrastructure console Interactive console for Terraform interpolations destroy Destroy Terraform-managed infrastructure fmt Rewrites config files to canonical format get Download and install modules for the configuration graph Create a visual graph of Terraform resources import Import existing infrastructure into Terraform init Initialize a new or existing Terraform configuration output Read an output from a state file plan Generate and show an execution plan providers Prints a tree of the providers used in the configuration push Upload this Terraform module to Terraform Enterprise to run refresh Update local state file against real resources show Inspect Terraform state or plan taint Manually mark a resource for recreation untaint Manually unmark a resource as tainted validate Validates the Terraform files version Prints the Terraform version workspace Workspace management All other commands: debug Debug output management (experimental) force-unlock Manually unlock the terraform state state Advanced state management
किसी भी विशिष्ट आदेश के लिए सहायता प्राप्त करने के लिए, -h ध्वज को संबंधित उपकमांड से गुजारें। उदाहरण के लिए, ग्राफ़ उपकमांड के बारे में मदद देखने के लिए:
$ terraform graph -h Usage: terraform graph [options] PATH Outputs the visual graph of Terraform resources. If the path given is the path to a configuration, the dependency graph of the resources are shown. If the path is a plan file, then the dependency graph of the plan itself is shown. The graph is outputted in DOT format. The typical program that can read this format is GraphViz, but many web services are also available to read this format.
शेल टैब-पूरा
यदि आप अपने कमांड शेल के रूप में
bash
या
zsh
उपयोग करते हैं, तो Terraform सभी कमांड नामों और (इस समय)
कुछ
कमांड तर्क के लिए टैब-पूर्ण समर्थन प्रदान कर सकता है।
अपने शेल प्रोफ़ाइल में आवश्यक कमांड जोड़ने के लिए, निम्नलिखित कमांड चलाएँ:
terraform -install-autocomplete
स्थापना के बाद, अपने शेल को पुनः आरंभ करना या पूरा होने से पहले इसकी प्रोफाइल स्क्रिप्ट को फिर से पढ़ना आवश्यक है।
पूर्ण हुक को अनइंस्टॉल करने के लिए, यह मानते हुए कि इसे शेल प्रोफ़ाइल में मैन्युअल रूप से संशोधित नहीं किया गया है, निम्नलिखित कमांड चलाएँ:
terraform -uninstall-autocomplete
वर्तमान में टेराफॉर्म के सभी उप-क्षेत्रों में सभी तर्कों के लिए पूर्ण टैब-पूर्ण समर्थन नहीं है। हम समय के साथ टैब-पूर्ण कवरेज में सुधार करने की योजना बनाते हैं।
नवीनीकरण और सुरक्षा बुलेटिन जाँच
Terraform CLI कमांड नए संस्करण की उपलब्धता और वर्तमान संस्करण के बारे में महत्वपूर्ण सुरक्षा बुलेटिनों की जांच के लिए HashiCorp सेवा Checkpoint साथ बातचीत करता है।
एक जगह जहां इसका प्रभाव देखा जा सकता है, वह
terraform version
, जहां इसका उपयोग डिफ़ॉल्ट रूप से आउटपुट में इंगित करने के लिए किया जाता है जब एक नया संस्करण उपलब्ध होता है।
केवल अनाम जानकारी, जिसका उपयोग उपयोगकर्ता या होस्ट को पहचानने के लिए नहीं किया जा सकता है, चेकपॉइंट पर भेजा जाता है। एक अनाम आईडी भेजी जाती है जो डी-डुप्लिकेट चेतावनी संदेशों में मदद करती है। अनाम आईडी और चेकपॉइंट का उपयोग दोनों ही पूरी तरह से वैकल्पिक हैं और इसे निष्क्रिय किया जा सकता है।
चेकपॉइंट ही किसी भी गैर-रिक्त मान के लिए पर्यावरण चर
CHECKPOINT_DISABLE
सेट करके सभी HashiCorp उत्पादों के लिए पूरी तरह से अक्षम किया जा सकता है।
वैकल्पिक रूप से, CLI कॉन्फ़िगरेशन फ़ाइल में सेटिंग्स का उपयोग चेकपॉइंट सुविधाओं को अक्षम करने के लिए किया जा सकता है। निम्नलिखित चेकपॉइंट-संबंधित सेटिंग्स इस फ़ाइल में समर्थित हैं:
-
disable_checkpoint
- चेकपॉइंट कॉल को पूरी तरह से अक्षम करने के लिएtrue
पर सेट करें। यह ऊपर वर्णितCHECKPOINT_DISABLE
पर्यावरण चर के समान है। -
disable_checkpoint_signature
- चेकपॉइंट अनुरोधों में अनाम हस्ताक्षर के उपयोग को अक्षम करने के लिएtrue
पर सेट करें। यह टेराफॉर्म को सुरक्षा बुलेटिनों की जांच करने की अनुमति देता है लेकिन इन अनुरोधों में अनाम हस्ताक्षर नहीं भेजता है।
Terraform द्वारा उपयोग किया गया चेकपॉइंट क्लाइंट कोड किसी भी इच्छुक पार्टी द्वारा समीक्षा के लिए उपलब्ध है।