HttpNamespaceProps

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

Bases: BaseNamespaceProps

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

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

ExampleMetadata:

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

Example:

import aws_cdk as cdk
import aws_cdk as servicediscovery

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

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

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

service1.register_non_ip_instance("NonIpInstance",
    custom_attributes={"arn": "arn:aws:s3:::amzn-s3-demo-bucket"}
)

service2 = namespace.create_service("IpService",
    description="service registering ip instances",
    health_check=cdk.aws_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

name

A name for the Namespace.