@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.378Z") @Stability(value=Stable) 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 another AWS account and can be in a different Region to 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 .
For more information, see Walkthough: Peer with a VPC in another AWS account .
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. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnVPCPeeringConnection(software.constructs.Construct scope,
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 |
|---|---|
String |
getAttrId() |
protected Map<String,Object> |
getCfnProperties() |
String |
getPeerOwnerId()
The AWS account ID of the owner of the accepter VPC.
|
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.
|
String |
getPeerRoleArn()
The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account.
|
String |
getPeerVpcId()
The ID of the VPC with which you are creating the VPC peering connection.
|
TagManager |
getTags()
Any tags assigned to the resource.
|
String |
getVpcId()
The ID of the VPC.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setPeerOwnerId(String value)
The AWS account ID of the owner of the accepter VPC.
|
void |
setPeerRegion(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(String value)
The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account.
|
void |
setPeerVpcId(String value)
The ID of the VPC with which you are creating the VPC peering connection.
|
void |
setVpcId(String value)
The ID of the VPC.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnVPCPeeringConnection(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnVPCPeeringConnection(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnVPCPeeringConnection(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
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.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrId()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public String getPeerVpcId()
You must specify this parameter in the request.
@Stability(value=Stable)
public void setPeerVpcId(@NotNull
String value)
You must specify this parameter in the request.
@Stability(value=Stable) @NotNull public String getVpcId()
@Stability(value=Stable)
public void setVpcId(@NotNull
String value)
@Stability(value=Stable) @Nullable public String getPeerOwnerId()
Default: Your AWS account ID
@Stability(value=Stable)
public void setPeerOwnerId(@Nullable
String value)
Default: Your AWS account ID
@Stability(value=Stable) @Nullable public String getPeerRegion()
Default: The Region in which you make the request.
@Stability(value=Stable)
public void setPeerRegion(@Nullable
String value)
Default: The Region in which you make the request.
@Stability(value=Stable) @Nullable public String getPeerRoleArn()
This is required when you are peering a VPC in a different AWS account.
@Stability(value=Stable)
public void setPeerRoleArn(@Nullable
String value)
This is required when you are peering a VPC in a different AWS account.
Copyright © 2022. All rights reserved.