<commit_before># etc/cross-account-vpc-peering-accepter.yml
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >-
  Creates resources to support the accepter side of an already-created VPC
  peering connection.

Parameters:
  DestinationCidrBlock:
    Type: String
    Description: >-
      The IPv4 CIDR address block used for the destination match.
  VpcPeeringConnectionId:
    Type: String
    Description: >-
      The VPC peering connection that will be added to the route table
  RouteTable:
    Type: String
    Description: >-
      A route will be added to the table for the VPR peering connection
  AllowDnsResolutionFromRemoteVpc:
    Type: String
    Description: >-
      Indicates whether DNS queries from the remote (requester) VPC for public
      hostnames resolve to private IP addresses in the local (accepter) VPC
    AllowedValues:
      - Enabled
      - Disabled

Resources:
  Route:
    Type: AWS::EC2::Route
    Properties:
      RouteTableId: !Ref RouteTable
      VpcPeeringConnectionId: !Ref VpcPeeringConnectionId
      DestinationCidrBlock: !Ref DestinationCidrBlock

  VpcPeeringConnectionOptionsCustomResource:
    Type: AWS::CloudFormation::CustomResource
    Properties:
      ServiceToken: !GetAtt ModifyVpcPeeringConnectionOptionsFunction.Arn
      AllowDnsResolutionFromRemoteVpc: !Ref AllowDnsResolutionFromRemoteVpc
      VpcPeeringConnectionId: !Ref VpcPeeringConnectionId

  ModifyVpcPeeringConnectionOptionsFunction:
    Type: AWS::Serverless::Function
    Properties:
      Description: >-
        Handles CloudFormation custom resource requests for modifying VPC
        peering connection options from the accepter side
      Handler: index.handler<commit_msg>Support multiple route tables in VPC peering accepter stack<commit_after># etc/cross-account-vpc-peering-accepter.yml
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >-
  Creates resources to support the accepter side of an already-created VPC
  peering connection.

Parameters:
  DestinationCidrBlock:
    Type: String
    Description: >-
      The IPv4 CIDR address block used for the destination match.
  VpcPeeringConnectionId:
    Type: String
    Description: >-
      The VPC peering connection that will be added to the route table
  PublicRouteTableId:
    Type: String
    Description: >-
      A route will be added to the table for the VPR peering connection
  PrivateRouteTableId:
    Type: String
    Description: >-
      A route will be added to the table for the VPR peering connection
  AllowDnsResolutionFromRemoteVpc:
    Type: String
    Description: >-
      Indicates whether DNS queries from the remote (requester) VPC for public
      hostnames resolve to private IP addresses in the local (accepter) VPC
    AllowedValues:
      - Enabled
      - Disabled

Conditions:
  HasPublicRouteTableId: !Not [!Equals [!Ref PrivateRouteTableId, ""]]
  HasPrivateRouteTableId: !Not [!Equals [!Ref PrivateRouteTableId, ""]]

Resources:
  PublicRoute:
    Type: AWS::EC2::Route
    Condition: HasPublicRouteTableId
    Properties:
      RouteTableId: !Ref PublicRouteTableId
      VpcPeeringConnectionId: !Ref VpcPeeringConnectionId
      DestinationCidrBlock: !Ref DestinationCidrBlock
  PrivateRoute:
    Type: AWS::EC2::Route
    Condition: HasPrivateRouteTableId
    Properties:
      RouteTableId: !Ref PrivateRouteTableId
      VpcPeeringConnectionId: !Ref VpcPeeringConnectionId
      DestinationCidrBlock: !Ref DestinationCidrBlock

  VpcPeeringConnectionOptionsCustomResource:
    Type: AWS::CloudFormation::CustomResource
    Properties:
      ServiceToken: !GetAtt ModifyVpcPeeringConnectionOptionsFunction.Arn
      AllowDnsResolutionFromRemoteVpc: !Ref AllowDnsResolutionFromRemoteVpc
      VpcPeeringConnectionId: !Ref VpcPeeringConnectionId

  ModifyVpcPeeringConnectionOptionsFunction:
    Type: AWS::Serverless::Function
    Properties:
      Description: >-
        Handles CloudFormation custom resource requests for modifying VPC
        peering connection options from the accepter side
      Handler: index.handler
{'fraction_non_alphanumeric': 0.05633462282398453, 'fraction_numerical': 0.008945841392649903, 'mean_word_length': 3.8958579881656803, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3511438', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1158, 'n_words': 344}