NonIpInstanceBaseProps

class aws_cdk.aws_servicediscovery.NonIpInstanceBaseProps(*, custom_attributes=None, instance_id=None)

Bases: BaseInstanceProps

Parameters:
  • custom_attributes (Optional[Mapping[str, str]]) – Custom attributes of the instance. Default: none

  • instance_id (Optional[str]) – The id of the instance resource. Default: Automatically generated name

ExampleMetadata:

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

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

custom_attributes

Custom attributes of the instance.

Default:

none

instance_id

The id of the instance resource.

Default:

Automatically generated name