Skip to content

alexzhangs/aws-cfn-vpc-peer-requester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 

Repository files navigation

aws-cfn-vpc-peer-requester

AWS CloudFormation Stack for VPC Peering Requester.

Usage

stack.json

This repo contains a standard AWS CloudFormation template stack.json which can be deployed with AWS web console, AWS CLI or any other AWS CloudFormation compitable tool.

This repo can be used along with below repoes:

To create cross account VPC peer connections, one accepter peers with multi requesters. These repoes may make the process easier.

However you will need to make a new template to put all these together, put aws-cfn-vpc, aws-cfn-vpc-peer-accepter and aws-cfn-vpc-peer-requester as the nested stack of your new stack.

About how to do this, you may refer to a real world example aws-cfn-vpn, which put all these together, and is able to create one(accepter) to many(requester) cross account VPC peer connections.

This template will create an AWS CloudFormation stack, including following resources:

  • 1 peer connection between 2 VPCs.
  • 1 route entry in the route table for the peer connection.
  • 1 IAM role to give the Lambda function necessary permissions for the SQS, and the logs.
  • 1 Lambda function to send SQS messages to trigger the Lambda funcion in another VPC.
  • 1 CloudFormation Custom Resource to trigger the Lambda function of this stack.

For the input parameters and the detail of the template, please check the template file.

Troubleshooting

  1. CloudFormation Event: PeerConnection CREATE_FAILED: VpcPeeringConnection failed to stabilize. State: [failed]

Check following input parameters, make sure they were set right:

1. VpcPeerAccepterVpcId
2. VpcPeerAccepterRegion
3. VpcPeerAccepterAccountId
4. VpcPeerAccepterRoleArn
  1. The VPC peer connection is active but connecting to the IP of the resource in the peering VPC is timeout.

Check following AWS resources on the console:

 1. CloudWatch -> Logs, check the log of Lambda execution.
 2. VPC -> Route Tables -> Routes.
 3. Lambda - Functions.
 4. IAM - Role.

About

AWS CloudFormation Stack for VPC Peering Requester.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published