User Tools

Site Tools


aws:vpc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
aws:vpc [27/01/2022 11:33] – created - external edit 127.0.0.1aws:vpc [31/07/2025 13:08] (current) andrew
Line 1: Line 1:
 ====== Virtual Private Cloud (VPC) ====== ====== Virtual Private Cloud (VPC) ======
 +
 +FIXME intro blurb on VPC, AZ, subnets, IG / NAT gateway
 +
 +{{aws:st-setip_iot.png?300 |VPC with two AZ and subnets}}
 +
  
 ===== Show unused Security Groups ===== ===== Show unused Security Groups =====
Line 19: Line 24:
 rm security_groups.txt rm security_groups.txt
 </code> </code>
 +
 +
 +===== Get subnets in VPC =====
 +
 +
 +<code>
 +$ aws ec2 describe-subnets | jq .Subnets.[].SubnetId
 +"subnet-1234abcdab7899876"
 +"subnet-12341bcd207959876"
 +</code>
 +
 +
 +===== IPv4 Regex =====
 +
 +
 +This works in Cloudformation to tempate the allowed digits in and IPv4 address. Not exhaustively tested.
 +
 +<code>
 +"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(22))$"
 +</code>
 +
 +CF Template example:-
 +<code yaml>
 +  "Parameters": {
 +    "VPCCIDR": {
 +      "AllowedPattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(22))$",
 +      "ConstraintDescription": "CIDR block parameter must be in the form x.x.x.x/22",
 +      "Default": "192.168.192.0/22",
 +      "Description": "CIDR block for VPC",
 +      "Type": "String"
 +    }
 +</code>
 +
 +
 +This may bea better example:- [[https://ihateregex.io/expr/ip/]]
 +
 +
 +===== IPv6 Regex =====
 +
 +FIXME
  
  
aws/vpc.1643283196.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki