Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public addDefaultCloudMapNamespace(options: CloudMapNamespaceOptions): cloudmap.INamespace {
if (this._defaultCloudMapNamespace !== undefined) {
throw new Error("Can only add default namespace once.");
}
const namespaceType = options.type !== undefined
? options.type
: cloudmap.NamespaceType.DNS_PRIVATE;
const sdNamespace = namespaceType === cloudmap.NamespaceType.DNS_PRIVATE ?
new cloudmap.PrivateDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', {
name: options.name,
vpc: this.vpc
}) :
new cloudmap.PublicDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', {
name: options.name,
});
this._defaultCloudMapNamespace = sdNamespace;
return sdNamespace;
}
public addDefaultCloudMapNamespace(options: CloudMapNamespaceOptions): cloudmap.INamespace {
if (this._defaultCloudMapNamespace !== undefined) {
throw new Error("Can only add default namespace once.");
}
const namespaceType = options.type !== undefined
? options.type
: cloudmap.NamespaceType.DNS_PRIVATE;
const sdNamespace = namespaceType === cloudmap.NamespaceType.DNS_PRIVATE ?
new cloudmap.PrivateDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', {
name: options.name,
vpc: this.vpc
}) :
new cloudmap.PublicDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', {
name: options.name,
});
this._defaultCloudMapNamespace = sdNamespace;
return sdNamespace;
}
public addDefaultCloudMapNamespace(options: CloudMapNamespaceOptions): cloudmap.INamespace {
if (this._defaultCloudMapNamespace !== undefined) {
throw new Error("Can only add default namespace once.");
}
const namespaceType = options.type !== undefined
? options.type
: cloudmap.NamespaceType.DNS_PRIVATE;
const sdNamespace = namespaceType === cloudmap.NamespaceType.DNS_PRIVATE ?
new cloudmap.PrivateDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', {
name: options.name,
vpc: this.vpc
}) :
new cloudmap.PublicDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', {
name: options.name,
});
this._defaultCloudMapNamespace = sdNamespace;
return sdNamespace;
}