{"id":48658,"date":"2023-01-02T06:00:20","date_gmt":"2023-02-12T11:28:49","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/"},"modified":"2024-01-15T12:40:36","modified_gmt":"2024-01-15T04:40:36","slug":"%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/","title":{"rendered":"\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4"},"content":{"rendered":"<h2>\u4e0d\u597d\u7684\u6a21\u5f0f<\/h2>\n<p>\u8bf7\u5c06\u4ee5\u4e0b\u5185\u5bb9\u7528\u4e2d\u6587\u672c\u5730\u5316\uff0c\u4ec5\u9700\u8981\u4e00\u4e2a\u9009\u9879\uff1a<br \/>\n\u8fd9\u4e2a\u4e1c\u897f<\/p>\n<pre class=\"post-pre\"><code>resource \"aws_security_group\" \"test\" {\r\n    name        = \"test\"\r\n    vpc_id      = \"${aws_vpc.test.id}\"\r\n    ingress {\r\n        from_port       = 22\r\n        to_port         = 22\r\n        protocol        = \"tcp\"\r\n        cidr_blocks     = [\"x.x.x.x\/32\"]\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>\u5982\u679c\u8fd9\u6837\u6539\u53d8\u7684\u8bdd<\/p>\n<pre class=\"post-pre\"><code> resource \"aws_security_group\" \"test\" {\r\n     name        = \"test\"\r\n     vpc_id      = \"${aws_vpc.test.id}\"\r\n     ingress {\r\n         from_port       = 22\r\n         to_port         = 22\r\n         protocol        = \"tcp\"\r\n<span class=\"gd\">-        cidr_blocks     = [\"x.x.x.x\/32\"]\r\n<\/span><span class=\"gi\">+        cidr_blocks     = [\"x.x.x.x\/32\",\"y.y.y.y\/32\"]\r\n<\/span>     }\r\n }\r\n<\/code><\/pre>\n<p>\u65e5\u5fd7\u663e\u793a\u4e86\u4ee5\u4e0b\u60c5\u51b5\uff0c\u5dee\u5f02\u6709\u4e9b\u53ef\u7591\u3002\u770b\u8d77\u6765\u597d\u50cf\u5c06\u6240\u6709\u7684\u8fdb\u5165\u6d41\u91cf\u5220\u9664\uff0c\u7136\u540e\u518d\u6b21\u521b\u5efa\u4e86\u5168\u90e8\u7684\u6d41\u91cf\u3002<\/p>\n<pre class=\"post-pre\"><code>aws_security_group.test: Modifying...\r\n  ingress.2293169953.cidr_blocks.#:     \"1\" =&gt; \"0\"\r\n2016\/10\/27 18:33:14 [DEBUG] apply: aws_security_group.test: executing Apply\r\n  ingress.2293169953.cidr_blocks.0:     \"x.x.x.x\/32\" =&gt; \"\"\r\n  ingress.2293169953.from_port:         \"22\" =&gt; \"0\"\r\n  ingress.2293169953.protocol:          \"tcp\" =&gt; \"\"\r\n  ingress.2293169953.security_groups.#: \"0\" =&gt; \"0\"\r\n  ingress.2293169953.self:              \"0\" =&gt; \"0\"\r\n  ingress.2293169953.to_port:           \"22\" =&gt; \"0\"\r\n  ingress.3838495408.cidr_blocks.#:     \"0\" =&gt; \"2\"\r\n  ingress.3838495408.cidr_blocks.0:     \"\" =&gt; \"x.x.x.x\/32\"\r\n  ingress.3838495408.cidr_blocks.1:     \"\" =&gt; \"y.y.y.y\/32\"\r\n  ingress.3838495408.from_port:         \"\" =&gt; \"22\"\r\n  ingress.3838495408.protocol:          \"\" =&gt; \"tcp\"\r\n  ingress.3838495408.security_groups.#: \"0\" =&gt; \"0\"\r\n  ingress.3838495408.self:              \"\" =&gt; \"0\"\r\n  ingress.3838495408.to_port:           \"\" =&gt; \"22\"\r\n<\/code><\/pre>\n<p>\u5982\u679c\u8bbe\u7f6e\u4e86TF_LOG=DEBUG\u5e76\u8fd0\u884c\uff0c\u65e5\u5fd7\u5c06\u5982\u4e0b\u6240\u793a\uff0c\u5e76\u4e14\u4f1a\u611f\u5230\u6b63\u5728\u6267\u884c\u201cRevoke &amp; Authorize\u201d\u3002<\/p>\n<pre class=\"post-pre\"><code>2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws: 2016\/10\/27 18:33:15 [DEBUG] Revoking security group {\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   Description: \"Managed by Terraform\",\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   GroupName: \"test\",\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   IpPermissions: [{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       FromPort: 22,\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       IpProtocol: \"tcp\",\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       IpRanges: [{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:           CidrIp: \"x.x.x.x\/32\"\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:         }],\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       ToPort: 22\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:     }],\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws: } ingress rule: []*ec2.IpPermission{{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   FromPort: 22,\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   IpProtocol: \"tcp\",\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   IpRanges: [{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       CidrIp: \"x.x.x.x\/32\"\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:     }],\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   ToPort: 22\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws: }}\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws: 2016\/10\/27 18:33:15 [DEBUG] Authorizing security group {\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   Description: \"Managed by Terraform\",\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   GroupName: \"test\",\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   IpPermissions: [{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       FromPort: 22,\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       IpProtocol: \"tcp\",\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       IpRanges: [{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:           CidrIp: \"x.x.x.x\/32\"\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:         }],\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       ToPort: 22\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:     }],\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws: } ingress rule: []*ec2.IpPermission{{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   FromPort: 22,\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   IpProtocol: \"tcp\",\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   IpRanges: [{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       CidrIp: \"x.x.x.x\/32\"\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:     },{\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:       CidrIp: \"y.y.y.y\/32\"\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:     }],\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws:   ToPort: 22\r\n2016\/10\/27 18:33:15 [DEBUG] terraform-provider-aws: }}\r\n<\/code><\/pre>\n<p>\u9605\u8bfb\u6e90\u4ee3\u7801 https:\/\/github.com\/hashicorp\/terraform\/blob\/11b3b7cf29fa4120974d293458beac47e1eedd32\/builtin\/providers\/aws\/resource_aws_security_group.go#L552-L559<\/p>\n<pre class=\"post-pre\"><code>        \/\/ TODO: We need to handle partial state better in the in-between\r\n        \/\/ in this update.\r\n\r\n        \/\/ TODO: It'd be nicer to authorize before removing, but then we have\r\n        \/\/ to deal with complicated unrolling to get individual CIDR blocks\r\n        \/\/ to avoid authorizing already authorized sources. Removing before\r\n        \/\/ adding is easier here, and Terraform should be fast enough to\r\n        \/\/ not have service issues.\r\n<\/code><\/pre>\n<p>\u636e\u8bf4\uff0cTODO \u4ec5\u4ec5\u662f\u6682\u65f6\u672a\u5b8c\u6210\u7684\u9879\u76ee\u3002\u7531\u4e8eTerraform\u7684\u901f\u5ea6\u975e\u5e38\u5feb\uff0c\u53ef\u80fd\u4e0d\u4f1a\u53d1\u751f\u4efb\u4f55\u670d\u52a1\u95ee\u9898\uff08\u6839\u636e\u6211\u7684\u7406\u89e3\uff09\u3002<\/p>\n<h2>\u5177\u6709\u5b89\u5168\u611f\u548c\u653e\u5fc3\u7684\u6a21\u5f0f<\/h2>\n<p>\u4f7f\u7528aws_security_group_rule<\/p>\n<pre class=\"post-pre\"><code> resource \"aws_security_group\" \"test\" {\r\n     name        = \"test\"\r\n     vpc_id      = \"${aws_vpc.test.id}\"\r\n }\r\n\r\n resource \"aws_security_group_rule\" \"test_rule_1\" {\r\n     security_group_id = \"${aws_security_group.test.id}\"\r\n     type = \"ingress\"\r\n     from_port = 22\r\n     to_port = 22\r\n     protocol = \"tcp\"\r\n     cidr_blocks = [\"x.x.x.x\/32\"]\r\n }\r\n\r\n+resource \"aws_security_group_rule\" \"test_rule_2\" {\r\n<span class=\"gi\">+    security_group_id = \"${aws_security_group.test.id}\"\r\n+    type = \"ingress\"\r\n+    from_port = 22\r\n+    to_port = 22\r\n+    protocol = \"tcp\"\r\n+    cidr_blocks = [\"y.y.y.y\/32\"]\r\n+}\r\n<\/span><\/code><\/pre>\n<p>\u8fd9\u6837\u7684\u8bdd\u53ea\u9700\u8981\u6dfb\u52a0\u3002\u65e5\u5fd7\u5982\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code>2016\/10\/27 18:40:29 [DEBUG] apply: aws_security_group_rule.test_rule2: executing Apply\r\naws_security_group_rule.test: Creating...\r\n  cidr_blocks.#:            \"\" =&gt; \"1\"\r\n  cidr_blocks.0:            \"\" =&gt; \"y.y.y.y\/32\"\r\n  from_port:                \"\" =&gt; \"22\"\r\n  protocol:                 \"\" =&gt; \"tcp\"\r\n  self:                     \"\" =&gt; \"0\"\r\n\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws: 2016\/10\/27 18:40:30 [DEBUG] Authorizing security group sg-66d6231b Ingress rule: {\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:   FromPort: 22,\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:   IpProtocol: \"tcp\",\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:   IpRanges: [{\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:       CidrIp: \"y.y.y.y\/32\"\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:     }],\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:   ToPort: 22\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws: }\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws: 2016\/10\/27 18:40:30 [DEBUG] Found rule for Security Group Rule (sgrule-3952629376): {\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:   FromPort: 22,\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:   IpProtocol: \"tcp\",\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:   IpRanges: [{\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:       CidrIp: \"x.x.x.x\/32\"\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:     },{\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:       CidrIp: \"y.y.y.y\/32\"\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:     }],\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws:   ToPort: 22\r\n2016\/10\/27 18:40:30 [DEBUG] terraform-provider-aws: }\r\n<\/code><\/pre>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u5c1d\u8bd5\u5c06 from_port \u548c to_port \u76f8\u540c\u7684\u60c5\u51b5\u4e0b\u6dfb\u52a0\u5230 cidr_blocks \u6570\u7ec4\u5143\u7d20\u4e2d\uff0c\u4f1a\u5bfc\u81f4\u9500\u6bc1\u548c\u6dfb\u52a0\u7684\u60c5\u51b5\u53d1\u751f\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u4ee5\u4e0b\u65b9\u5f0f\u662f\u4e0d\u53ef\u884c\u7684\uff0c\u5e94\u8be5\u53e6\u5916\u51c6\u5907\u4e00\u4e2a aws_security_group_rule\u3002<\/p>\n<pre class=\"post-pre\"><code> resource \"aws_security_group\" \"test\" {\r\n     name        = \"test\"\r\n     vpc_id      = \"${aws_vpc.test.id}\"\r\n }\r\n\r\n resource \"aws_security_group_rule\" \"test_rule_1\" {\r\n     security_group_id = \"${aws_security_group.test.id}\"\r\n     type = \"ingress\"\r\n     from_port = 22\r\n     to_port = 22\r\n     protocol = \"tcp\"\r\n<span class=\"gd\">-    cidr_blocks = [\"x.x.x.x\/32\"]\r\n<\/span><span class=\"gi\">+    cidr_blocks = [\"x.x.x.x\/32\",\"y.y.y.y\/32\"]\r\n<\/span> }\r\n<\/code><\/pre>\n<h2>\u5bf9\u4e8e\u5b89\u5168\u7ec4\u7684\u77ed\u6682\u4e2d\u65ad\u8fdb\u884c\u601d\u8003\uff08\u8865\u5145\uff09<\/h2>\n<p>\u786e\u8ba4\u5220\u9664\u5b89\u5168\u7ec4\u7684\u5165\u53e3\u6216\u51fa\u53e3\u6761\u76ee\u4f1a\u963b\u6b62\u65b0\u7684\u8fde\u63a5\uff0c\u4f46\u4e0d\u4f1a\u65ad\u5f00\u5df2\u7ecf\u5efa\u7acb\u7684\u8fde\u63a5\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u53ea\u6709\u5728\u6267\u884c\u4e86&#8221;\u62d2\u7edd\u8bbf\u95ee&#8221;\u4e4b\u540e\u7acb\u5373\u6267\u884c&#8221;\u6388\u6743\u8bbf\u95ee&#8221;\u7684\u77ed\u65f6\u95f4\u5185\u51fa\u73b0\u65b0\u7684\u8fde\u63a5\u6216\u64cd\u4f5c\u65f6\u624d\u4f1a\u51fa\u73b0\u95ee\u9898\u3002\u5982\u679c\u662fTCP\u534f\u8bae\uff0c\u53ef\u4ee5\u7b49\u5f85\u4e00\u4e0b\uff08\u5728Linux\u4e0b\u9ed8\u8ba4\u4e3a1\u79d2\uff09\u518d\u91cd\u65b0\u8fde\u63a5\uff0c\u8fd9\u6837\u53ef\u4ee5\u5bb9\u5fcd\u8fd9\u6bb5\u77ed\u6682\u65f6\u95f4\uff1b\u800c\u5173\u952e\u95ee\u9898\u5219\u662f\u80fd\u5426\u5bb9\u5fcdUDP\u7684\u6570\u636e\u53d1\u9001\u5931\u8d25\u3002<\/p>\n<p>\u55ef\uff0c\u6beb\u65e0\u7591\u95ee\uff0c\u4f7f\u7528aws_security_group_rule\u66f4\u5b89\u5168\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0d\u597d\u7684\u6a21\u5f0f \u8bf7\u5c06\u4ee5\u4e0b\u5185\u5bb9\u7528\u4e2d\u6587\u672c\u5730\u5316\uff0c\u4ec5\u9700\u8981\u4e00\u4e2a\u9009\u9879\uff1a \u8fd9\u4e2a\u4e1c\u897f resource &#8220;aws_security [&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-48658","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>\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4 - 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\/\u4f7f\u7528terraform\u5b89\u5168\u5730\u66f4\u65b0aws\u5b89\u5168\u7ec4\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4\" \/>\n<meta property=\"og:description\" content=\"\u4e0d\u597d\u7684\u6a21\u5f0f \u8bf7\u5c06\u4ee5\u4e0b\u5185\u5bb9\u7528\u4e2d\u6587\u672c\u5730\u5316\uff0c\u4ec5\u9700\u8981\u4e00\u4e2a\u9009\u9879\uff1a \u8fd9\u4e2a\u4e1c\u897f resource &quot;aws_security [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528terraform\u5b89\u5168\u5730\u66f4\u65b0aws\u5b89\u5168\u7ec4\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-12T11:28:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-15T04:40:36+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=\"3 \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%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/\",\"name\":\"\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-02-12T11:28:49+00:00\",\"dateModified\":\"2024-01-15T04:40:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4\"}]},{\"@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%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4 - 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\/\u4f7f\u7528terraform\u5b89\u5168\u5730\u66f4\u65b0aws\u5b89\u5168\u7ec4\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4","og_description":"\u4e0d\u597d\u7684\u6a21\u5f0f \u8bf7\u5c06\u4ee5\u4e0b\u5185\u5bb9\u7528\u4e2d\u6587\u672c\u5730\u5316\uff0c\u4ec5\u9700\u8981\u4e00\u4e2a\u9009\u9879\uff1a \u8fd9\u4e2a\u4e1c\u897f resource \"aws_security [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528terraform\u5b89\u5168\u5730\u66f4\u65b0aws\u5b89\u5168\u7ec4\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-02-12T11:28:49+00:00","article_modified_time":"2024-01-15T04:40:36+00:00","author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/","name":"\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-02-12T11:28:49+00:00","dateModified":"2024-01-15T04:40:36+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528Terraform\u5b89\u5168\u5730\u66f4\u65b0AWS\u5b89\u5168\u7ec4"}]},{"@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%bd%bf%e7%94%a8terraform%e5%ae%89%e5%85%a8%e5%9c%b0%e6%9b%b4%e6%96%b0aws%e5%ae%89%e5%85%a8%e7%bb%84\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48658","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=48658"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48658\/revisions"}],"predecessor-version":[{"id":59552,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/48658\/revisions\/59552"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=48658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=48658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=48658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}