use of de.widdix.awscftemplates.Context in project aws-cf-templates by widdix.
the class TestRDSMySQL method test.
@Test
public void test() {
final Context context = new Context();
final String vpcStackName = "vpc-2azs-" + this.random8String();
final String clientStackName = "client-" + this.random8String();
final String stackName = "rds-mysql-" + this.random8String();
final String password = this.random8String();
try {
this.createStack(context, vpcStackName, "vpc/vpc-2azs.yaml");
try {
this.createStack(context, clientStackName, "state/client-sg.yaml", new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName));
try {
this.createStack(context, stackName, "state/rds-mysql.yaml", new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName), new Parameter().withParameterKey("ParentClientStack").withParameterValue(clientStackName), new Parameter().withParameterKey("DBName").withParameterValue("db1"), new Parameter().withParameterKey("DBMasterUserPassword").withParameterValue(password));
// TODO how can we check if this stack works? start a bastion host and try to connect?
} finally {
this.deleteStack(context, stackName);
}
} finally {
this.deleteStack(context, clientStackName);
}
} finally {
this.deleteStack(context, vpcStackName);
}
}
use of de.widdix.awscftemplates.Context in project aws-cf-templates by widdix.
the class TestS3 method test.
@Test
public void test() {
final Context context = new Context();
final String stackName = "s3-" + this.random8String();
try {
this.createStack(context, stackName, "state/s3.yaml");
// TODO how can we check if this stack works?
} finally {
this.deleteStack(context, stackName);
}
}
use of de.widdix.awscftemplates.Context in project aws-cf-templates by widdix.
the class TestVPC3AZs method test.
@Test
public void test() {
final Context context = new Context();
final String stackName = "vpc-3azs-" + this.random8String();
try {
this.createStack(context, stackName, "vpc/vpc-3azs.yaml", new Parameter().withParameterKey("ClassB").withParameterValue("10"));
this.testVPCSubnetInternetAccess(context, stackName, "SubnetAPublic");
this.testVPCSubnetInternetAccess(context, stackName, "SubnetBPublic");
this.testVPCSubnetInternetAccess(context, stackName, "SubnetCPublic");
} finally {
this.deleteStack(context, stackName);
}
}
use of de.widdix.awscftemplates.Context in project aws-cf-templates by widdix.
the class TestVPC4AZs method test.
@Test
public void test() {
final Context context = new Context();
final String stackName = "vpc-4azs-" + this.random8String();
try {
this.createStack(context, stackName, "vpc/vpc-4azs.yaml", new Parameter().withParameterKey("ClassB").withParameterValue("10"));
this.testVPCSubnetInternetAccess(context, stackName, "SubnetAPublic");
this.testVPCSubnetInternetAccess(context, stackName, "SubnetBPublic");
this.testVPCSubnetInternetAccess(context, stackName, "SubnetCPublic");
this.testVPCSubnetInternetAccess(context, stackName, "SubnetDPublic");
} finally {
this.deleteStack(context, stackName);
}
}
use of de.widdix.awscftemplates.Context in project aws-cf-templates by widdix.
the class TestVPCEndpointDynamoDB method test.
@Test
public void test() {
final Context context = new Context();
final String vpcStackName = "vpc-2azs-" + this.random8String();
final String endpointStackName = "vpc-endpoint-dynamodb-" + this.random8String();
final String classB = "10";
try {
this.createStack(context, vpcStackName, "vpc/vpc-2azs.yaml", new Parameter().withParameterKey("ClassB").withParameterValue(classB));
try {
this.createStack(context, endpointStackName, "vpc/vpc-endpoint-dynamodb.yaml", new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName));
// TODO how can we check if this stack works?
} finally {
this.deleteStack(context, endpointStackName);
}
} finally {
this.deleteStack(context, vpcStackName);
}
}
Aggregations