AWS Cloud Map

2021/06/30 - AWS Cloud Map - 3 new 5 updated api methods

Changes  AWS Cloud Map now allows configuring the TTL of the SOA record for a hosted zone to control the negative caching for new services.

UpdateHttpNamespace (new) Link ¶

Updates an HTTP namespace.

See also: AWS API Documentation

Request Syntax

client.update_http_namespace(
    Id='string',
    UpdaterRequestId='string',
    Namespace={
        'Description': 'string'
    }
)
type Id

string

param Id

[REQUIRED]

The ID of the namespace that you want to update.

type UpdaterRequestId

string

param UpdaterRequestId

A unique string that identifies the request and that allows failed UpdateHttpNamespace requests to be retried without the risk of running the operation twice. UpdaterRequestId can be any unique string (for example, a date/timestamp).

This field is autopopulated if not provided.

type Namespace

dict

param Namespace

[REQUIRED]

Updated properties for the the HTTP namespace.

  • Description (string) -- [REQUIRED]

    An updated description for the HTTP namespace.

rtype

dict

returns

Response Syntax

{
    'OperationId': 'string'
}

Response Structure

  • (dict) --

    • OperationId (string) --

      A value that you can use to determine whether the request completed successfully. To get the status of the operation, see GetOperation.

UpdatePrivateDnsNamespace (new) Link ¶

Updates a private DNS namespace.

See also: AWS API Documentation

Request Syntax

client.update_private_dns_namespace(
    Id='string',
    UpdaterRequestId='string',
    Namespace={
        'Description': 'string',
        'Properties': {
            'DnsProperties': {
                'SOA': {
                    'TTL': 123
                }
            }
        }
    }
)
type Id

string

param Id

[REQUIRED]

The ID of the namespace that you want to update.

type UpdaterRequestId

string

param UpdaterRequestId

A unique string that identifies the request and that allows failed UpdatePrivateDnsNamespace requests to be retried without the risk of running the operation twice. UpdaterRequestId can be any unique string (for example, a date/timestamp).

This field is autopopulated if not provided.

type Namespace

dict

param Namespace

[REQUIRED]

Updated properties for the private DNS namespace.

  • Description (string) --

    An updated description for the private DNS namespace.

  • Properties (dict) --

    Properties to be updated in the private DNS namespace.

    • DnsProperties (dict) -- [REQUIRED]

      Updated DNS properties for the private DNS namespace.

      • SOA (dict) -- [REQUIRED]

        Updated fields for the Start of Authority (SOA) record for the hosted zone for the private DNS namespace.

        • TTL (integer) -- [REQUIRED]

          The updated time to live (TTL) for purposes of negative caching.

rtype

dict

returns

Response Syntax

{
    'OperationId': 'string'
}

Response Structure

  • (dict) --

    • OperationId (string) --

      A value that you can use to determine whether the request completed successfully. To get the status of the operation, see GetOperation.

UpdatePublicDnsNamespace (new) Link ¶

Updates a public DNS namespace.

See also: AWS API Documentation

Request Syntax

client.update_public_dns_namespace(
    Id='string',
    UpdaterRequestId='string',
    Namespace={
        'Description': 'string',
        'Properties': {
            'DnsProperties': {
                'SOA': {
                    'TTL': 123
                }
            }
        }
    }
)
type Id

string

param Id

[REQUIRED]

The ID of the namespace being updated.

type UpdaterRequestId

string

param UpdaterRequestId

A unique string that identifies the request and that allows failed UpdatePublicDnsNamespace requests to be retried without the risk of running the operation twice. UpdaterRequestId can be any unique string (for example, a date/timestamp).

This field is autopopulated if not provided.

type Namespace

dict

param Namespace

[REQUIRED]

Updated properties for the public DNS namespace.

  • Description (string) --

    An updated description for the public DNS namespace.

  • Properties (dict) --

    Properties to be updated in the public DNS namespace.

    • DnsProperties (dict) -- [REQUIRED]

      Updated DNS properties for the hosted zone for the public DNS namespace.

      • SOA (dict) -- [REQUIRED]

        Updated fields for the Start of Authority (SOA) record for the hosted zone for the public DNS namespace.

        • TTL (integer) -- [REQUIRED]

          The updated time to live (TTL) for purposes of negative caching.

rtype

dict

returns

Response Syntax

{
    'OperationId': 'string'
}

Response Structure

  • (dict) --

    • OperationId (string) --

      A value that you can use to determine whether the request completed successfully. To get the status of the operation, see GetOperation.

CreatePrivateDnsNamespace (updated) Link ¶
Changes (request)
{'Properties': {'DnsProperties': {'SOA': {'TTL': 'long'}}}}

Creates a private namespace based on DNS, which is visible only inside a specified Amazon VPC. The namespace defines your service naming scheme. For example, if you name your namespace example.com and name your service backend , the resulting DNS name for the service is backend.example.com . Service instances that are registered using a private DNS namespace can be discovered using either a DiscoverInstances request or using DNS. For the current quota on the number of namespaces that you can create using the same account, see Cloud Map quotas in the Cloud Map Developer Guide .

See also: AWS API Documentation

Request Syntax

client.create_private_dns_namespace(
    Name='string',
    CreatorRequestId='string',
    Description='string',
    Vpc='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    Properties={
        'DnsProperties': {
            'SOA': {
                'TTL': 123
            }
        }
    }
)
type Name

string

param Name

[REQUIRED]

The name that you want to assign to this namespace. When you create a private DNS namespace, Cloud Map automatically creates an Amazon Route 53 private hosted zone that has the same name as the namespace.

type CreatorRequestId

string

param CreatorRequestId

A unique string that identifies the request and that allows failed CreatePrivateDnsNamespace requests to be retried without the risk of running the operation twice. CreatorRequestId can be any unique string (for example, a date/timestamp).

This field is autopopulated if not provided.

type Description

string

param Description

A description for the namespace.

type Vpc

string

param Vpc

[REQUIRED]

The ID of the Amazon VPC that you want to associate the namespace with.

type Tags

list

param Tags

The tags to add to the namespace. Each tag consists of a key and an optional value that you define. Tags keys can be up to 128 characters in length, and tag values can be up to 256 characters in length.

  • (dict) --

    A custom key-value pair that's associated with a resource.

    • Key (string) -- [REQUIRED]

      The key identifier, or name, of the tag.

    • Value (string) -- [REQUIRED]

      The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.

type Properties

dict

param Properties

Properties for the private DNS namespace.

  • DnsProperties (dict) -- [REQUIRED]

    DNS properties for the private DNS namespace.

    • SOA (dict) -- [REQUIRED]

      Fields for the Start of Authority (SOA) record for the hosted zone for the private DNS namespace.

      • TTL (integer) -- [REQUIRED]

        The time to live (TTL) for purposes of negative caching.

rtype

dict

returns

Response Syntax

{
    'OperationId': 'string'
}

Response Structure

  • (dict) --

    • OperationId (string) --

      A value that you can use to determine whether the request completed successfully. To get the status of the operation, see GetOperation.

CreatePublicDnsNamespace (updated) Link ¶
Changes (request)
{'Properties': {'DnsProperties': {'SOA': {'TTL': 'long'}}}}

Creates a public namespace based on DNS, which is visible on the internet. The namespace defines your service naming scheme. For example, if you name your namespace example.com and name your service backend , the resulting DNS name for the service is backend.example.com . You can discover instances that were registered with a public DNS namespace by using either a DiscoverInstances request or using DNS. For the current quota on the number of namespaces that you can create using the same account, see Cloud Map quotas in the Cloud Map Developer Guide .

See also: AWS API Documentation

Request Syntax

client.create_public_dns_namespace(
    Name='string',
    CreatorRequestId='string',
    Description='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    Properties={
        'DnsProperties': {
            'SOA': {
                'TTL': 123
            }
        }
    }
)
type Name

string

param Name

[REQUIRED]

The name that you want to assign to this namespace.

type CreatorRequestId

string

param CreatorRequestId

A unique string that identifies the request and that allows failed CreatePublicDnsNamespace requests to be retried without the risk of running the operation twice. CreatorRequestId can be any unique string (for example, a date/timestamp).

This field is autopopulated if not provided.

type Description

string

param Description

A description for the namespace.

type Tags

list

param Tags

The tags to add to the namespace. Each tag consists of a key and an optional value that you define. Tags keys can be up to 128 characters in length, and tag values can be up to 256 characters in length.

  • (dict) --

    A custom key-value pair that's associated with a resource.

    • Key (string) -- [REQUIRED]

      The key identifier, or name, of the tag.

    • Value (string) -- [REQUIRED]

      The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.

type Properties

dict

param Properties

Properties for the public DNS namespace.

  • DnsProperties (dict) -- [REQUIRED]

    DNS properties for the public DNS namespace.

    • SOA (dict) -- [REQUIRED]

      Start of Authority (SOA) record for the hosted zone for the public DNS namespace.

      • TTL (integer) -- [REQUIRED]

        The time to live (TTL) for purposes of negative caching.

rtype

dict

returns

Response Syntax

{
    'OperationId': 'string'
}

Response Structure

  • (dict) --

    • OperationId (string) --

      A value that you can use to determine whether the request completed successfully. To get the status of the operation, see GetOperation.

GetNamespace (updated) Link ¶
Changes (response)
{'Namespace': {'Properties': {'DnsProperties': {'SOA': {'TTL': 'long'}}}}}

Gets information about a namespace.

See also: AWS API Documentation

Request Syntax

client.get_namespace(
    Id='string'
)
type Id

string

param Id

[REQUIRED]

The ID of the namespace that you want to get information about.

rtype

dict

returns

Response Syntax

{
    'Namespace': {
        'Id': 'string',
        'Arn': 'string',
        'Name': 'string',
        'Type': 'DNS_PUBLIC'|'DNS_PRIVATE'|'HTTP',
        'Description': 'string',
        'ServiceCount': 123,
        'Properties': {
            'DnsProperties': {
                'HostedZoneId': 'string',
                'SOA': {
                    'TTL': 123
                }
            },
            'HttpProperties': {
                'HttpName': 'string'
            }
        },
        'CreateDate': datetime(2015, 1, 1),
        'CreatorRequestId': 'string'
    }
}

Response Structure

  • (dict) --

    • Namespace (dict) --

      A complex type that contains information about the specified namespace.

      • Id (string) --

        The ID of a namespace.

      • Arn (string) --

        The Amazon Resource Name (ARN) that Cloud Map assigns to the namespace when you create it.

      • Name (string) --

        The name of the namespace, such as example.com .

      • Type (string) --

        The type of the namespace. The methods for discovering instances depends on the value that you specify:

        HTTP

        Instances can be discovered only programmatically, using the Cloud Map DiscoverInstances API.

        DNS_PUBLIC

        Instances can be discovered using public DNS queries and using the DiscoverInstances API.

        DNS_PRIVATE

        Instances can be discovered using DNS queries in VPCs and using the DiscoverInstances API.

      • Description (string) --

        The description that you specify for the namespace when you create it.

      • ServiceCount (integer) --

        The number of services that are associated with the namespace.

      • Properties (dict) --

        A complex type that contains information that's specific to the type of the namespace.

        • DnsProperties (dict) --

          A complex type that contains the ID for the Route 53 hosted zone that Cloud Map creates when you create a namespace.

          • HostedZoneId (string) --

            The ID for the Route 53 hosted zone that Cloud Map creates when you create a namespace.

          • SOA (dict) --

            Start of Authority (SOA) record for the hosted zone.

            • TTL (integer) --

              The time to live (TTL) for purposes of negative caching.

        • HttpProperties (dict) --

          A complex type that contains the name of an HTTP namespace.

          • HttpName (string) --

            The name of an HTTP namespace.

      • CreateDate (datetime) --

        The date that the namespace was created, in Unix date/time format and Coordinated Universal Time (UTC). The value of CreateDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

      • CreatorRequestId (string) --

        A unique string that identifies the request and that allows failed requests to be retried without the risk of running an operation twice.

GetOperation (updated) Link ¶
Changes (response)
{'Operation': {'Type': {'UPDATE_NAMESPACE'}}}

Gets information about any operation that returns an operation ID in the response, such as a CreateService request.

Note

To get a list of operations that match specified criteria, see ListOperations.

See also: AWS API Documentation

Request Syntax

client.get_operation(
    OperationId='string'
)
type OperationId

string

param OperationId

[REQUIRED]

The ID of the operation that you want to get more information about.

rtype

dict

returns

Response Syntax

{
    'Operation': {
        'Id': 'string',
        'Type': 'CREATE_NAMESPACE'|'DELETE_NAMESPACE'|'UPDATE_NAMESPACE'|'UPDATE_SERVICE'|'REGISTER_INSTANCE'|'DEREGISTER_INSTANCE',
        'Status': 'SUBMITTED'|'PENDING'|'SUCCESS'|'FAIL',
        'ErrorMessage': 'string',
        'ErrorCode': 'string',
        'CreateDate': datetime(2015, 1, 1),
        'UpdateDate': datetime(2015, 1, 1),
        'Targets': {
            'string': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • Operation (dict) --

      A complex type that contains information about the operation.

      • Id (string) --

        The ID of the operation that you want to get information about.

      • Type (string) --

        The name of the operation that's associated with the specified ID.

      • Status (string) --

        The status of the operation. Values include the following:

        SUBMITTED

        This is the initial state that occurs immediately after you submit a request.

        PENDING

        Cloud Map is performing the operation.

        SUCCESS

        The operation succeeded.

        FAIL

        The operation failed. For the failure reason, see ErrorMessage .

      • ErrorMessage (string) --

        If the value of Status is FAIL , the reason that the operation failed.

      • ErrorCode (string) --

        The code associated with ErrorMessage . Values for ErrorCode include the following:

        • ACCESS_DENIED

        • CANNOT_CREATE_HOSTED_ZONE

        • EXPIRED_TOKEN

        • HOSTED_ZONE_NOT_FOUND

        • INTERNAL_FAILURE

        • INVALID_CHANGE_BATCH

        • THROTTLED_REQUEST

      • CreateDate (datetime) --

        The date and time that the request was submitted, in Unix date/time format and Coordinated Universal Time (UTC). The value of CreateDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

      • UpdateDate (datetime) --

        The date and time that the value of Status changed to the current value, in Unix date/time format and Coordinated Universal Time (UTC). The value of UpdateDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

      • Targets (dict) --

        The name of the target entity that's associated with the operation:

        NAMESPACE

        The namespace ID is returned in the ResourceId property.

        SERVICE

        The service ID is returned in the ResourceId property.

        INSTANCE

        The instance ID is returned in the ResourceId property.

        • (string) --

          • (string) --

ListNamespaces (updated) Link ¶
Changes (response)
{'Namespaces': {'Properties': {'DnsProperties': {'SOA': {'TTL': 'long'}}}}}

Lists summary information about the namespaces that were created by the current account.

See also: AWS API Documentation

Request Syntax

client.list_namespaces(
    NextToken='string',
    MaxResults=123,
    Filters=[
        {
            'Name': 'TYPE',
            'Values': [
                'string',
            ],
            'Condition': 'EQ'|'IN'|'BETWEEN'
        },
    ]
)
type NextToken

string

param NextToken

For the first ListNamespaces request, omit this value.

If the response contains NextToken , submit another ListNamespaces request to get the next group of results. Specify the value of NextToken from the previous response in the next request.

Note

Cloud Map gets MaxResults namespaces and then filters them based on the specified criteria. It's possible that no namespaces in the first MaxResults namespaces matched the specified criteria but that subsequent groups of MaxResults namespaces do contain namespaces that match the criteria.

type MaxResults

integer

param MaxResults

The maximum number of namespaces that you want Cloud Map to return in the response to a ListNamespaces request. If you don't specify a value for MaxResults , Cloud Map returns up to 100 namespaces.

type Filters

list

param Filters

A complex type that contains specifications for the namespaces that you want to list.

If you specify more than one filter, a namespace must match all filters to be returned by ListNamespaces .

  • (dict) --

    A complex type that identifies the namespaces that you want to list. You can choose to list public or private namespaces.

    • Name (string) -- [REQUIRED]

      Specify TYPE .

    • Values (list) -- [REQUIRED]

      If you specify EQ for Condition , specify either DNS_PUBLIC or DNS_PRIVATE .

      If you specify IN for Condition , you can specify DNS_PUBLIC , DNS_PRIVATE , or both.

      • (string) --

    • Condition (string) --

      The operator that you want to use to determine whether ListNamespaces returns a namespace. Valid values for condition include:

      EQ

      When you specify EQ for the condition, you can choose to list only public namespaces or private namespaces, but not both. EQ is the default condition and can be omitted.

      IN

      When you specify IN for the condition, you can choose to list public namespaces, private namespaces, or both.

      BETWEEN

      Not applicable

rtype

dict

returns

Response Syntax

{
    'Namespaces': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Type': 'DNS_PUBLIC'|'DNS_PRIVATE'|'HTTP',
            'Description': 'string',
            'ServiceCount': 123,
            'Properties': {
                'DnsProperties': {
                    'HostedZoneId': 'string',
                    'SOA': {
                        'TTL': 123
                    }
                },
                'HttpProperties': {
                    'HttpName': 'string'
                }
            },
            'CreateDate': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Namespaces (list) --

      An array that contains one NamespaceSummary object for each namespace that matches the specified filter criteria.

      • (dict) --

        A complex type that contains information about a namespace.

        • Id (string) --

          The ID of the namespace.

        • Arn (string) --

          The Amazon Resource Name (ARN) that Cloud Map assigns to the namespace when you create it.

        • Name (string) --

          The name of the namespace. When you create a namespace, Cloud Map automatically creates a Route 53 hosted zone that has the same name as the namespace.

        • Type (string) --

          The type of the namespace, either public or private.

        • Description (string) --

          A description for the namespace.

        • ServiceCount (integer) --

          The number of services that were created using the namespace.

        • Properties (dict) --

          The properties of the namespace.

          • DnsProperties (dict) --

            A complex type that contains the ID for the Route 53 hosted zone that Cloud Map creates when you create a namespace.

            • HostedZoneId (string) --

              The ID for the Route 53 hosted zone that Cloud Map creates when you create a namespace.

            • SOA (dict) --

              Start of Authority (SOA) record for the hosted zone.

              • TTL (integer) --

                The time to live (TTL) for purposes of negative caching.

          • HttpProperties (dict) --

            A complex type that contains the name of an HTTP namespace.

            • HttpName (string) --

              The name of an HTTP namespace.

        • CreateDate (datetime) --

          The date and time that the namespace was created.

    • NextToken (string) --

      If the response contains NextToken , submit another ListNamespaces request to get the next group of results. Specify the value of NextToken from the previous response in the next request.

      Note

      Cloud Map gets MaxResults namespaces and then filters them based on the specified criteria. It's possible that no namespaces in the first MaxResults namespaces matched the specified criteria but that subsequent groups of MaxResults namespaces do contain namespaces that match the criteria.