Register Instance
servicediscovery_register_instance | R Documentation |
Creates or updates one or more records and, optionally, creates a health check based on the settings in a specified service¶
Description¶
Creates or updates one or more records and, optionally, creates a health
check based on the settings in a specified service. When you submit a
register_instance
request, the following occurs:
-
For each DNS record that you define in the service that's specified by
ServiceId
, a record is created or updated in the hosted zone that's associated with the corresponding namespace. -
If the service includes
HealthCheckConfig
, a health check is created based on the settings in the health check configuration. -
The health check, if any, is associated with each of the new or updated records.
One register_instance
request must complete before you can submit
another request and specify the same service ID and instance ID.
For more information, see create_service
.
When Cloud Map receives a DNS query for the specified DNS name, it returns the applicable value:
-
If the health check is healthy: returns all the records
-
If the health check is unhealthy: returns the applicable value for the last healthy instance
-
If you didn't specify a health check configuration: returns all the records
For the current quota on the number of instances that you can register using the same namespace and using the same service, see Cloud Map quotas in the Cloud Map Developer Guide.
Usage¶
servicediscovery_register_instance(ServiceId, InstanceId,
CreatorRequestId, Attributes)
Arguments¶
ServiceId |
[required] The ID of the service that you want to use for settings for the instance. |
InstanceId |
[required] An identifier that you want to associate with the instance. Note the following:
Do not include sensitive information in |
CreatorRequestId |
A unique string that identifies the request and that allows
failed |
Attributes |
[required] A string map that contains the following information
for the service that you specify in
Do not include sensitive information in the attributes if the namespace is discoverable by public DNS queries. The following are the supported attribute keys. AWS_ALIAS_DNS_NAME If you want Cloud Map to create an Amazon Route 53 alias record that routes traffic to an Elastic Load Balancing load balancer, specify the DNS name that's associated with the load balancer. For information about how to get the DNS name, see "DNSName" in the topic AliasTarget in the Route 53 API Reference. Note the following:
AWS_EC2_INSTANCE_ID HTTP namespaces only. The Amazon EC2 instance ID for the
instance. If the AWS_INIT_HEALTH_STATUS If the service configuration includes
AWS_INSTANCE_CNAME If the service configuration includes a This value is required if the service specified by
AWS_INSTANCE_IPV4 If the service configuration includes an This value is required if the service specified by
AWS_INSTANCE_IPV6 If the service configuration includes an This value is required if the service specified by
AWS_INSTANCE_PORT If the service includes an If the service includes This value is required if you specified settings for an
Custom attributes You can add up to 30 custom attributes. For each key-value pair, the maximum length of the attribute name is 255 characters, and the maximum length of the attribute value is 1,024 characters. The total size of all provided attributes (sum of all keys and values) must not exceed 5,000 characters. |
Value¶
A list with the following syntax:
list(
OperationId = "string"
)
Request syntax¶
svc$register_instance(
ServiceId = "string",
InstanceId = "string",
CreatorRequestId = "string",
Attributes = list(
"string"
)
)
Examples¶
## Not run:
# Example: Register Instance
svc$register_instance(
Attributes = list(
AWS_INSTANCE_IPV4 = "172.2.1.3",
AWS_INSTANCE_PORT = "808"
),
CreatorRequestId = "7a48a98a-72e6-4849-bfa7-1a458e030d7b",
InstanceId = "myservice-53",
ServiceId = "srv-p5zdwlg5uvvzjita"
)
## End(Not run)