{"id":12168,"date":"2023-06-03T18:51:39","date_gmt":"2023-06-03T09:51:39","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=12168"},"modified":"2023-06-11T09:16:41","modified_gmt":"2023-06-11T00:16:41","slug":"aws%e3%81%aevpc%e3%81%ab%e5%af%be%e3%81%97%e3%81%a6%e3%82%b5%e3%83%96%e3%83%8d%e3%83%83%e3%83%88%e3%82%92%e4%bd%9c%e6%88%90%ef%bc%8f%e5%89%8a%e9%99%a4%ef%bc%8f%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/12168","title":{"rendered":"AWS\u306eVPC\u306b\u5bfe\u3057\u3066\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u4f5c\u6210\uff0f\u524a\u9664\uff0f\u8868\u793a\u3059\u308b\uff01\uff08AWS CLI\uff09"},"content":{"rendered":"<p>AWS\u306eVPC\u306b\u5bfe\u3057\u3066\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u3001AWS CLI\u3067\u4f5c\u6210\u3001\u524a\u9664\u3001\u8868\u793a\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08aws ec2 create-subnet\uff09<\/h2>\n<p>VPC\u3068AZ\u3068CIDR\u3092\u6307\u5b9a\u3057\u3066\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002AZ\u306f\u3001Zone ID\u3092\u6307\u5b9a\u3057\u3066\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ aws ec2 create-subnet \\\r\n    --vpc-id vpc-09e9993280674f6ed \\\r\n    --availability-zone-id apne1-az1 \\\r\n    --cidr-block 10.111.1.0\/24\r\n{\r\n    &quot;Subnet&quot;: {\r\n        &quot;AvailabilityZone&quot;: &quot;ap-northeast-1c&quot;,\r\n        &quot;AvailabilityZoneId&quot;: &quot;apne1-az1&quot;,\r\n        &quot;AvailableIpAddressCount&quot;: 251,\r\n        &quot;CidrBlock&quot;: &quot;10.111.1.0\/24&quot;,\r\n        &quot;DefaultForAz&quot;: false,\r\n        &quot;MapPublicIpOnLaunch&quot;: false,\r\n        &quot;State&quot;: &quot;available&quot;,\r\n        &quot;SubnetId&quot;: &quot;subnet-02afadc6bd9e8f59a&quot;,\r\n        &quot;VpcId&quot;: &quot;vpc-09e9993280674f6ed&quot;,\r\n        &quot;OwnerId&quot;: &quot;XXXXXXXXXXXX&quot;,\r\n        &quot;AssignIpv6AddressOnCreation&quot;: false,\r\n        &quot;Ipv6CidrBlockAssociationSet&quot;: &#x5B;],\r\n        &quot;SubnetArn&quot;: &quot;arn:aws:ec2:ap-northeast-1:580383548794:subnet\/subnet-02afadc6bd9e8f59a&quot;,\r\n        &quot;EnableDns64&quot;: false,\r\n        &quot;Ipv6Native&quot;: false,\r\n        &quot;PrivateDnsNameOptionsOnLaunch&quot;: {\r\n            &quot;HostnameType&quot;: &quot;ip-name&quot;,\r\n            &quot;EnableResourceNameDnsARecord&quot;: false,\r\n            &quot;EnableResourceNameDnsAAAARecord&quot;: false\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<h2>\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u8868\u793a\u3059\u308b\uff01\uff08aws ec2 describe-subnets\uff09<\/h2>\n<p>\u4f5c\u6210\u3057\u305f\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ aws ec2 describe-subnets --subnet-id=subnet-02afadc6bd9e8f59a\r\n{\r\n    &quot;Subnets&quot;: &#x5B;\r\n        {\r\n            &quot;AvailabilityZone&quot;: &quot;ap-northeast-1c&quot;,\r\n            &quot;AvailabilityZoneId&quot;: &quot;apne1-az1&quot;,\r\n            &quot;AvailableIpAddressCount&quot;: 251,\r\n            &quot;CidrBlock&quot;: &quot;10.111.1.0\/24&quot;,\r\n            &quot;DefaultForAz&quot;: false,\r\n            &quot;MapPublicIpOnLaunch&quot;: false,\r\n            &quot;MapCustomerOwnedIpOnLaunch&quot;: false,\r\n            &quot;State&quot;: &quot;available&quot;,\r\n            &quot;SubnetId&quot;: &quot;subnet-02afadc6bd9e8f59a&quot;,\r\n            &quot;VpcId&quot;: &quot;vpc-09e9993280674f6ed&quot;,\r\n            &quot;OwnerId&quot;: &quot;XXXXXXXXXXXX&quot;,\r\n            &quot;AssignIpv6AddressOnCreation&quot;: false,\r\n            &quot;Ipv6CidrBlockAssociationSet&quot;: &#x5B;],\r\n            &quot;SubnetArn&quot;: &quot;arn:aws:ec2:ap-northeast-1:580383548794:subnet\/subnet-02afadc6bd9e8f59a&quot;,\r\n            &quot;EnableDns64&quot;: false,\r\n            &quot;Ipv6Native&quot;: false,\r\n            &quot;PrivateDnsNameOptionsOnLaunch&quot;: {\r\n                &quot;HostnameType&quot;: &quot;ip-name&quot;,\r\n                &quot;EnableResourceNameDnsARecord&quot;: false,\r\n                &quot;EnableResourceNameDnsAAAARecord&quot;: false\r\n            }\r\n        }\r\n    ]\r\n}\r\n<\/pre>\n<h2>\u30b5\u30d6\u30cd\u30c3\u30c8\u306b\u30bf\u30b0\u3092\u3064\u3051\u308b\uff01\uff08aws ec2 create-tags --resources\uff09<\/h2>\n<p>\u30bf\u30b0\u3092\u3064\u3051\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ aws ec2 create-tags --resources subnet-02afadc6bd9e8f59a --tags Key=Name,Value=vpc01-subnet01\r\n<\/pre>\n<h2>\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u524a\u9664\u3059\u308b\uff01\uff08aws ec2 delete-subnet\uff09<\/h2>\n<p>\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ aws ec2 delete-subnet --subnet-id=subnet-02afadc6bd9e8f59a\r\n<\/pre>\n<h2>\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u524a\u9664\u3057\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\uff01\uff08aws ec2 describe-subnets\uff09<\/h2>\n<p>\u30b5\u30d6\u30cd\u30c3\u30c8\u304c\u524a\u9664\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ aws ec2 describe-subnets --subnet-id=subnet-02afadc6bd9e8f59a\r\n\r\nAn error occurred (InvalidSubnetID.NotFound) when calling the DescribeSubnets operation: The subnet ID 'subnet-02afadc6bd9e8f59a' does not exist\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u30b5\u30d6\u30cd\u30c3\u30c8\u306f\u3001VPC\u3068\u30a2\u30d9\u30a4\u30e9\u30d3\u30ea\u30c6\u30a3\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u3066\u4f5c\u6210\u3057\u307e\u3059\u3002\u30a2\u30d9\u30a4\u30e9\u30d3\u30ea\u30c6\u30a3\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u306a\u3044\u3068\u4efb\u610f\u306e\u30be\u30fc\u30f3\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002\u30a2\u30d9\u30a4\u30e9\u30d3\u30ea\u30c6\u30a3\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u3067\u3059\u304c\u3001\u30be\u30fc\u30f3\u540d\u306f\u30be\u30fc\u30f3ID\u3068\u306e\u5bfe\u5fdc\u304c\u30a2\u30ab\u30a6\u30f3\u30c8\u3054\u3068\u306b\u7570\u306a\u308b\u306e\u3067\u3001\u30be\u30fc\u30f3ID\u3092\u6307\u5b9a\u3057\u305f\u307b\u3046\u304c\u7121\u96e3\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/12156\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/04\/eyecatch_aws_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\uff01<\/div><div class=\"substr\">AWS\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/12112\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u3092\u64cd\u4f5c\u3059\u308b\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/04\/eyecatch_aws_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u3092\u64cd\u4f5c\u3059\u308b\uff01<\/div><div class=\"substr\">AWS\u3092\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/8161\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/04\/eyecatch_aws_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011AWS\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">AWS\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWS\u306eVPC\u306b\u5bfe\u3057\u3066\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u3001AWS CLI\u3067\u4f5c\u6210\u3001\u524a\u9664\u3001\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":8172,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[376],"tags":[288,372,377,309],"class_list":["post-12168","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-network-aws","tag-aws","tag-vpc","tag-377","tag-309"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/12168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=12168"}],"version-history":[{"count":8,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/12168\/revisions"}],"predecessor-version":[{"id":12256,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/12168\/revisions\/12256"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/8172"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=12168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=12168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=12168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}