I wrote a CloudFormation template, which among other stuff also creates a VPC peering connection.
If you are familiar with VPC peerings then you know that after the creation, a request is created and waiting for approval.
I'd like to add to the outputs portion of the CloudFormation template the VPC peering connection request id.
Is that possible? I couldn't find the way...
Edit:
This is the relevant portion of the template:
"Resources" : {
"VPC": {
"Type" : "AWS::EC2::VPC",
"Description" : "Choose which VPC the security groups should be deployed to",
"Properties" : {
"CidrBlock" : "172.51.0.0/16",
"EnableDnsSupport" : "true",
"EnableDnsHostnames" : "true",
"InstanceTenancy" : "default"
}
},
"VPCPeering" : {
"Type" : "AWS::EC2::VPCPeeringConnection",
"Properties" : {
"PeerVpcId" : "vpc-2XXXXXb",
"VpcId" : { "Ref" : "VPC" }
}
},
I'm using Jenkins with the CloudFormation plugin to issue the creation of a new stack.
I want the new stack to automatically create peering between the VPC that the stack creates and the existing management VPC.
My plan was to issue the creation through the template, and then once the creation completes, I intended to use AWS Cli (from Jenkins) to accept the peering request and since this step requires me to know the vpc peering request id, then I wanted to output it using the "Outputs" : {}
section of the template.
Can it be done?