Show / Hide Table of Contents

Class HttpNamespace

Define an HTTP Namespace.

Inheritance
object
Resource
HttpNamespace
Implements
IHttpNamespace
INamespace
IResource
IConstruct
IDependable
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.ServiceDiscovery
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class HttpNamespace : Resource, IHttpNamespace, INamespace, IResource, IConstruct, IDependable
Syntax (vb)
Public Class HttpNamespace Inherits Resource Implements IHttpNamespace, INamespace, IResource, IConstruct, IDependable
Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

Examples
using Amazon.CDK;
            using Amazon.CDK;

            var app = new App();
            var stack = new Stack(app, "aws-servicediscovery-integ");

            var namespace = new HttpNamespace(stack, "MyNamespace", new HttpNamespaceProps {
                Name = "MyHTTPNamespace"
            });

            var service1 = namespace.CreateService("NonIpService", new BaseServiceProps {
                Description = "service registering non-ip instances"
            });

            service1.RegisterNonIpInstance("NonIpInstance", new NonIpInstanceBaseProps {
                CustomAttributes = new Dictionary<string, string> { { "arn", "arn:aws:s3:::amzn-s3-demo-bucket" } }
            });

            var service2 = namespace.CreateService("IpService", new BaseServiceProps {
                Description = "service registering ip instances",
                HealthCheck = new HealthCheckConfig {
                    Type = HealthCheckType.HTTP,
                    ResourcePath = "/check"
                }
            });

            service2.RegisterIpInstance("IpInstance", new IpInstanceBaseProps {
                Ipv4 = "54.239.25.192"
            });

            app.Synth();

Synopsis

Constructors

HttpNamespace(Construct, string, IHttpNamespaceProps)

Define an HTTP Namespace.

Properties

HttpNamespaceArn

Define an HTTP Namespace.

HttpNamespaceId

Define an HTTP Namespace.

HttpNamespaceName

Define an HTTP Namespace.

NamespaceArn

Namespace Arn for the namespace.

NamespaceId

Namespace Id for the namespace.

NamespaceName

A name for the namespace.

PROPERTY_INJECTION_ID

Uniquely identifies this class.

Type

Type of the namespace.

Methods

CreateService(string, IBaseServiceProps?)

Creates a service within the namespace.

FromHttpNamespaceAttributes(Construct, string, IHttpNamespaceAttributes)

Define an HTTP Namespace.

Constructors

HttpNamespace(Construct, string, IHttpNamespaceProps)

Define an HTTP Namespace.

public HttpNamespace(Construct scope, string id, IHttpNamespaceProps props)
Parameters
scope Construct
id string
props IHttpNamespaceProps
Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

Examples
using Amazon.CDK;
            using Amazon.CDK;

            var app = new App();
            var stack = new Stack(app, "aws-servicediscovery-integ");

            var namespace = new HttpNamespace(stack, "MyNamespace", new HttpNamespaceProps {
                Name = "MyHTTPNamespace"
            });

            var service1 = namespace.CreateService("NonIpService", new BaseServiceProps {
                Description = "service registering non-ip instances"
            });

            service1.RegisterNonIpInstance("NonIpInstance", new NonIpInstanceBaseProps {
                CustomAttributes = new Dictionary<string, string> { { "arn", "arn:aws:s3:::amzn-s3-demo-bucket" } }
            });

            var service2 = namespace.CreateService("IpService", new BaseServiceProps {
                Description = "service registering ip instances",
                HealthCheck = new HealthCheckConfig {
                    Type = HealthCheckType.HTTP,
                    ResourcePath = "/check"
                }
            });

            service2.RegisterIpInstance("IpInstance", new IpInstanceBaseProps {
                Ipv4 = "54.239.25.192"
            });

            app.Synth();

Properties

HttpNamespaceArn

Define an HTTP Namespace.

public virtual string HttpNamespaceArn { get; }
Property Value

string

Remarks

Attribute: true

HttpNamespaceId

Define an HTTP Namespace.

public virtual string HttpNamespaceId { get; }
Property Value

string

Remarks

Attribute: true

HttpNamespaceName

Define an HTTP Namespace.

public virtual string HttpNamespaceName { get; }
Property Value

string

Remarks

Attribute: true

NamespaceArn

Namespace Arn for the namespace.

public virtual string NamespaceArn { get; }
Property Value

string

Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

NamespaceId

Namespace Id for the namespace.

public virtual string NamespaceId { get; }
Property Value

string

Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

NamespaceName

A name for the namespace.

public virtual string NamespaceName { get; }
Property Value

string

Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

Type

Type of the namespace.

public virtual NamespaceType Type { get; }
Property Value

NamespaceType

Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

Methods

CreateService(string, IBaseServiceProps?)

Creates a service within the namespace.

public virtual Service CreateService(string id, IBaseServiceProps? props = null)
Parameters
id string
props IBaseServiceProps
Returns

Service

Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

FromHttpNamespaceAttributes(Construct, string, IHttpNamespaceAttributes)

Define an HTTP Namespace.

public static IHttpNamespace FromHttpNamespaceAttributes(Construct scope, string id, IHttpNamespaceAttributes attrs)
Parameters
scope Construct
id string
attrs IHttpNamespaceAttributes
Returns

IHttpNamespace

Remarks

ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused

Examples
using Amazon.CDK;
            using Amazon.CDK;

            var app = new App();
            var stack = new Stack(app, "aws-servicediscovery-integ");

            var namespace = new HttpNamespace(stack, "MyNamespace", new HttpNamespaceProps {
                Name = "MyHTTPNamespace"
            });

            var service1 = namespace.CreateService("NonIpService", new BaseServiceProps {
                Description = "service registering non-ip instances"
            });

            service1.RegisterNonIpInstance("NonIpInstance", new NonIpInstanceBaseProps {
                CustomAttributes = new Dictionary<string, string> { { "arn", "arn:aws:s3:::amzn-s3-demo-bucket" } }
            });

            var service2 = namespace.CreateService("IpService", new BaseServiceProps {
                Description = "service registering ip instances",
                HealthCheck = new HealthCheckConfig {
                    Type = HealthCheckType.HTTP,
                    ResourcePath = "/check"
                }
            });

            service2.RegisterIpInstance("IpInstance", new IpInstanceBaseProps {
                Ipv4 = "54.239.25.192"
            });

            app.Synth();

Implements

IHttpNamespace
INamespace
IResource
Constructs.IConstruct
Constructs.IDependable
Back to top Generated by DocFX