mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(cloudformation): resolve stacks by ARN in addition to name (#386)
This commit is contained in:
1 parent
9ffb26497d
commit
035a99d018
2 files changed
+106
-5
No files matched your search
+56
@@ -488,6 +488,62 @@ class CloudFormationIntegrationTest {
|
||||
.body(not(containsString("my-changeset")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void describeStackEvents_byArn() {
|
||||
String template = """
|
||||
{
|
||||
"Resources": {
|
||||
"MyBucket": {
|
||||
"Type": "AWS::S3::Bucket",
|
||||
"Properties": {
|
||||
"BucketName": "arn-events-test-bucket"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
""";
|
||||
|
||||
// 1. Create stack and capture the ARN
|
||||
String createResponse = given()
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.formParam("Action", "CreateStack")
|
||||
.formParam("StackName", "arn-events-stack")
|
||||
.formParam("TemplateBody", template)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<StackId>"))
|
||||
.extract().asString();
|
||||
|
||||
// Extract the ARN from the response
|
||||
String stackArn = createResponse.substring(
|
||||
createResponse.indexOf("<StackId>") + "<StackId>".length(),
|
||||
createResponse.indexOf("</StackId>"));
|
||||
|
||||
// 2. Describe stack events using the ARN
|
||||
given()
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.formParam("Action", "DescribeStackEvents")
|
||||
.formParam("StackName", stackArn)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<StackName>arn-events-stack</StackName>"));
|
||||
|
||||
// 3. Describe stacks using the ARN
|
||||
given()
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.formParam("Action", "DescribeStacks")
|
||||
.formParam("StackName", stackArn)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(containsString("<StackName>arn-events-stack</StackName>"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void deleteChangeSet_nonExistentChangeSet_returnsError() {
|
||||
String template = """
|
||||
|
||||
Reference in new issue
Block a user