use of de.widdix.awscftemplates.Context in project aws-cf-templates by widdix.
the class TestRDSAurora method testMySQL57.
@Test
public void testMySQL57() {
final Context context = new Context();
final String vpcStackName = "vpc-2azs-" + this.random8String();
final String clientStackName = "client-" + this.random8String();
final String stackName = "rds-aurora-" + 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-aurora.yaml", new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName), new Parameter().withParameterKey("ParentClientStack").withParameterValue(clientStackName), new Parameter().withParameterKey("Engine").withParameterValue("aurora-mysql"), 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 TestRDSAurora method testWithSecret.
@Test
public void testWithSecret() {
final Context context = new Context();
final String vpcStackName = "vpc-2azs-" + this.random8String();
final String clientStackName = "client-" + this.random8String();
final String secretStackName = "secret-" + this.random8String();
final String stackName = "rds-aurora-" + 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, secretStackName, "state/secretsmanager-dbsecret.yaml");
try {
this.createStack(context, stackName, "state/rds-aurora.yaml", new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName), new Parameter().withParameterKey("ParentClientStack").withParameterValue(clientStackName), new Parameter().withParameterKey("ParentSecretStack").withParameterValue(secretStackName), new Parameter().withParameterKey("DBName").withParameterValue("db1"));
// 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, secretStackName);
}
} 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 TestRDSAuroraServerlessPostgres method testWithSecret.
@Test
public void testWithSecret() {
final Context context = new Context();
final String vpcStackName = "vpc-2azs-" + this.random8String();
final String clientStackName = "client-" + this.random8String();
final String kmsKeyStackName = "key-" + this.random8String();
final String secretStackName = "secret-" + this.random8String();
final String stackName = "rds-aurora-serverless-postgres-" + 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, kmsKeyStackName, "security/kms-key.yaml");
try {
this.createStack(context, secretStackName, "state/secretsmanager-dbsecret.yaml");
try {
this.createStack(context, stackName, "state/rds-aurora-serverless-postgres.yaml", new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName), new Parameter().withParameterKey("ParentClientStack").withParameterValue(clientStackName), new Parameter().withParameterKey("ParentKmsKeyStack").withParameterValue(kmsKeyStackName), new Parameter().withParameterKey("ParentSecretStack").withParameterValue(secretStackName), new Parameter().withParameterKey("DBName").withParameterValue("db1"));
// 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, secretStackName);
}
} finally {
this.deleteStack(context, kmsKeyStackName);
}
} 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 TestRDSPostgres method testWithSecret.
@Test
public void testWithSecret() {
final Context context = new Context();
final String vpcStackName = "vpc-2azs-" + this.random8String();
final String clientStackName = "client-" + this.random8String();
final String secretStackName = "secret-" + this.random8String();
final String stackName = "rds-postgres-" + 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, secretStackName, "state/secretsmanager-dbsecret.yaml");
try {
this.createStack(context, stackName, "state/rds-postgres.yaml", new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName), new Parameter().withParameterKey("ParentClientStack").withParameterValue(clientStackName), new Parameter().withParameterKey("ParentSecretStack").withParameterValue(secretStackName), new Parameter().withParameterKey("DBName").withParameterValue("db1"));
// 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, secretStackName);
}
} 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 TestAL2MutablePublic method testWithIAMUserSSHAccess.
@Test
public void testWithIAMUserSSHAccess() throws Exception {
final Context context = new Context();
final String vpcStackName = "vpc-2azs-" + this.random8String();
final String stackName = "al2-mutable-public-" + this.random8String();
final String classB = "10";
final String userName = "user-" + this.random8String();
try {
final User user = this.createUser(userName);
try {
this.createStack(context, vpcStackName, "vpc/vpc-2azs.yaml", new Parameter().withParameterKey("ClassB").withParameterValue(classB));
try {
this.createStack(context, stackName, "ec2/al2-mutable-public.yaml", new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName), new Parameter().withParameterKey("IAMUserSSHAccess").withParameterValue("true"));
final String host = this.getStackOutputValue(stackName, "PublicIPAddress");
this.probeSSH(context, host, user);
} finally {
this.deleteStack(context, stackName);
}
} finally {
this.deleteStack(context, vpcStackName);
}
} finally {
this.deleteUser(context, userName);
}
}
Aggregations