Я пытаюсь vpc пиринга между двумя разными регионами.Здесь я уже создал ресурсы, теперь я просто хочу передать их идентификаторы в качестве параметров.В этом же регионе я могу смотреть между двумя VPC.Но я получаю ошибку в двух разных регионах, так как route_id не существует.
Мой шаблон ниже:
AWSTemplateFormatVersion: '2010-09-09'
Description: ''
Parameters:
PeerVPCAccountId:
Type: String
Description: "Peer VPC Account ID"
Default: (Acc_id)
PeerVPCRegion:
Type: String
Description: "Peer Region"
Default: (region)
VPC1:
Description: VPC Id of DataPipeline
Type: AWS::EC2::VPC::Id
Default: (vpc_id)
VPC1CIDRRange:
Description: The IP address range of DataPipeline VPC.
Type: String
MinLength: '9'
MaxLength: '18'
Default: (vpc_range)
AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
VPC1PrivateSubnet1CIDRRange:
Description: The IP address range for Private Subnet 1 in DataPipeline.
Type: String
MinLength: '9'
MaxLength: '18'
Default: (vpc_subnet_range)
AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
VPC1Private1Route:
Description: RouteTableId of Private Subnet 1 for DataPipeline
Type: String
Default: (vpc_subnet_route_id)
VPC2:
Description: VPC Id of PII-Isolation Pipeline
Type: String
Default: (vpc_id)
VPC2CIDRRange:
Description: The IP address range of PII Pipeline VPC.
Type: String
MinLength: '9'
MaxLength: '18'
AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
Default: (vpc_range)
VPC2PrivateSubnet1CIDRRange:
Description: The IP address range for Private Subnet 1 in PII Pipeline.
Type: String
MinLength: '9'
MaxLength: '18'
AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
Default: (vpc_subnet_range)
VPC2Private1Route:
Description: RouteTableId of Private Subnet 1 for PII Pipeline
Type: String
Default: (vpc_subnet_route_id)
Resources:
peerRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Statement:
- Principal:
AWS: !Ref PeerVPCAccountId
Action:
- 'sts:AssumeRole'
Effect: Allow
Path: /
Policies:
- PolicyName: root
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: 'ec2:AcceptVpcPeeringConnection'
Resource: '*'
VPC1Private1PeeringRoute1:
Type: AWS::EC2::Route
Properties:
DestinationCidrBlock:
Ref: VPC2PrivateSubnet1CIDRRange
RouteTableId:
Ref: VPC1Private1Route
VpcPeeringConnectionId:
Ref: myVPCPeeringConnection
VPC2Private1PeeringRoute1:
Type: AWS::EC2::Route
Properties:
DestinationCidrBlock:
Ref: VPC1PrivateSubnet1CIDRRange
RouteTableId:
Ref: VPC2Private1Route
VpcPeeringConnectionId:
Ref: myVPCPeeringConnection
myVPCPeeringConnection:
Type: AWS::EC2::VPCPeeringConnection
Properties:
VpcId:
Ref: VPC1
PeerVpcId:
Ref: VPC2
PeerOwnerId:
Ref: PeerVPCAccountId
PeerRegion:
Ref: PeerVPCRegion
PeerRoleArn: !GetAtt
- peerRole
- Arn
Я дал все, что хочет шаблон, все еще показывая мне эту ошибку.Может ли кто-нибудь помочь изменить его или указать на ошибку?