use of com.amazonaws.services.rds.model.Endpoint in project Synapse-Stack-Builder by Sage-Bionetworks.
the class TestHelper method createTestResources.
/**
* Create GeneratedResources that can be used for a test.
*
* @param config
* @return
*/
public static GeneratedResources createTestResources(InputConfiguration config) {
GeneratedResources resources = new GeneratedResources();
resources.setIdGeneratorDatabase(new DBInstance().withDBInstanceIdentifier(config.getIdGeneratorDatabaseIdentifier()).withEndpoint(new Endpoint().withAddress("id-gen-db.someplace.com")));
resources.setStackInstancesDatabase(new DBInstance().withDBInstanceIdentifier(config.getStackInstanceDatabaseIdentifier()).withEndpoint(new Endpoint().withAddress("stack-instance-db.someplace.com")));
resources.setSearchDomain(new DomainStatus().withSearchService(new ServiceEndpoint().withEndpoint("search-service.someplace.com")));
resources.getSearchDomain().setDocService(new ServiceEndpoint().withEndpoint("doc-service.someplace.com"));
resources.setSslCertificate(StackEnvironmentType.REPO, new ServerCertificateMetadata().withArn("ssl:arn:123"));
resources.setSslCertificate(StackEnvironmentType.WORKERS, new ServerCertificateMetadata().withArn("ssl:arn:123"));
resources.setSslCertificate(StackEnvironmentType.PORTAL, new ServerCertificateMetadata().withArn("ssl:arn:456"));
resources.setACMCertificateArn(StackEnvironmentType.PORTAL, "arn:aws:acm:us-east1:123456789012:certificate/12345678-1234-1234-1234-123456789012");
resources.setACMCertificateArn(StackEnvironmentType.REPO, "arn:aws:acm:us-east1:123456789012:certificate/12345678-1234-1234-1234-223456789012");
resources.setACMCertificateArn(StackEnvironmentType.WORKERS, "arn:aws:acm:us-east1:123456789012:certificate/12345678-1234-1234-1234-323456789012");
resources.setPortalApplicationVersion(new ApplicationVersionDescription().withVersionLabel(config.getVersionLabel(PREFIX_PORTAL)));
resources.setRepoApplicationVersion(new ApplicationVersionDescription().withVersionLabel(config.getVersionLabel(PREFIX_REPO)));
resources.setWorkersApplicationVersion(new ApplicationVersionDescription().withVersionLabel(config.getVersionLabel(PREFIX_WORKERS)));
resources.setStackKeyPair(new KeyPairInfo().withKeyName(config.getStackKeyPairName()));
// Add tables database instances
List<DBInstance> tablesInstances = new LinkedList<DBInstance>();
tablesInstances.add(new DBInstance().withEndpoint(new Endpoint().withAddress("tables.endpoint.one")));
tablesInstances.add(new DBInstance().withEndpoint(new Endpoint().withAddress("tables.endpoint.two")));
resources.setStackInstanceTablesDatabases(tablesInstances);
return resources;
}
Aggregations