HttpNamespaceProps

class aws_cdk.aws_servicediscovery.HttpNamespaceProps(*, description=None, name)

Bases: aws_cdk.aws_servicediscovery.BaseNamespaceProps

Parameters
  • description (Optional[str]) – A description of the Namespace. Default: none

  • name (str) – A name for the Namespace.

Example:

import aws_cdk.core as cdk
import aws_cdk.aws_servicediscovery as servicediscovery

app = cdk.App()
stack = cdk.Stack(app, "aws-servicediscovery-integ")

namespace = servicediscovery.HttpNamespace(stack, "MyNamespace",
    name="covfefe"
)

service1 = namespace.create_service("NonIpService",
    description="service registering non-ip instances"
)

service1.register_non_ip_instance("NonIpInstance",
    custom_attributes={"arn": "arn:aws:s3:::mybucket"}
)

service2 = namespace.create_service("IpService",
    description="service registering ip instances",
    health_check=servicediscovery.HealthCheckConfig(
        type=servicediscovery.HealthCheckType.HTTP,
        resource_path="/check"
    )
)

service2.register_ip_instance("IpInstance",
    ipv4="54.239.25.192"
)

app.synth()

Attributes

description

A description of the Namespace.

Default

none

Return type

Optional[str]

name

A name for the Namespace.

Return type

str