-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug Fix] state/s3 - Ownership controls & public access block config
- Loading branch information
1 parent
6e988df
commit a2beb75
Showing
2 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 64 additions & 3 deletions
67
test/src/test/java/de/widdix/awscftemplates/state/TestS3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,82 @@ | ||
package de.widdix.awscftemplates.state; | ||
|
||
import com.amazonaws.services.cloudformation.model.Parameter; | ||
import de.widdix.awscftemplates.ACloudFormationTest; | ||
import de.widdix.awscftemplates.Context; | ||
import org.junit.Test; | ||
|
||
public class TestS3 extends ACloudFormationTest { | ||
|
||
@Test | ||
public void test() { | ||
private void test(final String access) { | ||
final Context context = new Context(); | ||
final String stackName = "s3-" + this.random8String(); | ||
try { | ||
this.createStack(context, stackName, "state/s3.yaml"); | ||
this.createStack(context, stackName, "state/s3.yaml", | ||
new Parameter().withParameterKey("Access").withParameterValue(access)); | ||
// TODO how can we check if this stack works? | ||
} finally { | ||
this.deleteStack(context, stackName); | ||
} | ||
} | ||
|
||
@Test | ||
public void testPrivate() { | ||
this.test("Private"); | ||
} | ||
|
||
@Test | ||
public void testPublicRead() { | ||
this.test("PublicRead"); | ||
} | ||
|
||
@Test | ||
public void testPublicWrite() { | ||
this.test("PublicWrite"); | ||
} | ||
|
||
@Test | ||
public void testPublicReadAndWrite() { | ||
this.test("PublicReadAndWrite"); | ||
} | ||
|
||
@Test | ||
public void testCloudFrontRead() { | ||
this.test("CloudFrontRead"); | ||
} | ||
|
||
@Test | ||
public void testCloudFrontAccessLogWrite() { | ||
this.test("CloudFrontAccessLogWrite"); | ||
} | ||
|
||
@Test | ||
public void testElbAccessLogWrite() { | ||
this.test("ElbAccessLogWrite"); | ||
} | ||
|
||
@Test | ||
public void testS3AccessLogWrite) { | ||
this.test("S3AccessLogWrite"); | ||
} | ||
|
||
@Test | ||
public void testConfigWrite() { | ||
this.test("ConfigWrite"); | ||
} | ||
|
||
@Test | ||
public void testCloudTrailWrite() { | ||
this.test("CloudTrailWrite"); | ||
} | ||
|
||
@Test | ||
public void testVpcEndpointRead() { | ||
this.test("VpcEndpointRead"); | ||
} | ||
|
||
@Test | ||
public void testFlowLogWrite() { | ||
this.test("FlowLogWrite"); | ||
} | ||
|
||
} |