enhancement Create-VPC-endpoint
This commit is contained in:
parent
56887073aa
commit
84100c4483
4 changed files with 215 additions and 0 deletions
|
|
@ -618,3 +618,39 @@ def test_describe_route_tables_with_nat_gateway():
|
|||
nat_gw_routes[0]["DestinationCidrBlock"].should.equal("0.0.0.0/0")
|
||||
nat_gw_routes[0]["NatGatewayId"].should.equal(nat_gw_id)
|
||||
nat_gw_routes[0]["State"].should.equal("active")
|
||||
|
||||
|
||||
@mock_ec2
|
||||
def test_create_vpc_end_point():
|
||||
|
||||
ec2 = boto3.client("ec2", region_name="us-west-1")
|
||||
vpc = ec2.create_vpc(CidrBlock="10.0.0.0/16")
|
||||
subnet = ec2.create_subnet(VpcId=vpc["Vpc"]["VpcId"],
|
||||
CidrBlock="10.0.0.0/24")
|
||||
|
||||
route_table = ec2.create_route_table(VpcId=vpc["Vpc"]["VpcId"])
|
||||
|
||||
vpc_end_point = ec2.create_vpc_endpoint(
|
||||
VpcId=vpc["Vpc"]["VpcId"],
|
||||
ServiceName="com.amazonaws.us-east-1.s3",
|
||||
RouteTableIds=[route_table["RouteTable"]["RouteTableId"]]
|
||||
)
|
||||
|
||||
vpc_end_point["VpcEndpoint"]["ServiceName"].\
|
||||
should.equal("com.amazonaws.us-east-1.s3")
|
||||
vpc_end_point["VpcEndpoint"]["RouteTableIds"][0].\
|
||||
should.equal(route_table["RouteTable"]["RouteTableId"])
|
||||
vpc_end_point["VpcEndpoint"]["VpcId"].should.equal(vpc["Vpc"]["VpcId"])
|
||||
|
||||
vpc_end_point = ec2.create_vpc_endpoint(
|
||||
VpcId=vpc["Vpc"]["VpcId"],
|
||||
ServiceName="com.amazonaws.us-east-1.s3",
|
||||
SubnetIds=[subnet["Subnet"]["SubnetId"]],
|
||||
VpcEndpointType="interface"
|
||||
)
|
||||
|
||||
vpc_end_point["VpcEndpoint"]["ServiceName"].\
|
||||
should.equal("com.amazonaws.us-east-1.s3")
|
||||
vpc_end_point["VpcEndpoint"]["SubnetIds"][0].\
|
||||
should.equal(subnet["Subnet"]["SubnetId"])
|
||||
vpc_end_point["VpcEndpoint"]["VpcId"].should.equal(vpc["Vpc"]["VpcId"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue