AWS-VPC-2

VPC Endpoints

Primary Issue

Some of the services and resources from AWS do not exist in VPC itself but in AWS. If there is a service from VPC needs to access the AWS services or resources, it has to pass through the public internet and then go back to AWS. This will make the cost higher and slow the speed. 

Solution - VPC endpoints

That is the reason why VPC endpoint here for resolving the wasting issue.

Interface endpoints: PrivateLink

Private link could provide a private connection through the inner AWS internet connect between AWS services or resources and VPCs (under the same or different accounts) ENI (Elastic Network Interface), no need to expose to the public internet.

Gateway endpoints: Gateway

VPC Endpoint Gateway provides the connection between S3 or DynamoDB and VPC, through the router, any service could connect VPC Endpoint Gateway with normal way.

VPC Peering

  1. VPC peering provides a connection between two VPCs which do not have CIDR overlapping.
  2. The connected VPCs is able to be distributed in different regions, called Inter-Region.
  3. The relationship between these two VPCs cannot be transferred (A -> B, B -> C, but A !-> C).
  4. The limitation in inter-region:
    • The security group in different VPCs could not be referred to.
    • Doesn't support IPv6
    • Doesn't support Jumbo Frame
  5. One of each connected VPC could not access resources through the other VPC by VPN connection/DX, Internet Gateway, NAT, and VPC endpoints.

Transit VPC

Transit VPC provides connections between user local data center to multiple VPCs, using Transit VPC(Hub) could reduce workload (if not, the user has to make full-mapping), but the user needs to maintain an EC2 to set up a VPN connection.

Transit Gateway

  1. According to the dialog above, the corporate data center could connect to Transit VPC, and the Transit VPC could connect to multiple VPCs. The corporate data center could access multiple (1 to 1) VPCs through the Transit VPC, but for every two VPCs, there is no way to connect to each other directly no matter through the Transit VPC or others.
  2. Transit Gateway could allow the local corporate data center(s) to connect to the Transit VPC. All other VPCs could attach to the Transit Gateway for making the Transit VPC like a hub. (Not only VPC, like VPC and DX could connect to this Transit Gateway).
  3. The scope of Transit Gateway is Region when the user wants to bind a VPC to the Transit Gateway, he/she needs to pick a subnet from each AZ to attach to the Transit Gateway.
  4. In short, all VPC or others could be communicated once it attaches to the Transit VPC.

NACL (Network Access Control List)

  1. When the user initialing a VPC, there is a default NACL got created and be used for this VPC (as default, the NACL doesn't allow any data flow).
  2. NACL allows all inbound and outbound data flow.
  3. NACL is bonded to subnet, but the security group is existed inside of subnet for the instances of services or resources in the subnet.
  4. If creating a new subnet, it will be associated with the default NACL.
  5. NACL is stateless, the user has to configure both inbound and outbound to be allowed. But for the security group, because it is stateful, only need to configure any one of these two, the other will be allowed automatically.
  6. NACL has rule number which is for the sequence, only need one rule satisfied, then it will allow the data flow. The security group has to be satisfied with all rules for allowing data flow.
  7. NACL rules: 
    • Rule Number
    • Protocol
    • Port Range (Destination Port)
    • Source (CIDR)
    • Allow/Deny (NACL can configure allow or deny rules, but the security group only can configure the allow rules.)

Security Group

    1. Only could set allowed rules
    2. There is no sequence limitation, which following the sequence to check whether could handle any rule. If the request is accepted, then it must be satisfied with all of the rules.
    3. Stateful (sync the inbound and outbound)
    4. The resource could bound more security groups, and the security group also could bound to multi resources
    5. In default, all of the instances could communicate with each other which belongs to the same security group, and doesn't allow all inbound data flow from outside of the security group
    6. Security Group Rules
      • Protocol
      • Port Range (Destination Port)
      • Source (CIDR or another security group from the same region)
      • Description

    Comments

    Popular posts from this blog

    Union Find 模板

    Tree的经典题

    Tree DFS