@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:42.895Z") public class CfnVPCPeeringConnection extends CfnResource implements IInspectable
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to a different AWS account and can be in a different Region than the requester VPC.
The requester VPC and accepter VPC cannot have overlapping CIDR blocks. If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed
.
If the VPCs belong to different accounts, the acceptor account must have a role that allows the requester account to accept the VPC peering connection. For more information, see Walkthough: Peer with a VPC in another AWS account .
If the requester and acceptor VPCs are in the same account, the peering request is accepted without a peering role.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.ec2.*; CfnVPCPeeringConnection cfnVPCPeeringConnection = CfnVPCPeeringConnection.Builder.create(this, "MyCfnVPCPeeringConnection") .peerVpcId("peerVpcId") .vpcId("vpcId") // the properties below are optional .peerOwnerId("peerOwnerId") .peerRegion("peerRegion") .peerRoleArn("peerRoleArn") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnVPCPeeringConnection.Builder
A fluent builder for
CfnVPCPeeringConnection . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnVPCPeeringConnection(Construct scope,
java.lang.String id,
CfnVPCPeeringConnectionProps props)
Create a new `AWS::EC2::VPCPeeringConnection`.
|
protected |
CfnVPCPeeringConnection(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnVPCPeeringConnection(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrId()
The ID of the peering connection.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getPeerOwnerId()
The AWS account ID of the owner of the accepter VPC.
|
java.lang.String |
getPeerRegion()
The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.
|
java.lang.String |
getPeerRoleArn()
The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account.
|
java.lang.String |
getPeerVpcId()
The ID of the VPC with which you are creating the VPC peering connection.
|
TagManager |
getTags()
Any tags assigned to the resource.
|
java.lang.String |
getVpcId()
The ID of the VPC.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setPeerOwnerId(java.lang.String value)
The AWS account ID of the owner of the accepter VPC.
|
void |
setPeerRegion(java.lang.String value)
The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.
|
void |
setPeerRoleArn(java.lang.String value)
The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account.
|
void |
setPeerVpcId(java.lang.String value)
The ID of the VPC with which you are creating the VPC peering connection.
|
void |
setVpcId(java.lang.String value)
The ID of the VPC.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnVPCPeeringConnection(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnVPCPeeringConnection(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnVPCPeeringConnection(Construct scope, java.lang.String id, CfnVPCPeeringConnectionProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrId()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.lang.String getPeerVpcId()
You must specify this parameter in the request.
public void setPeerVpcId(java.lang.String value)
You must specify this parameter in the request.
public java.lang.String getVpcId()
public void setVpcId(java.lang.String value)
public java.lang.String getPeerOwnerId()
Default: Your AWS account ID
public void setPeerOwnerId(java.lang.String value)
Default: Your AWS account ID
public java.lang.String getPeerRegion()
Default: The Region in which you make the request.
public void setPeerRegion(java.lang.String value)
Default: The Region in which you make the request.
public java.lang.String getPeerRoleArn()
This is required when you are peering a VPC in a different AWS account.
public void setPeerRoleArn(java.lang.String value)
This is required when you are peering a VPC in a different AWS account.