mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(ec2): VPC endpoint compatibility for AWS SDK/Terraform (#1476)
- emit routeTableIdSet/subnetIdSet items as plain text (AWS SDK for Go could not deserialize the wrapped form) - add DescribePrefixLists returning managed S3/DynamoDB prefix lists - honor private_dns_enabled (default true for interface endpoints) Adds Ec2IntegrationTest coverage and documents the new actions.
This commit is contained in:
1 parent
238294e779
commit
7efb280dbc
7 files changed
+152
-5
No files matched your search
@@ -1004,7 +1004,7 @@ class Ec2IntegrationTest {
|
||||
.statusCode(200)
|
||||
.body("CreateVpcEndpointResponse.vpcEndpoint.vpcEndpointId", startsWith("vpce-"))
|
||||
.body("CreateVpcEndpointResponse.vpcEndpoint.vpcId", equalTo(vpcId))
|
||||
.body("CreateVpcEndpointResponse.vpcEndpoint.routeTableIdSet.item.routeTableId",
|
||||
.body("CreateVpcEndpointResponse.vpcEndpoint.routeTableIdSet.item",
|
||||
equalTo(routeTableId))
|
||||
.extract().path("CreateVpcEndpointResponse.vpcEndpoint.vpcEndpointId");
|
||||
}
|
||||
@@ -2580,4 +2580,63 @@ class Ec2IntegrationTest {
|
||||
.then().statusCode(400)
|
||||
.body("Response.Errors.Error.Code", equalTo("DependencyViolation"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(315)
|
||||
void describePrefixListsReturnsManagedS3() {
|
||||
String prefixListId = given()
|
||||
.formParam("Action", "DescribePrefixLists")
|
||||
.formParam("Filter.1.Name", "prefix-list-name")
|
||||
.formParam("Filter.1.Value.1", "com.amazonaws.us-east-1.s3")
|
||||
.header("Authorization", AUTH_HEADER)
|
||||
.when().post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("DescribePrefixListsResponse.prefixListSet.item.prefixListName",
|
||||
equalTo("com.amazonaws.us-east-1.s3"))
|
||||
.body("DescribePrefixListsResponse.prefixListSet.item.prefixListId", startsWith("pl-"))
|
||||
.extract().path("DescribePrefixListsResponse.prefixListSet.item.prefixListId");
|
||||
|
||||
// The prefix-list-id filter must narrow results to the matching list only.
|
||||
given()
|
||||
.formParam("Action", "DescribePrefixLists")
|
||||
.formParam("Filter.1.Name", "prefix-list-id")
|
||||
.formParam("Filter.1.Value.1", prefixListId)
|
||||
.header("Authorization", AUTH_HEADER)
|
||||
.when().post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("DescribePrefixListsResponse.prefixListSet.item.prefixListId", equalTo(prefixListId))
|
||||
.body("DescribePrefixListsResponse.prefixListSet.item.prefixListName",
|
||||
equalTo("com.amazonaws.us-east-1.s3"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(316)
|
||||
void interfaceEndpointPrivateDnsEnabledByDefault() {
|
||||
String vpc = newVpc("10.36.0.0/16");
|
||||
String subnet = given()
|
||||
.formParam("Action", "CreateSubnet")
|
||||
.formParam("VpcId", vpc)
|
||||
.formParam("CidrBlock", "10.36.1.0/24")
|
||||
.header("Authorization", AUTH_HEADER)
|
||||
.when().post("/")
|
||||
.then().statusCode(200)
|
||||
.extract().path("CreateSubnetResponse.subnet.subnetId");
|
||||
|
||||
given()
|
||||
.formParam("Action", "CreateVpcEndpoint")
|
||||
.formParam("VpcId", vpc)
|
||||
.formParam("ServiceName", "com.amazonaws.us-east-1.ssm")
|
||||
.formParam("VpcEndpointType", "Interface")
|
||||
.formParam("SubnetId.1", subnet)
|
||||
.header("Authorization", AUTH_HEADER)
|
||||
.when().post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("CreateVpcEndpointResponse.vpcEndpoint.privateDnsEnabled", equalTo("true"))
|
||||
// subnetIdSet item text must be the plain id (not a wrapped <subnetId> element),
|
||||
// otherwise the AWS SDK for Go fails to deserialize interface endpoints.
|
||||
.body("CreateVpcEndpointResponse.vpcEndpoint.subnetIdSet.item", equalTo(subnet));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user