Class CloudMapNamespaceOptions
The options for creating an AWS Cloud Map namespace.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CloudMapNamespaceOptions : Object, ICloudMapNamespaceOptions
Syntax (vb)
Public Class CloudMapNamespaceOptions
Inherits Object
Implements ICloudMapNamespaceOptions
Remarks
ExampleMetadata: infused
Examples
Cluster cluster;
TaskDefinition taskDefinition;
ContainerDefinitionOptions containerOptions;
var container = taskDefinition.AddContainer("MyContainer", containerOptions);
container.AddPortMappings(new PortMapping {
Name = "api",
ContainerPort = 8080
});
cluster.AddDefaultCloudMapNamespace(new CloudMapNamespaceOptions {
Name = "local"
});
var service = new FargateService(this, "Service", new FargateServiceProps {
Cluster = cluster,
TaskDefinition = taskDefinition,
ServiceConnectConfiguration = new ServiceConnectProps {
Services = new [] { new ServiceConnectService {
PortMappingName = "api",
DnsName = "http-api",
Port = 80
} }
}
});
Synopsis
Constructors
CloudMapNamespaceOptions() |
Properties
Name | The name of the namespace, such as example.com. |
Type | The type of CloudMap Namespace to create. |
UseForServiceConnect | This property specifies whether to set the provided namespace as the service connect default in the cluster properties. |
Vpc | The VPC to associate the namespace with. |
Constructors
CloudMapNamespaceOptions()
public CloudMapNamespaceOptions()
Properties
Name
The name of the namespace, such as example.com.
public string Name { get; set; }
Property Value
System.String
Type
The type of CloudMap Namespace to create.
public Nullable<NamespaceType> Type { get; set; }
Property Value
System.Nullable<NamespaceType>
Remarks
Default: PrivateDns
UseForServiceConnect
This property specifies whether to set the provided namespace as the service connect default in the cluster properties.
public Nullable<bool> UseForServiceConnect { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Vpc
The VPC to associate the namespace with.
public IVpc Vpc { get; set; }
Property Value
Remarks
This property is required for private DNS namespaces.
Default: VPC of the cluster for Private DNS Namespace, otherwise none