{"id":48622,"date":"2023-08-14T13:12:51","date_gmt":"2022-11-19T04:45:46","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/"},"modified":"2024-04-30T18:31:55","modified_gmt":"2024-04-30T10:31:55","slug":"%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/","title":{"rendered":"\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237"},"content":{"rendered":"<p>\u7531\u4e8e\u5728\u5de5\u4f5c\u4e2d\u4f7f\u7528Terraform\u7684\u673a\u4f1a\u589e\u591a\uff0c\u4f46\u5bf9\u5176\u4e2d\u7684\u4e00\u4e9b\u90e8\u5206\u4ecd\u7136\u7406\u89e3\u4e0d\u591f\uff0c\u4e3a\u4e86\u52a0\u6df1\u7406\u89e3\uff0c\u672c\u6b21\u5c06\u901a\u8fc7\u4f7f\u7528Terraform\u6784\u5efaAzure\u5b58\u50a8\u6765\u603b\u7ed3\u5b66\u4e60\u3002<\/p>\n<h2>Terraform \u662f\u4ec0\u4e48\uff1f<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">HashiCorp\u793e\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u30a4\u30f3\u30d5\u30e9\u306e\u8a2d\u5b9a\u3092\u30b3\u30fc\u30c9\u3067\u7ba1\u7406\u3059\u308b\u305f\u3081\u306eIaC\uff08Infrastructure as Code\uff09\u30c4\u30fc\u30eb<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">HCL\uff08HashiCorp Configration Language\uff09\u3068\u3044\u3046\u8a00\u8a9e\u3067\u5b9a\u7fa9\u3092\u8a18\u8ff0\u3057\u30a4\u30f3\u30d5\u30e9\u69cb\u7bc9\u3092\u304a\u3053\u306a\u3046\u3053\u3068\u304c\u3067\u304d\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">AWS\u3084Microsoft Azure\u3001Google Cloud Plattform\u306a\u3069\u69d8\u3005\u306a\u30d1\u30d6\u30ea\u30c3\u30af\u30af\u30e9\u30a6\u30c9\u306b\u5bfe\u5fdc<\/ul>\n<h2>tfstate\u6587\u4ef6<\/h2>\n<p>\u8fd9\u4e2a\u6587\u4ef6\u7528\u4e8e\u8bb0\u5f55Terraform\u6240\u7ba1\u7406\u8d44\u6e90\u7684\u5f53\u524d\u914d\u7f6e\u3002<br \/>\n\u5728\u5e94\u7528\uff08apply\uff09\u6240\u5b9a\u4e49\u7684\u8d44\u6e90\u65f6\uff0c\u5e94\u7528\u7684\u914d\u7f6e\u5c06\u88ab\u8bb0\u5f55\u3002<br \/>\n\u6587\u4ef6\u7684\u7ba1\u7406\u6709\u4ee5\u4e0b\u4e24\u79cd\u65b9\u6cd5\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30ed\u30fc\u30ab\u30eb\u7ba1\u7406<\/ul>\n<\/li>\n<\/ul>\n<p>\u7279\u306b\u4fdd\u5b58\u5148\u3092\u6307\u5b9a\u3057\u3066\u3044\u306a\u3051\u308c\u3070\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306eterraform\u3092\u5b9f\u884c\u3057\u305f\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306btfstate\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u308b<\/p>\n<p>\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u7ba1\u7406<\/p>\n<p>\u30af\u30e9\u30a6\u30c9\u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u4e0a\u3067\u7ba1\u7406\u3092\u304a\u3053\u306a\u3044\u958b\u767a\u30e1\u30f3\u30d0\u30fc\u9593\u306e\u5171\u6709\u304c\u3067\u304d\u308b<br \/>\n\u30d0\u30fc\u30b8\u30e7\u30cb\u30f3\u30b0\u7ba1\u7406\u304c\u3067\u304d\u3001\u4f55\u304b\u3042\u3063\u305f\u6642\u306e\u5fa9\u65e7\u304c\u5bb9\u6613<\/p>\n<h2>\u6211\u5c1d\u8bd5\u4f7f\u7528Terraform\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237\u3002<\/h2>\n<h3>\u524d\u671f\u51c6\u5907<\/h3>\n<p>\u8bf7\u6839\u636e\u4ee5\u4e0b\u6559\u7a0b\u53c2\u8003\u65b9\u5f0f\uff0c\u5728Azure\u4e0a\u5b89\u88c5Terraform\u5e76\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6b64\u5916\uff0c\u6839\u636e\u4ee5\u4e0b\u5185\u5bb9\uff0c\u5728\u5b58\u50a8\u4e2d\u521b\u5efa\u5b58\u50a8\u5e10\u6237\u548c\u5bb9\u5668\uff0c\u4ee5\u4fbf\u80fd\u591f\u7ba1\u7406tfstate\u6587\u4ef6\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u521b\u5efa\u914d\u7f6e\u6587\u4ef6<\/h3>\n<h4>provider.tf \u7684\u4e2d\u6587\u91ca\u4e49\u662f\uff1a\u4f9b\u5e94\u8005.tf\u3002<\/h4>\n<p>\u9996\u5148\uff0c\u5728terraform\u4ee3\u7801\u5757\u4e2d\u5b9a\u4e49\u8981\u4f7f\u7528\u7684\u63d0\u4f9b\u8005\u3002<br \/>\n\u8fd9\u6b21\u6211\u4eec\u5c06\u4f7f\u7528Azure\u5b58\u50a8\u6765\u7ba1\u7406\u72b6\u6001\u6587\u4ef6\uff0c\u56e0\u6b64\u5728backend\u4ee3\u7801\u5757\u4e2d\u4e5f\u4f1a\u8bb0\u5f55\u5b58\u50a8\u7684\u4fe1\u606f\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nx\">terraform<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">required_providers<\/span> <span class=\"p\">{<\/span>\r\n    <span class=\"nx\">azurerm<\/span> <span class=\"p\">=<\/span> <span class=\"p\">{<\/span>\r\n      <span class=\"nx\">version<\/span> <span class=\"p\">=<\/span> <span class=\"s2\">\"&gt;=3.49.0\"<\/span>\r\n    <span class=\"p\">}<\/span>\r\n  <span class=\"p\">}<\/span>\r\n  <span class=\"nx\">backend<\/span> <span class=\"s2\">\"azurerm\"<\/span> <span class=\"p\">{<\/span>\r\n    <span class=\"nx\">resource_group_name<\/span>  <span class=\"p\">=<\/span> <span class=\"s2\">\"backend_rg\"<\/span>  <span class=\"c1\"># \u4e8b\u524d\u6e96\u5099\u3067\u4f5c\u6210\u3057\u305f resource-group-name<\/span>\r\n    <span class=\"nx\">storage_account_name<\/span> <span class=\"p\">=<\/span> <span class=\"s2\">\"xxxxxtfbackend01\"<\/span> <span class=\"c1\"># \u4e8b\u524d\u6e96\u5099\u3067\u4f5c\u6210\u3057\u305f storage-account-name<\/span>\r\n    <span class=\"nx\">container_name<\/span>       <span class=\"p\">=<\/span> <span class=\"s2\">\"backend\"<\/span>     <span class=\"c1\"># \u4e8b\u524d\u6e96\u5099\u3067\u4f5c\u6210\u3057\u305f container-name<\/span>\r\n    <span class=\"nx\">key<\/span>                  <span class=\"p\">=<\/span> <span class=\"s2\">\"terraform.tfstate\"<\/span>\r\n  <span class=\"p\">}<\/span>\r\n<span class=\"p\">}<\/span>\r\n\r\n<span class=\"nx\">provider<\/span> <span class=\"s2\">\"azurerm\"<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">features<\/span> <span class=\"p\">{}<\/span>\r\n<span class=\"p\">}<\/span>\r\n<\/code><\/pre>\n<h4>variables.tf\u7684\u4e2d\u6587\u91ca\u4e49<\/h4>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f1a\u5199\u4e0b\u53d8\u91cf\u7684\u5b9a\u4e49\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nx\">variable<\/span> <span class=\"s2\">\"location\"<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">type<\/span>    <span class=\"p\">=<\/span> <span class=\"nx\">string<\/span>\r\n  <span class=\"nx\">default<\/span> <span class=\"p\">=<\/span> <span class=\"s2\">\"japaneast\"<\/span>\r\n<span class=\"p\">}<\/span>\r\n<span class=\"nx\">variable<\/span> <span class=\"s2\">\"allow_nested_items_to_be_public\"<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">type<\/span>    <span class=\"p\">=<\/span> <span class=\"nx\">bool<\/span>\r\n  <span class=\"nx\">default<\/span> <span class=\"p\">=<\/span> <span class=\"kc\">false<\/span>\r\n<span class=\"p\">}<\/span>\r\n<span class=\"nx\">variable<\/span> <span class=\"s2\">\"container_access_type\"<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">type<\/span>    <span class=\"p\">=<\/span> <span class=\"nx\">string<\/span>\r\n  <span class=\"nx\">default<\/span> <span class=\"p\">=<\/span> <span class=\"s2\">\"private\"<\/span>\r\n<span class=\"p\">}<\/span>\r\n<\/code><\/pre>\n<p>\u5728type\u4e2d\u5b9a\u4e49\u53d8\u91cf\u7684\u7c7b\u578b\uff0c\u5728default\u4e2d\u5b9a\u4e49\u9ed8\u8ba4\u503c\u3002<br \/>\n\u5b9a\u4e49\u7684\u53d8\u91cf\u53ef\u4ee5\u901a\u8fc7var.\u53d8\u91cf\u540d\u8fdb\u884c\u5f15\u7528\u3002<\/p>\n<h4>\u4e3b\u8981.tf<\/h4>\n<p>\u6211\u5011\u5c07\u958b\u59cb\u63cf\u8ff0\u5275\u5efa\u8cc7\u6e90\u7684\u5b9a\u7fa9\u3002<br \/>\n\u672c\u6b21\u5c07\u5efa\u7acb\u8cc7\u6e90\u7fa4\u7d44\u3001\u5b58\u5132\u5e33\u6236\u548c\u5b58\u5132\u5bb9\u5668\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c1\"># \u30ea\u30bd\u30fc\u30b9\u30b0\u30eb\u30fc\u30d7<\/span>\r\n<span class=\"nx\">resource<\/span> <span class=\"s2\">\"azurerm_resource_group\"<\/span> <span class=\"s2\">\"rg\"<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">name<\/span>     <span class=\"p\">=<\/span> <span class=\"s2\">\"rg_strage\"<\/span>\r\n  <span class=\"nx\">location<\/span> <span class=\"p\">=<\/span> <span class=\"nx\">var<\/span><span class=\"err\">.<\/span><span class=\"nx\">location<\/span>\r\n<span class=\"p\">}<\/span>\r\n\r\n<span class=\"c1\"># \u30b9\u30c8\u30ec\u30fc\u30b8\u30a2\u30ab\u30a6\u30f3\u30c8<\/span>\r\n<span class=\"nx\">resource<\/span> <span class=\"s2\">\"azurerm_storage_account\"<\/span> <span class=\"s2\">\"sa\"<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">name<\/span>                            <span class=\"p\">=<\/span> <span class=\"s2\">\"xxxxxtf39demo01\"<\/span>\r\n  <span class=\"nx\">resource_group_name<\/span>             <span class=\"p\">=<\/span> <span class=\"nx\">azurerm_resource_group<\/span><span class=\"err\">.<\/span><span class=\"nx\">rg<\/span><span class=\"err\">.<\/span><span class=\"nx\">name<\/span>\r\n  <span class=\"nx\">location<\/span>                        <span class=\"p\">=<\/span> <span class=\"nx\">azurerm_resource_group<\/span><span class=\"err\">.<\/span><span class=\"nx\">rg<\/span><span class=\"err\">.<\/span><span class=\"nx\">location<\/span>\r\n  <span class=\"nx\">account_tier<\/span>                    <span class=\"p\">=<\/span> <span class=\"s2\">\"Standard\"<\/span>\r\n  <span class=\"nx\">account_replication_type<\/span>        <span class=\"p\">=<\/span> <span class=\"s2\">\"LRS\"<\/span>\r\n  <span class=\"nx\">allow_nested_items_to_be_public<\/span> <span class=\"p\">=<\/span> <span class=\"nx\">var<\/span><span class=\"err\">.<\/span><span class=\"nx\">allow_nested_items_to_be_public<\/span>\r\n<span class=\"p\">}<\/span>\r\n\r\n<span class=\"c1\"># \u30b9\u30c8\u30ec\u30fc\u30b8\u30b3\u30f3\u30c6\u30ca\u30fc<\/span>\r\n<span class=\"nx\">resource<\/span> <span class=\"s2\">\"azurerm_storage_container\"<\/span> <span class=\"s2\">\"sc\"<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">name<\/span>                  <span class=\"p\">=<\/span> <span class=\"s2\">\"stragecon\"<\/span>\r\n  <span class=\"nx\">storage_account_name<\/span>  <span class=\"p\">=<\/span> <span class=\"nx\">azurerm_storage_account<\/span><span class=\"err\">.<\/span><span class=\"nx\">sa<\/span><span class=\"err\">.<\/span><span class=\"nx\">name<\/span>\r\n  <span class=\"nx\">container_access_type<\/span> <span class=\"p\">=<\/span> <span class=\"nx\">var<\/span><span class=\"err\">.<\/span><span class=\"nx\">container_access_type<\/span>\r\n<span class=\"p\">}<\/span>\r\n<\/code><\/pre>\n<h3>\u8d44\u6e90\u5efa\u8bbe<\/h3>\n<h4>\u521d\u59cb\u5316<\/h4>\n<p>\u6267\u884cinit\u547d\u4ee4\uff0c\u8fdb\u884c\u5de5\u4f5c\u76ee\u5f55\u7684\u521d\u59cb\u5316\u548c\u63d2\u4ef6\u7684\u4e0b\u8f7d\u3002<\/p>\n<pre class=\"post-pre\"><code>$ terraform init\r\n\r\nInitializing the backend...\r\n\r\nSuccessfully configured the backend \"azurerm\"! Terraform will automatically\r\nuse this backend unless the backend configuration changes.\r\n\r\nInitializing provider plugins...\r\n- Finding hashicorp\/azurerm versions matching \"&gt;= 3.49.0\"...\r\n- Installing hashicorp\/azurerm v3.53.0...\r\n- Installed hashicorp\/azurerm v3.53.0 (signed by HashiCorp)\r\n\r\nTerraform has created a lock file .terraform.lock.hcl to record the provider\r\nselections it made above. Include this file in your version control repository\r\nso that Terraform can guarantee to make the same selections by default when\r\nyou run \"terraform init\" in the future.\r\n\r\nTerraform has been successfully initialized!\r\n\r\nYou may now begin working with Terraform. Try running \"terraform plan\" to see\r\nany changes that are required for your infrastructure. All Terraform commands\r\nshould now work.\r\n\r\nIf you ever set or change modules or backend configuration for Terraform,\r\nrerun this command to reinitialize your working directory. If you forget, other\r\ncommands will detect it and remind you to do so if necessary.\r\n<\/code><\/pre>\n<p>\u5f53Terraform\u521d\u59cb\u5316\u6210\u529f\u65f6\uff0c\u5c06\u663e\u793a\u6d88\u606f\uff1aTerraform\u5df2\u6210\u529f\u521d\u59cb\u5316\uff01\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528-backend-config\u9009\u9879\u6307\u5b9a\u9488\u5bf9\u6bcf\u4e2a\u73af\u5883\u5b9a\u4e49\u7684\u540e\u7aef\u3002\u521d\u59cb\u5316\u540e\uff0c\u5c06\u5728\u672c\u5730\u751f\u6210\u4ee5\u4e0b\u76ee\u5f55\u548c\u6587\u4ef6\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">.terraform<\/ul>\n<\/li>\n<\/ul>\n<p>\u521d\u671f\u5316\u6642\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u305f\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3084\u30e2\u30b8\u30e5\u30fc\u30eb\u306a\u3069\u306e\u60c5\u5831\u3092\u683c\u7d0d\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/p>\n<p>.terraform.lock.hcl<\/p>\n<p>\u521d\u671f\u5316\u6642\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u305f\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3084\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u30ed\u30c3\u30af\u3059\u308b\u305f\u3081\u306e\u30d5\u30a1\u30a4\u30eb<\/p>\n<h4>\u786e\u8ba4\u6267\u884c\u8ba1\u5212<\/h4>\n<p>\u56e0\u4e3a\u521d\u59cb\u5316\u5df2\u7ecf\u5b8c\u6210\uff0c\u6240\u4ee5\u5728\u6267\u884c&#8221;plan&#8221;\u547d\u4ee4\u5e76\u5e94\u7528\u4e4b\u524d\uff0c\u6211\u4eec\u5c06\u786e\u8ba4\u6267\u884c\u8ba1\u5212\u3002<\/p>\n<pre class=\"post-pre\"><code>$ terraform plan\r\n\r\nTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following   \r\nsymbols:\r\n  + create\r\n\r\nTerraform will perform the following actions:\r\n\r\n  # azurerm_resource_group.rg will be created\r\n  + resource \"azurerm_resource_group\" \"rg\" {\r\n      + id       = (known after apply)\r\n      + location = \"japaneast\"\r\n      + name     = \"rg_strage\"\r\n    }\r\n\r\n  # azurerm_storage_account.sa will be created\r\n  + resource \"azurerm_storage_account\" \"sa\" {\r\n      + access_tier                       = (known after apply)\r\n      + account_kind                      = \"StorageV2\"\r\n      + account_replication_type          = \"LRS\"\r\n      + account_tier                      = \"Standard\"\r\n      + allow_nested_items_to_be_public   = false\r\n      + cross_tenant_replication_enabled  = true\r\n      + default_to_oauth_authentication   = false\r\n      + enable_https_traffic_only         = true\r\n      + id                                = (known after apply)\r\n      + infrastructure_encryption_enabled = false\r\n      + is_hns_enabled                    = false\r\n      + large_file_share_enabled          = (known after apply)\r\n      + location                          = \"japaneast\"\r\n      + min_tls_version                   = \"TLS1_2\"\r\n      + name                              = \"xxxxxtf39demo01\"\r\n      + nfsv3_enabled                     = false\r\n      + primary_access_key                = (sensitive value)\r\n      + primary_blob_connection_string    = (sensitive value)\r\n      + primary_blob_endpoint             = (known after apply)\r\n      + primary_blob_host                 = (known after apply)\r\n      + primary_connection_string         = (sensitive value)\r\n      + primary_dfs_endpoint              = (known after apply)\r\n      + primary_dfs_host                  = (known after apply)\r\n      + primary_file_endpoint             = (known after apply)\r\n      + primary_file_host                 = (known after apply)\r\n      + primary_location                  = (known after apply)\r\n      + primary_queue_endpoint            = (known after apply)\r\n      + primary_queue_host                = (known after apply)\r\n      + primary_table_endpoint            = (known after apply)\r\n      + primary_table_host                = (known after apply)\r\n      + primary_web_endpoint              = (known after apply)\r\n      + primary_web_host                  = (known after apply)\r\n      + public_network_access_enabled     = true\r\n      + queue_encryption_key_type         = \"Service\"\r\n      + resource_group_name               = \"rg_strage\"\r\n      + secondary_access_key              = (sensitive value)\r\n      + secondary_blob_connection_string  = (sensitive value)\r\n      + secondary_blob_endpoint           = (known after apply)\r\n      + secondary_blob_host               = (known after apply)\r\n      + secondary_connection_string       = (sensitive value)\r\n      + secondary_dfs_endpoint            = (known after apply)\r\n      + secondary_dfs_host                = (known after apply)\r\n      + secondary_file_endpoint           = (known after apply)\r\n      + secondary_file_host               = (known after apply)\r\n      + secondary_location                = (known after apply)\r\n      + secondary_queue_endpoint          = (known after apply)\r\n      + secondary_queue_host              = (known after apply)\r\n      + secondary_table_endpoint          = (known after apply)\r\n      + secondary_table_host              = (known after apply)\r\n      + secondary_web_endpoint            = (known after apply)\r\n      + secondary_web_host                = (known after apply)\r\n      + sftp_enabled                      = false\r\n      + shared_access_key_enabled         = true\r\n      + table_encryption_key_type         = \"Service\"\r\n    }\r\n\r\n  # azurerm_storage_container.sc will be created\r\n  + resource \"azurerm_storage_container\" \"sc\" {\r\n      + container_access_type   = \"private\"\r\n      + has_immutability_policy = (known after apply)\r\n      + has_legal_hold          = (known after apply)\r\n      + id                      = (known after apply)\r\n      + metadata                = (known after apply)\r\n      + name                    = \"stragecon\"\r\n      + resource_manager_id     = (known after apply)\r\n      + storage_account_name    = \"xxxxxtf39demo01\"\r\n    }\r\n\r\nPlan: 3 to add, 0 to change, 0 to destroy.\r\n\r\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \r\n\r\nNote: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run       \r\n\"terraform apply\" now.\r\n<\/code><\/pre>\n<p>\u8ba1\u5212\uff08Plan\uff09\u547d\u4ee4\u4f1a\u4ecetfstate\u6587\u4ef6\u4e2d\u67e5\u770b\u5f53\u524d\u8d44\u6e90\u7684\u72b6\u6001\uff0c\u5e76\u663e\u793a\u6dfb\u52a0\u3001\u66f4\u6539\u548c\u5220\u9664\u8d44\u6e90\u7684\u5dee\u5f02\u3002\u6267\u884c\u547d\u4ee4\u6210\u529f\u540e\uff0c\u5c06\u663e\u793a\u6dfb\u52a0\u3001\u66f4\u6539\u548c\u5220\u9664\u8ba1\u5212\u7684\u6458\u8981\uff0c\u4f8b\u5982\uff1aPlan 1 to add, 0 to change, 0 to destroy\u3002<\/p>\n<p>\u7531\u4e8e\u8fd9\u662f\u9996\u6b21\u6267\u884cTerraform\uff0c\u5c1a\u672a\u521b\u5efa\u4efb\u4f55\u8d44\u6e90\uff0c\u56e0\u6b64\u5c06\u663e\u793a\u4e09\u4e2a\u8d44\u6e90\u7684\u8ba1\u5212\u6458\u8981\u4f5c\u4e3a\u6dfb\u52a0\u3002<\/p>\n<p>\u5982\u679c\u4e0e\u5f53\u524d\u8d44\u6e90\u72b6\u6001\u5bf9\u6bd4\u540e\uff0c\u6ca1\u6709\u9700\u8981\u6dfb\u52a0\u6216\u66f4\u6539\u7684\u8d44\u6e90\uff0c\u5219\u4f1a\u663e\u793a\u201cNo changes\u201d\u3002<\/p>\n<p>\u6267\u884capply\u547d\u4ee4\u540e\u4e5f\u662f\u76f8\u540c\u60c5\u51b5\uff0c\u4f46\u8fd8\u6709\u4ee5\u4e0b\u9009\u9879\u53ef\u7528\u3002<\/p>\n<p>-var-file\u30aa\u30d7\u30b7\u30e7\u30f3\u3067.tfvars\u306e\u62e1\u5f35\u5b50\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u74b0\u5883\u3054\u3068\u306e\u5909\u6570\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd<\/p>\n<p>-target\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u7279\u5b9amodule\u306e\u307f\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd<\/p>\n<h4>\u9002\u7528\u6761\u4ef6<\/h4>\n<pre class=\"post-pre\"><code>$ terraform apply\r\n\r\nTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following   \r\nsymbols:\r\n  + create\r\n\r\nTerraform will perform the following actions:\r\n\r\n  # azurerm_resource_group.rg will be created\r\n  + resource \"azurerm_resource_group\" \"rg\" {\r\n      + id       = (known after apply)\r\n      + location = \"japaneast\"\r\n      + name     = \"rg_strage\"\r\n    }\r\n\r\n  # azurerm_storage_account.sa will be created\r\n  + resource \"azurerm_storage_account\" \"sa\" {\r\n      + access_tier                       = (known after apply)\r\n      + account_kind                      = \"StorageV2\"\r\n      + account_replication_type          = \"LRS\"\r\n      + account_tier                      = \"Standard\"\r\n      + allow_nested_items_to_be_public   = false\r\n      + cross_tenant_replication_enabled  = true\r\n      + default_to_oauth_authentication   = false\r\n      + enable_https_traffic_only         = true\r\n      + id                                = (known after apply)\r\n      + infrastructure_encryption_enabled = false\r\n      + is_hns_enabled                    = false\r\n      + large_file_share_enabled          = (known after apply)\r\n      + location                          = \"japaneast\"\r\n      + min_tls_version                   = \"TLS1_2\"\r\n      + name                              = \"xxxxxtf39demo01\"\r\n      + nfsv3_enabled                     = false\r\n      + primary_access_key                = (sensitive value)\r\n      + primary_blob_connection_string    = (sensitive value)\r\n      + primary_blob_endpoint             = (known after apply)\r\n      + primary_blob_host                 = (known after apply)\r\n      + primary_connection_string         = (sensitive value)\r\n      + primary_dfs_endpoint              = (known after apply)\r\n      + primary_dfs_host                  = (known after apply)\r\n      + primary_file_endpoint             = (known after apply)\r\n      + primary_file_host                 = (known after apply)\r\n      + primary_location                  = (known after apply)\r\n      + primary_queue_endpoint            = (known after apply)\r\n      + primary_queue_host                = (known after apply)\r\n      + primary_table_endpoint            = (known after apply)\r\n      + primary_table_host                = (known after apply)\r\n      + primary_web_endpoint              = (known after apply)\r\n      + primary_web_host                  = (known after apply)\r\n      + public_network_access_enabled     = true\r\n      + queue_encryption_key_type         = \"Service\"\r\n      + resource_group_name               = \"rg_strage\"\r\n      + secondary_access_key              = (sensitive value)\r\n      + secondary_blob_connection_string  = (sensitive value)\r\n      + secondary_blob_endpoint           = (known after apply)\r\n      + secondary_blob_host               = (known after apply)\r\n      + secondary_connection_string       = (sensitive value)\r\n      + secondary_dfs_endpoint            = (known after apply)\r\n      + secondary_dfs_host                = (known after apply)\r\n      + secondary_file_endpoint           = (known after apply)\r\n      + secondary_file_host               = (known after apply)\r\n      + secondary_location                = (known after apply)\r\n      + secondary_queue_endpoint          = (known after apply)\r\n      + secondary_queue_host              = (known after apply)\r\n      + secondary_table_endpoint          = (known after apply)\r\n      + secondary_table_host              = (known after apply)\r\n      + secondary_web_endpoint            = (known after apply)\r\n      + secondary_web_host                = (known after apply)\r\n      + sftp_enabled                      = false\r\n      + shared_access_key_enabled         = true\r\n      + table_encryption_key_type         = \"Service\"\r\n    }\r\n\r\n  # azurerm_storage_container.sc will be created\r\n  + resource \"azurerm_storage_container\" \"sc\" {\r\n      + container_access_type   = \"private\"\r\n      + has_immutability_policy = (known after apply)\r\n      + has_legal_hold          = (known after apply)\r\n      + id                      = (known after apply)\r\n      + metadata                = (known after apply)\r\n      + name                    = \"stragecon\"\r\n      + resource_manager_id     = (known after apply)\r\n      + storage_account_name    = \"xxxxxtf39demo01\"\r\n    }\r\n\r\nPlan: 3 to add, 0 to change, 0 to destroy.\r\n\r\nDo you want to perform these actions?\r\n  Terraform will perform the actions described above.\r\n  Only 'yes' will be accepted to approve.\r\n\r\n  Enter a value: yes\r\n\r\nazurerm_resource_group.rg: Creating...\r\nazurerm_resource_group.rg: Creation complete after 2s [id=\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/rg_strage]\r\nazurerm_storage_account.sa: Creating...\r\nazurerm_storage_account.sa: Still creating... [10s elapsed]\r\nazurerm_storage_account.sa: Still creating... [21s elapsed]\r\nazurerm_storage_account.sa: Still creating... [31s elapsed]\r\nazurerm_storage_account.sa: Still creating... [41s elapsed]\r\nazurerm_storage_account.sa: Still creating... [51s elapsed]\r\nazurerm_storage_account.sa: Still creating... [1m1s elapsed]\r\nazurerm_storage_account.sa: Still creating... [1m11s elapsed]\r\nazurerm_storage_account.sa: Creation complete after 1m19s [id=\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/rg_strage\/providers\/Microsoft.Storage\/storageAccounts\/xxxxxtf39demo01]\r\nazurerm_storage_container.sc: Creating...\r\nazurerm_storage_container.sc: Creation complete after 0s [id=https:\/\/xxxxxtf39demo01.blob.core.windows.net\/stragecon]\r\n\r\nApply complete! Resources: 3 added, 0 changed, 0 destroyed.\r\n<\/code><\/pre>\n<p>apply\u547d\u4ee4\u662f\u7528\u4e8e\u5c06\u5b9a\u4e49\u7684\u57fa\u7840\u67b6\u6784\u914d\u7f6e\u5e94\u7528\u5230\u4e91\u7aef\u7684\u547d\u4ee4\u3002<br \/>\n\u6267\u884c\u547d\u4ee4\u540e\u4f1a\u518d\u6b21\u663e\u793aplan\u7ed3\u679c\uff0c\u5728Enter a Value:\u5904\u8f93\u5165yes\u5373\u53ef\u8fdb\u884c\u5e94\u7528\u3002<br \/>\n\u4e00\u65e6apply\u5b8c\u6210\uff0c\u6240\u5e94\u7528\u8d44\u6e90\u7684\u4fe1\u606f\u5c06\u4f1a\u8bb0\u5f55\u5728terraform.tfstate\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u65b0\u6267\u884cplan\u547d\u4ee4\u4ee5\u786e\u8ba4\u8d44\u6e90\u662f\u5426\u88ab\u5e94\u7528\u6210\u529f\u3002<\/p>\n<pre class=\"post-pre\"><code>terraform plan \r\nazurerm_resource_group.rg: Refreshing state... [id=\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/rg_strage]\r\nazurerm_storage_account.sa: Refreshing state... [id=\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/rg_strage\/providers\/Microsoft.Storage\/storageAccounts\/xxxxxtf39demo01]\r\nazurerm_storage_container.sc: Refreshing state... [id=https:\/\/xxxxxtf39demo01.blob.core.windows.net\/stragecon]\r\n\r\nNo changes. Your infrastructure matches the configuration.\r\n\r\nTerraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.\r\n<\/code><\/pre>\n<p>\u6ca1\u6709\u53d8\u5316\u3002\u60a8\u7684\u57fa\u7840\u8bbe\u65bd\u4e0e\u914d\u7f6e\u76f8\u5339\u914d\u3002\u6211\u5df2\u7ecf\u786e\u8ba4\u4e86Azure\u95e8\u6237\u4e0a\u8d44\u6e90\u7684\u521b\u5efa\u3002<\/p>\n<p>\u7531\u4e8e\u53ef\u4ee5\u6dfb\u52a0\u8d44\u6e90\uff0c\u6211\u4eec\u73b0\u5728\u5c06\u5728main.tf\u6587\u4ef6\u4e2d\u6dfb\u52a0\u53e6\u4e00\u4e2a\u5bb9\u5668\u7684\u8d44\u6e90\u5b9a\u4e49\u5e76\u8fdb\u884c\u8ba1\u5212\u6267\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code>\u30fb\u30fb\u30fb\r\n\r\nresource \"azurerm_storage_container\" \"sc02\" {\r\n  name                  = \"stragecon02\"\r\n  storage_account_name  = azurerm_storage_account.sa.name\r\n  container_access_type = var.container_access_type\r\n}\r\n<\/code><\/pre>\n<p>\u6267\u884c\u8ba1\u5212\u7ed3\u679c<\/p>\n<pre class=\"post-pre\"><code>$ terraform plan\r\nazurerm_resource_group.rg: Refreshing state... [id=\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/rg_strage]\r\nazurerm_storage_account.sa: Refreshing state... [id=\/subscriptions\/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\/resourceGroups\/rg_strage\/providers\/Microsoft.Storage\/storageAccounts\/xxxxxtf39demo01]\r\nazurerm_storage_container.sc: Refreshing state... [id=https:\/\/xxxxxtf39demo01.blob.core.windows.net\/stragecon]\r\n\r\nTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following   \r\nsymbols:\r\n  + create\r\n\r\nTerraform will perform the following actions:\r\n\r\n  # azurerm_storage_container.sc02 will be created\r\n  + resource \"azurerm_storage_container\" \"sc02\" {\r\n      + container_access_type   = \"private\"\r\n      + has_immutability_policy = (known after apply)\r\n      + has_legal_hold          = (known after apply)\r\n      + id                      = (known after apply)\r\n      + metadata                = (known after apply)\r\n      + name                    = \"stragecon02\"\r\n      + resource_manager_id     = (known after apply)\r\n      + storage_account_name    = \"xxxxxtf39demo01\"\r\n    }\r\n\r\nPlan: 1 to add, 0 to change, 0 to destroy.\r\n\r\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \r\n\r\nNote: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run       \r\n\"terraform apply\" now.\r\n<\/code><\/pre>\n<p>\u7531\u4e8e\u4e4b\u524d\u5e94\u7528\u7684\u4e09\u4e2a\u8d44\u6e90\u5df2\u8bb0\u5f55\u5728tfstate\u6587\u4ef6\u4e2d\uff0c\u56e0\u6b64\u5b83\u4eec\u4e0d\u4f1a\u4f5c\u4e3a\u8ba1\u5212\u7684\u5dee\u5f02\u663e\u793a\u3002<br \/>\n\u800c\u672c\u6b21\u6dfb\u52a0\u7684\u5bb9\u5668\u4f1a\u4f5c\u4e3a\u4e00\u4e2a\u989d\u5916\u7684\u5dee\u5f02\u663e\u793a\u3002<\/p>\n<h2>\u6574\u7406\u5176\u4ed6\u4e3b\u8981\u7684\u547d\u4ee4\u548c\u4ee3\u7801\u5757\u7ed3\u6784<\/h2>\n<h3>\u547d\u4ee4<\/h3>\n<h4>\u6574\u7406\u5f62\u5f0f<\/h4>\n<pre class=\"post-pre\"><code>$ terraform fmt\r\n<\/code><\/pre>\n<ul class=\"post-ul\">Terraform\u306e\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u306e\u30a4\u30f3\u30c7\u30f3\u30c8\u3092\u63c3\u3048\u308b\u305f\u3081\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u304a\u3053\u306a\u3046\u30b3\u30de\u30f3\u30c9<\/ul>\n<h4>\u9a8c\u8bc1<\/h4>\n<pre class=\"post-pre\"><code>$ terraform validate\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u5b9a\u7fa9\u3057\u305f\u69cb\u6587\u306e\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u30b3\u30de\u30f3\u30c9<\/ul>\n<\/li>\n<\/ul>\n<p>terraform plan\u30b3\u30de\u30f3\u30c9\u3067\u3082validate\u30b3\u30de\u30f3\u30c9\u306e\u6a5f\u80fd\u304c\u5185\u5305\u3055\u308c\u3066\u3044\u308b<\/p>\n<h4>\u6467\u6bc1<\/h4>\n<pre class=\"post-pre\"><code>$ terraform destoroy\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Terraform\u3067\u7ba1\u7406\u3057\u3066\u3044\u308b\u30ea\u30bd\u30fc\u30b9\u306e\u524a\u9664\u30b3\u30de\u30f3\u30c9<\/ul>\n<\/li>\n<\/ul>\n<p>terraform plan -destroy\u30b3\u30de\u30f3\u30c9\u3067\u524a\u9664\u5bfe\u8c61\u306e\u30ea\u30bd\u30fc\u30b9\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd<\/p>\n<h4>\u9648\u8ff0<\/h4>\n<pre class=\"post-pre\"><code>$ terraform state list\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u4f5c\u6210\u3057\u305f\u30ea\u30bd\u30fc\u30b9\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9<\/ul>\n<pre class=\"post-pre\"><code>$ terraform state show \u30ea\u30bd\u30fc\u30b9\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u30ea\u30bd\u30fc\u30b9\u3092\u6307\u5b9a\u3057\u3066\u4f5c\u6210\u3057\u305f\u30ea\u30bd\u30fc\u30b9\u306e\u8a73\u7d30\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9<\/ul>\n<h3>\u963b\u65ad<\/h3>\n<h4>\u6570\u636e\u6e90<\/h4>\n<p>data\u30d6\u30ed\u30c3\u30af\u3067\u5b9a\u7fa9\u3092\u304a\u3053\u306a\u3044\u3001Terraform\u306e\u5916\u90e8\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u60c5\u5831\u3092\u53c2\u7167\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528<\/p>\n<pre class=\"post-pre\"><code>data \"azurerm_storage_container\" \"sc\" {\r\n  name                 = \"stragecon\"\r\n  storage_account_name = \"xxxxxtf39demo01\"\r\n}\r\n<\/code><\/pre>\n<h4>\u8f93\u51fa\u503c<\/h4>\n<p>output\u30d6\u30ed\u30c3\u30af\u3067\u5b9a\u7fa9\u3092\u304a\u3053\u306a\u3044\u3001\u30ea\u30bd\u30fc\u30b9\u306e\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528<\/p>\n<p>apply\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u3059\u308b\u3068\u51fa\u529b\u3055\u308c\u308b<\/p>\n<pre class=\"post-pre\"><code>data \"azurerm_storage_container\" \"sc\" {\r\n  name                 = \"stragecon\"\r\n  storage_account_name = \"xxxxxtf39demo01\"\r\n}\r\n\r\noutput \"azurerm_storage_container_access_type\" {\r\n  value = data.azurerm_storage_container.sc.container_access_type\r\n}\r\n<\/code><\/pre>\n<p>\u5728\u6267\u884capply\u547d\u4ee4\u540e\uff0ccontainer_access_type\u5df2\u88ab\u8f93\u51fa\u3002<\/p>\n<pre class=\"post-pre\"><code>Apply complete! Resources: 0 added, 0 changed, 0 destroyed.\r\n\r\nOutputs:\r\n\r\nazurerm_storage_container_access_type = \"private\"\r\n<\/code><\/pre>\n<h2>\u8bf7\u53c2\u9605<\/h2>\n<p>&nbsp;<\/p>\n<h2>\u6700\u5f8c<\/h2>\n<p>\u8fd9\u6b21\u7684\u6784\u5efa\u975e\u5e38\u7b80\u5355\uff0c\u4f46\u662f\u6211\u4eec\u5728\u5b9e\u9645\u4f7f\u7528Terraform\u6784\u5efa\u65f6\u52a0\u6df1\u4e86\u5bf9\u57fa\u7840\u90e8\u5206\u7684\u7406\u89e3\u3002<br \/>\n\u4eca\u540e\u6211\u8fd8\u60f3\u7ee7\u7eed\u5c1d\u8bd5\u5404\u79cd\u4e0d\u540c\u7684\u6784\u5efa\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7531\u4e8e\u5728\u5de5\u4f5c\u4e2d\u4f7f\u7528Terraform\u7684\u673a\u4f1a\u589e\u591a\uff0c\u4f46\u5bf9\u5176\u4e2d\u7684\u4e00\u4e9b\u90e8\u5206\u4ecd\u7136\u7406\u89e3\u4e0d\u591f\uff0c\u4e3a\u4e86\u52a0\u6df1\u7406\u89e3\uff0c\u672c\u6b21\u5c06\u901a\u8fc7\u4f7f\u7528Te [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-48622","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4e3a\u4e86\u52a0\u6df1\u5bf9terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaazure\u7684\u5b58\u50a8\u8d26\u6237\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237\" \/>\n<meta property=\"og:description\" content=\"\u7531\u4e8e\u5728\u5de5\u4f5c\u4e2d\u4f7f\u7528Terraform\u7684\u673a\u4f1a\u589e\u591a\uff0c\u4f46\u5bf9\u5176\u4e2d\u7684\u4e00\u4e9b\u90e8\u5206\u4ecd\u7136\u7406\u89e3\u4e0d\u591f\uff0c\u4e3a\u4e86\u52a0\u6df1\u7406\u89e3\uff0c\u672c\u6b21\u5c06\u901a\u8fc7\u4f7f\u7528Te [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4e3a\u4e86\u52a0\u6df1\u5bf9terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaazure\u7684\u5b58\u50a8\u8d26\u6237\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-19T04:45:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T10:31:55+00:00\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/\",\"name\":\"\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-11-19T04:45:46+00:00\",\"dateModified\":\"2024-04-30T10:31:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u4e3a\u4e86\u52a0\u6df1\u5bf9terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaazure\u7684\u5b58\u50a8\u8d26\u6237\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237","og_description":"\u7531\u4e8e\u5728\u5de5\u4f5c\u4e2d\u4f7f\u7528Terraform\u7684\u673a\u4f1a\u589e\u591a\uff0c\u4f46\u5bf9\u5176\u4e2d\u7684\u4e00\u4e9b\u90e8\u5206\u4ecd\u7136\u7406\u89e3\u4e0d\u591f\uff0c\u4e3a\u4e86\u52a0\u6df1\u7406\u89e3\uff0c\u672c\u6b21\u5c06\u901a\u8fc7\u4f7f\u7528Te [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4e3a\u4e86\u52a0\u6df1\u5bf9terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaazure\u7684\u5b58\u50a8\u8d26\u6237\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-11-19T04:45:46+00:00","article_modified_time":"2024-04-30T10:31:55+00:00","author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/","name":"\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-11-19T04:45:46+00:00","dateModified":"2024-04-30T10:31:55+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4e3a\u4e86\u52a0\u6df1\u5bf9Terraform\u57fa\u7840\u7684\u7406\u89e3\uff0c\u5c1d\u8bd5\u6784\u5efaAzure\u7684\u5b58\u50a8\u8d26\u6237"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%b8%ba%e4%ba%86%e5%8a%a0%e6%b7%b1%e5%af%b9terraform%e5%9f%ba%e7%a1%80%e7%9a%84%e7%90%86%e8%a7%a3%ef%bc%8c%e5%b0%9d%e8%af%95%e6%9e%84%e5%bb%baazure%e7%9a%84%e5%ad%98%e5%82%a8%e8%b4%a6%e6%88%b7\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=48622"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48622\/revisions"}],"predecessor-version":[{"id":93574,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48622\/revisions\/93574"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=48622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=48622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=48622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}