agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.servicediscovery"
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.ServiceDiscovery"
},
"python": {
"module": "aws_cdk.aws_servicediscovery"
}
}
}

View File

@@ -0,0 +1,45 @@
# Amazon ECS Service Discovery Construct Library
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
This package contains constructs for working with **AWS Cloud Map**
AWS Cloud Map is a fully managed service that you can use to create and
maintain a map of the backend services and resources that your applications
depend on.
For further information on AWS Cloud Map,
see the [AWS Cloud Map documentation](https://docs.aws.amazon.com/cloud-map)
## HTTP Namespace Example
The following example creates an AWS Cloud Map namespace that
supports API calls, creates a service in that namespace, and
registers an instance to it:
[Creating a Cloud Map service within an HTTP namespace](test/integ.service-with-http-namespace.lit.ts)
## Private DNS Namespace Example
The following example creates an AWS Cloud Map namespace that
supports both API calls and DNS queries within a vpc, creates a
service in that namespace, and registers a loadbalancer as an
instance.
A secondary service is also configured which only supports API based discovery, a
non ip based resource is registered to this service:
[Creating a Cloud Map service within a Private DNS namespace](test/integ.service-with-private-dns-namespace.lit.ts)
## Public DNS Namespace Example
The following example creates an AWS Cloud Map namespace that
supports both API calls and public DNS queries, creates a service in
that namespace, and registers an IP instance:
[Creating a Cloud Map service within a Public namespace](test/integ.service-with-public-dns-namespace.lit.ts)
For DNS namespaces, you can also register instances to services with CNAME records:
[Creating a Cloud Map service within a Public namespace](test/integ.service-with-cname-record.lit.ts)

View File

@@ -0,0 +1 @@
export * from './lib';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,37 @@
import type { Construct } from 'constructs';
import type { BaseInstanceProps } from './instance';
import { InstanceBase } from './instance';
import type { IService } from './service';
export interface AliasTargetInstanceProps extends BaseInstanceProps {
/**
* DNS name of the target
*/
readonly dnsName: string;
/**
* The Cloudmap service this resource is registered to.
*/
readonly service: IService;
}
/**
* Instance that uses Route 53 Alias record type. Currently, the only resource types supported are Elastic Load
* Balancers.
*
* @resource AWS::ServiceDiscovery::Instance
*/
export declare class AliasTargetInstance extends InstanceBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* The Id of the instance
*/
readonly instanceId: string;
/**
* The Cloudmap service to which the instance is registered.
*/
readonly service: IService;
/**
* The Route53 DNS name of the alias target
*/
readonly dnsName: string;
constructor(scope: Construct, id: string, props: AliasTargetInstanceProps);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,39 @@
import type { Construct } from 'constructs';
import type { BaseInstanceProps } from './instance';
import { InstanceBase } from './instance';
import type { IService } from './service';
export interface CnameInstanceBaseProps extends BaseInstanceProps {
/**
* If the service configuration includes a CNAME record, the domain name that you want Route 53 to
* return in response to DNS queries, for example, example.com. This value is required if the
* service specified by ServiceId includes settings for an CNAME record.
*/
readonly instanceCname: string;
}
export interface CnameInstanceProps extends CnameInstanceBaseProps {
/**
* The Cloudmap service this resource is registered to.
*/
readonly service: IService;
}
/**
* Instance that is accessible using a domain name (CNAME).
* @resource AWS::ServiceDiscovery::Instance
*/
export declare class CnameInstance extends InstanceBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* The Id of the instance
*/
readonly instanceId: string;
/**
* The Cloudmap service to which the instance is registered.
*/
readonly service: IService;
/**
* The domain name returned by DNS queries for the instance
*/
readonly cname: string;
constructor(scope: Construct, id: string, props: CnameInstanceProps);
}

View File

@@ -0,0 +1 @@
"use strict";var __esDecorate=exports&&exports.__esDecorate||function(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(f!==void 0&&typeof f!="function")throw new TypeError("Function expected");return f}for(var kind=contextIn.kind,key=kind==="getter"?"get":kind==="setter"?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),_,done=!1,i=decorators.length-1;i>=0;i--){var context={};for(var p in contextIn)context[p]=p==="access"?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null))};var result=(0,decorators[i])(kind==="accessor"?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if(kind==="accessor"){if(result===void 0)continue;if(result===null||typeof result!="object")throw new TypeError("Object expected");(_=accept(result.get))&&(descriptor.get=_),(_=accept(result.set))&&(descriptor.set=_),(_=accept(result.init))&&initializers.unshift(_)}else(_=accept(result))&&(kind==="field"?initializers.unshift(_):descriptor[key]=_)}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0},__runInitializers=exports&&exports.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i<initializers.length;i++)value=useValue?initializers[i].call(thisArg,value):initializers[i].call(thisArg);return useValue?value:void 0};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CnameInstance=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var instance_1=()=>{var tmp=require("./instance");return instance_1=()=>tmp,tmp},namespace_1=()=>{var tmp=require("./namespace");return namespace_1=()=>tmp,tmp},service_1=()=>{var tmp=require("./service");return service_1=()=>tmp,tmp},servicediscovery_generated_1=()=>{var tmp=require("./servicediscovery.generated");return servicediscovery_generated_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},metadata_resource_1=()=>{var tmp=require("../../core/lib/metadata-resource");return metadata_resource_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},prop_injectable_1=()=>{var tmp=require("../../core/lib/prop-injectable");return prop_injectable_1=()=>tmp,tmp};let CnameInstance=(()=>{let _classDecorators=[prop_injectable_1().propertyInjectable],_classDescriptor,_classExtraInitializers=[],_classThis,_classSuper=instance_1().InstanceBase;var CnameInstance2=class extends _classSuper{static{_classThis=this}static{const _metadata=typeof Symbol=="function"&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;__esDecorate(null,_classDescriptor={value:_classThis},_classDecorators,{kind:"class",name:_classThis.name,metadata:_metadata},null,_classExtraInitializers),CnameInstance2=_classThis=_classDescriptor.value,_metadata&&Object.defineProperty(_classThis,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_servicediscovery.CnameInstance",version:"2.252.0"};static PROPERTY_INJECTION_ID="aws-cdk-lib.aws-servicediscovery.CnameInstance";instanceId;service;cname;constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_servicediscovery_CnameInstanceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CnameInstance2),error}if((0,metadata_resource_1().addConstructMetadata)(this,props),props.service.namespace.type===namespace_1().NamespaceType.HTTP)throw new(core_1()).ValidationError((0,literal_string_1().lit)`NamespaceAssociatedServiceNamespace`,"Namespace associated with Service must be a DNS Namespace.",this);if(props.service.dnsRecordType!==service_1().DnsRecordType.CNAME)throw new(core_1()).ValidationError((0,literal_string_1().lit)`OnlyUsedServiceUsing`,"A `CnameIntance` can only be used with a service using a `CNAME` record.",this);const resource=new(servicediscovery_generated_1()).CfnInstance(this,"Resource",{instanceId:props.instanceId||this.uniqueInstanceId(),serviceId:props.service.serviceId,instanceAttributes:{AWS_INSTANCE_CNAME:props.instanceCname,...props.customAttributes}});this.service=props.service,this.instanceId=resource.ref,this.cname=props.instanceCname}static{__runInitializers(_classThis,_classExtraInitializers)}};return CnameInstance2=_classThis})();exports.CnameInstance=CnameInstance;

View File

@@ -0,0 +1,61 @@
import type { Construct } from 'constructs';
import type { BaseNamespaceProps, INamespace } from './namespace';
import { NamespaceType } from './namespace';
import type { BaseServiceProps } from './service';
import { Service } from './service';
import { Resource } from '../../core';
import type { HttpNamespaceReference, IHttpNamespaceRef } from '../../interfaces/generated/aws-servicediscovery-interfaces.generated';
export interface HttpNamespaceProps extends BaseNamespaceProps {
}
export interface IHttpNamespace extends INamespace, IHttpNamespaceRef {
}
export interface HttpNamespaceAttributes {
/**
* A name for the Namespace.
*/
readonly namespaceName: string;
/**
* Namespace Id for the Namespace.
*/
readonly namespaceId: string;
/**
* Namespace ARN for the Namespace.
*/
readonly namespaceArn: string;
}
/**
* Define an HTTP Namespace
*/
export declare class HttpNamespace extends Resource implements IHttpNamespace {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
static fromHttpNamespaceAttributes(scope: Construct, id: string, attrs: HttpNamespaceAttributes): IHttpNamespace;
/**
* A name for the namespace.
*/
readonly namespaceName: string;
/**
* Namespace Id for the namespace.
*/
readonly namespaceId: string;
/**
* Namespace Arn for the namespace.
*/
readonly namespaceArn: string;
/**
* Type of the namespace.
*/
readonly type: NamespaceType;
constructor(scope: Construct, id: string, props: HttpNamespaceProps);
/** @attribute */
get httpNamespaceArn(): string;
/** @attribute */
get httpNamespaceName(): string;
/** @attribute */
get httpNamespaceId(): string;
get httpNamespaceRef(): HttpNamespaceReference;
/**
* Creates a service within the namespace
*/
createService(id: string, props?: BaseServiceProps): Service;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
export * from './instance';
export * from './alias-target-instance';
export * from './cname-instance';
export * from './ip-instance';
export * from './non-ip-instance';
export * from './namespace';
export * from './http-namespace';
export * from './private-dns-namespace';
export * from './public-dns-namespace';
export * from './service';
export * from './servicediscovery.generated';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,50 @@
import type { IService } from './service';
import type { IResource } from '../../core';
import { Resource } from '../../core';
import type { IInstanceRef, InstanceReference } from '../../interfaces/generated/aws-servicediscovery-interfaces.generated';
export interface IInstance extends IResource, IInstanceRef {
/**
* The id of the instance resource
* @attribute
*/
readonly instanceId: string;
/**
* The Cloudmap service this resource is registered to.
*/
readonly service: IService;
}
/**
* Used when the resource that's associated with the service instance is accessible using values other than an IP
* address or a domain name (CNAME), i.e. for non-ip-instances
*/
export interface BaseInstanceProps {
/**
* The id of the instance resource
*
* @default Automatically generated name
*/
readonly instanceId?: string;
/**
* Custom attributes of the instance.
*
* @default none
*/
readonly customAttributes?: {
[key: string]: string;
};
}
export declare abstract class InstanceBase extends Resource implements IInstance {
/**
* The Id of the instance
*/
abstract readonly instanceId: string;
/**
* The Cloudmap service to which the instance is registered.
*/
abstract readonly service: IService;
get instanceRef(): InstanceReference;
/**
* Generate a unique instance Id that is safe to pass to CloudMap
*/
protected uniqueInstanceId(): string;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InstanceBase=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class InstanceBase extends core_1().Resource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_servicediscovery.InstanceBase",version:"2.252.0"};get instanceRef(){return{instanceId:this.instanceId}}uniqueInstanceId(){const id=core_1().Names.uniqueId(this);return id.substring(Math.max(id.length-64,0),id.length)}}exports.InstanceBase=InstanceBase;

View File

@@ -0,0 +1,64 @@
import type { Construct } from 'constructs';
import type { BaseInstanceProps } from './instance';
import { InstanceBase } from './instance';
import type { IService } from './service';
export interface IpInstanceBaseProps extends BaseInstanceProps {
/**
* The port on the endpoint that you want AWS Cloud Map to perform health checks on. This value is also used for
* the port value in an SRV record if the service that you specify includes an SRV record. You can also specify a
* default port that is applied to all instances in the Service configuration.
*
* @default 80
*/
readonly port?: number;
/**
* If the service that you specify contains a template for an A record, the IPv4 address that you want AWS Cloud
* Map to use for the value of the A record.
*
* @default none
*/
readonly ipv4?: string;
/**
* If the service that you specify contains a template for an AAAA record, the IPv6 address that you want AWS Cloud
* Map to use for the value of the AAAA record.
*
* @default none
*/
readonly ipv6?: string;
}
export interface IpInstanceProps extends IpInstanceBaseProps {
/**
* The Cloudmap service this resource is registered to.
*/
readonly service: IService;
}
/**
* Instance that is accessible using an IP address.
*
* @resource AWS::ServiceDiscovery::Instance
*/
export declare class IpInstance extends InstanceBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* The Id of the instance
*/
readonly instanceId: string;
/**
* The Cloudmap service to which the instance is registered.
*/
readonly service: IService;
/**
* The Ipv4 address of the instance, or blank string if none available
*/
readonly ipv4: string;
/**
* The Ipv6 address of the instance, or blank string if none available
*/
readonly ipv6: string;
/**
* The exposed port of the instance
*/
readonly port: number;
constructor(scope: Construct, id: string, props: IpInstanceProps);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,57 @@
import type { IResource } from '../../core';
/**
* A type of namespace
*
* One of private, public or HTTP namespace.
*
* [awslint:interface-extends-ref]
*/
export interface INamespace extends IResource {
/**
* A name for the Namespace.
* @attribute
*/
readonly namespaceName: string;
/**
* Namespace Id for the Namespace.
* @attribute
*/
readonly namespaceId: string;
/**
* Namespace ARN for the Namespace.
* @attribute
*/
readonly namespaceArn: string;
/**
* Type of Namespace
*/
readonly type: NamespaceType;
}
export interface BaseNamespaceProps {
/**
* A name for the Namespace.
*/
readonly name: string;
/**
* A description of the Namespace.
*
* @default none
*/
readonly description?: string;
}
export declare enum NamespaceType {
/**
* Choose this option if you want your application to use only API calls to discover registered instances.
*/
HTTP = "HTTP",
/**
* Choose this option if you want your application to be able to discover instances using either API calls or using
* DNS queries in a VPC.
*/
DNS_PRIVATE = "DNS_PRIVATE",
/**
* Choose this option if you want your application to be able to discover instances using either API calls or using
* public DNS queries. You aren't required to use both methods.
*/
DNS_PUBLIC = "DNS_PUBLIC"
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NamespaceType=void 0;var NamespaceType;(function(NamespaceType2){NamespaceType2.HTTP="HTTP",NamespaceType2.DNS_PRIVATE="DNS_PRIVATE",NamespaceType2.DNS_PUBLIC="DNS_PUBLIC"})(NamespaceType||(exports.NamespaceType=NamespaceType={}));

View File

@@ -0,0 +1,31 @@
import type { Construct } from 'constructs';
import type { BaseInstanceProps } from './instance';
import { InstanceBase } from './instance';
import type { IService } from './service';
export interface NonIpInstanceBaseProps extends BaseInstanceProps {
}
export interface NonIpInstanceProps extends NonIpInstanceBaseProps {
/**
* The Cloudmap service this resource is registered to.
*/
readonly service: IService;
}
/**
* Instance accessible using values other than an IP address or a domain name (CNAME).
* Specify the other values in Custom attributes.
*
* @resource AWS::ServiceDiscovery::Instance
*/
export declare class NonIpInstance extends InstanceBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* The Id of the instance
*/
readonly instanceId: string;
/**
* The Cloudmap service to which the instance is registered.
*/
readonly service: IService;
constructor(scope: Construct, id: string, props: NonIpInstanceProps);
}

View File

@@ -0,0 +1 @@
"use strict";var __esDecorate=exports&&exports.__esDecorate||function(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(f!==void 0&&typeof f!="function")throw new TypeError("Function expected");return f}for(var kind=contextIn.kind,key=kind==="getter"?"get":kind==="setter"?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),_,done=!1,i=decorators.length-1;i>=0;i--){var context={};for(var p in contextIn)context[p]=p==="access"?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null))};var result=(0,decorators[i])(kind==="accessor"?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if(kind==="accessor"){if(result===void 0)continue;if(result===null||typeof result!="object")throw new TypeError("Object expected");(_=accept(result.get))&&(descriptor.get=_),(_=accept(result.set))&&(descriptor.set=_),(_=accept(result.init))&&initializers.unshift(_)}else(_=accept(result))&&(kind==="field"?initializers.unshift(_):descriptor[key]=_)}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0},__runInitializers=exports&&exports.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i<initializers.length;i++)value=useValue?initializers[i].call(thisArg,value):initializers[i].call(thisArg);return useValue?value:void 0};Object.defineProperty(exports,"__esModule",{value:!0}),exports.NonIpInstance=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var instance_1=()=>{var tmp=require("./instance");return instance_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./private/utils");return utils_1=()=>tmp,tmp},service_1=()=>{var tmp=require("./service");return service_1=()=>tmp,tmp},servicediscovery_generated_1=()=>{var tmp=require("./servicediscovery.generated");return servicediscovery_generated_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},metadata_resource_1=()=>{var tmp=require("../../core/lib/metadata-resource");return metadata_resource_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},prop_injectable_1=()=>{var tmp=require("../../core/lib/prop-injectable");return prop_injectable_1=()=>tmp,tmp};let NonIpInstance=(()=>{let _classDecorators=[prop_injectable_1().propertyInjectable],_classDescriptor,_classExtraInitializers=[],_classThis,_classSuper=instance_1().InstanceBase;var NonIpInstance2=class extends _classSuper{static{_classThis=this}static{const _metadata=typeof Symbol=="function"&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;__esDecorate(null,_classDescriptor={value:_classThis},_classDecorators,{kind:"class",name:_classThis.name,metadata:_metadata},null,_classExtraInitializers),NonIpInstance2=_classThis=_classDescriptor.value,_metadata&&Object.defineProperty(_classThis,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_servicediscovery.NonIpInstance",version:"2.252.0"};static PROPERTY_INJECTION_ID="aws-cdk-lib.aws-servicediscovery.NonIpInstance";instanceId;service;constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_servicediscovery_NonIpInstanceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,NonIpInstance2),error}if((0,metadata_resource_1().addConstructMetadata)(this,props),(props.service.discoveryType||(0,utils_1().defaultDiscoveryType)(props.service.namespace))!==service_1().DiscoveryType.API)throw new(core_1()).ValidationError((0,literal_string_1().lit)`TypeInstanceRegisteredNamespaces`,"This type of instance can only be registered for HTTP namespaces.",this);if(props.customAttributes===void 0||Object.keys(props.customAttributes).length===0)throw new(core_1()).ValidationError((0,literal_string_1().lit)`SpecifyLeastOneCustomAttribute`,"You must specify at least one custom attribute for this instance type.",this);const resource=new(servicediscovery_generated_1()).CfnInstance(this,"Resource",{instanceId:props.instanceId||this.uniqueInstanceId(),serviceId:props.service.serviceId,instanceAttributes:{...props.customAttributes}});this.service=props.service,this.instanceId=resource.ref}static{__runInitializers(_classThis,_classExtraInitializers)}};return NonIpInstance2=_classThis})();exports.NonIpInstance=NonIpInstance;

View File

@@ -0,0 +1,70 @@
import type { Construct } from 'constructs';
import type { BaseNamespaceProps, INamespace } from './namespace';
import { NamespaceType } from './namespace';
import type { DnsServiceProps } from './service';
import { Service } from './service';
import type * as ec2 from '../../aws-ec2';
import { Resource } from '../../core';
import type { IPrivateDnsNamespaceRef, PrivateDnsNamespaceReference } from '../../interfaces/generated/aws-servicediscovery-interfaces.generated';
export interface PrivateDnsNamespaceProps extends BaseNamespaceProps {
/**
* The Amazon VPC that you want to associate the namespace with.
*/
readonly vpc: ec2.IVpc;
}
export interface IPrivateDnsNamespace extends INamespace, IPrivateDnsNamespaceRef {
}
export interface PrivateDnsNamespaceAttributes {
/**
* A name for the Namespace.
*/
readonly namespaceName: string;
/**
* Namespace Id for the Namespace.
*/
readonly namespaceId: string;
/**
* Namespace ARN for the Namespace.
*/
readonly namespaceArn: string;
}
/**
* Define a Service Discovery HTTP Namespace
*/
export declare class PrivateDnsNamespace extends Resource implements IPrivateDnsNamespace {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
static fromPrivateDnsNamespaceAttributes(scope: Construct, id: string, attrs: PrivateDnsNamespaceAttributes): IPrivateDnsNamespace;
/**
* The name of the PrivateDnsNamespace.
*/
readonly namespaceName: string;
/**
* Namespace Id of the PrivateDnsNamespace.
*/
readonly namespaceId: string;
/**
* Namespace Arn of the namespace.
*/
readonly namespaceArn: string;
/**
* ID of hosted zone created by namespace
*/
readonly namespaceHostedZoneId: string;
/**
* Type of the namespace.
*/
readonly type: NamespaceType;
constructor(scope: Construct, id: string, props: PrivateDnsNamespaceProps);
/** @attribute */
get privateDnsNamespaceArn(): string;
/** @attribute */
get privateDnsNamespaceName(): string;
/** @attribute */
get privateDnsNamespaceId(): string;
get privateDnsNamespaceRef(): PrivateDnsNamespaceReference;
/**
* Creates a service within the namespace
*/
createService(id: string, props?: DnsServiceProps): Service;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
import type { INamespace } from '../namespace';
import { DiscoveryType } from '../service';
export declare function defaultDiscoveryType(namespace: INamespace): DiscoveryType;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultDiscoveryType=defaultDiscoveryType;var namespace_1=()=>{var tmp=require("../namespace");return namespace_1=()=>tmp,tmp},service_1=()=>{var tmp=require("../service");return service_1=()=>tmp,tmp};function defaultDiscoveryType(namespace){return namespace.type==namespace_1().NamespaceType.HTTP?service_1().DiscoveryType.API:service_1().DiscoveryType.DNS_AND_API}

View File

@@ -0,0 +1,65 @@
import type { Construct } from 'constructs';
import type { BaseNamespaceProps, INamespace } from './namespace';
import { NamespaceType } from './namespace';
import type { DnsServiceProps } from './service';
import { Service } from './service';
import { Resource } from '../../core';
import type { IPublicDnsNamespaceRef, PublicDnsNamespaceReference } from '../../interfaces/generated/aws-servicediscovery-interfaces.generated';
export interface PublicDnsNamespaceProps extends BaseNamespaceProps {
}
export interface IPublicDnsNamespace extends INamespace, IPublicDnsNamespaceRef {
}
export interface PublicDnsNamespaceAttributes {
/**
* A name for the Namespace.
*/
readonly namespaceName: string;
/**
* Namespace Id for the Namespace.
*/
readonly namespaceId: string;
/**
* Namespace ARN for the Namespace.
*/
readonly namespaceArn: string;
}
/**
* Define a Public DNS Namespace
*/
export declare class PublicDnsNamespace extends Resource implements IPublicDnsNamespace {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
static fromPublicDnsNamespaceAttributes(scope: Construct, id: string, attrs: PublicDnsNamespaceAttributes): IPublicDnsNamespace;
/**
* A name for the namespace.
*/
readonly namespaceName: string;
/**
* Namespace Id for the namespace.
*/
readonly namespaceId: string;
/**
* Namespace Arn for the namespace.
*/
readonly namespaceArn: string;
/**
* ID of hosted zone created by namespace
*/
readonly namespaceHostedZoneId: string;
/**
* Type of the namespace.
*/
readonly type: NamespaceType;
constructor(scope: Construct, id: string, props: PublicDnsNamespaceProps);
/** @attribute */
get publicDnsNamespaceArn(): string;
/** @attribute */
get publicDnsNamespaceName(): string;
/** @attribute */
get publicDnsNamespaceId(): string;
get publicDnsNamespaceRef(): PublicDnsNamespaceReference;
/**
* Creates a service within the namespace
*/
createService(id: string, props?: DnsServiceProps): Service;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,303 @@
import type { Construct } from 'constructs';
import type { CnameInstanceBaseProps } from './cname-instance';
import type { IInstance } from './instance';
import type { IpInstanceBaseProps } from './ip-instance';
import type { INamespace } from './namespace';
import type { NonIpInstanceBaseProps } from './non-ip-instance';
import type * as elbv2 from '../../aws-elasticloadbalancingv2';
import type { IResource } from '../../core';
import { Duration, Resource } from '../../core';
import type { IServiceRef, ServiceReference } from '../../interfaces/generated/aws-servicediscovery-interfaces.generated';
export interface IService extends IResource, IServiceRef {
/**
* A name for the Cloudmap Service.
* @attribute
*/
readonly serviceName: string;
/**
* The namespace for the Cloudmap Service.
*/
readonly namespace: INamespace;
/**
* The ID of the namespace that you want to use for DNS configuration.
* @attribute
*/
readonly serviceId: string;
/**
* The Arn of the namespace that you want to use for DNS configuration.
* @attribute
*/
readonly serviceArn: string;
/**
* The DnsRecordType used by the service
*/
readonly dnsRecordType: DnsRecordType;
/**
* The Routing Policy used by the service
*/
readonly routingPolicy: RoutingPolicy;
/**
* The discovery type used by the service
*/
readonly discoveryType: DiscoveryType;
}
/**
* Basic props needed to create a service in a given namespace. Used by HttpNamespace.createService
*/
export interface BaseServiceProps {
/**
* A name for the Service.
*
* @default CloudFormation-generated name
*/
readonly name?: string;
/**
* A description of the service.
*
* @default none
*/
readonly description?: string;
/**
* Settings for an optional health check. If you specify health check settings, AWS Cloud Map associates the health
* check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can
* be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to
* this service.
*
* @default none
*/
readonly healthCheck?: HealthCheckConfig;
/**
* Structure containing failure threshold for a custom health checker.
* Only one of healthCheckConfig or healthCheckCustomConfig can be specified.
* See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html
*
* @default none
*/
readonly customHealthCheck?: HealthCheckCustomConfig;
}
/**
* Service props needed to create a service in a given namespace. Used by createService() for PrivateDnsNamespace and
* PublicDnsNamespace
*/
export interface DnsServiceProps extends BaseServiceProps {
/**
* Controls how instances within this service can be discovered
*
* @default DNS_AND_API
*/
readonly discoveryType?: DiscoveryType;
/**
* The DNS type of the record that you want AWS Cloud Map to create. Supported record types
* include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV.
*
* @default A
*/
readonly dnsRecordType?: DnsRecordType;
/**
* The amount of time, in seconds, that you want DNS resolvers to cache the settings for this
* record.
*
* @default Duration.minutes(1)
*/
readonly dnsTtl?: Duration;
/**
* The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you
* register an instance and specify this service.
*
* @default WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise
*/
readonly routingPolicy?: RoutingPolicy;
/**
* Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance.
*
* Setting this to `true` correctly configures the `routingPolicy`
* and performs some additional validation.
*
* @default false
*/
readonly loadBalancer?: boolean;
}
export interface ServiceProps extends DnsServiceProps {
/**
* The namespace that you want to use for DNS configuration.
*/
readonly namespace: INamespace;
}
declare abstract class ServiceBase extends Resource implements IService {
abstract namespace: INamespace;
abstract serviceId: string;
abstract serviceArn: string;
abstract dnsRecordType: DnsRecordType;
abstract routingPolicy: RoutingPolicy;
abstract readonly serviceName: string;
abstract discoveryType: DiscoveryType;
get serviceRef(): ServiceReference;
}
export interface ServiceAttributes {
readonly namespace: INamespace;
readonly serviceName: string;
readonly serviceId: string;
readonly serviceArn: string;
readonly dnsRecordType: DnsRecordType;
readonly routingPolicy: RoutingPolicy;
readonly discoveryType?: DiscoveryType;
}
/**
* Define a CloudMap Service
*/
export declare class Service extends ServiceBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
static fromServiceAttributes(scope: Construct, id: string, attrs: ServiceAttributes): IService;
/**
* A name for the Cloudmap Service.
*/
readonly serviceName: string;
/**
* The namespace for the Cloudmap Service.
*/
readonly namespace: INamespace;
/**
* The ID of the namespace that you want to use for DNS configuration.
*/
readonly serviceId: string;
/**
* The Arn of the namespace that you want to use for DNS configuration.
*/
readonly serviceArn: string;
/**
* The DnsRecordType used by the service
*/
readonly dnsRecordType: DnsRecordType;
/**
* The Routing Policy used by the service
*/
readonly routingPolicy: RoutingPolicy;
/**
* The discovery type used by this service.
*/
readonly discoveryType: DiscoveryType;
constructor(scope: Construct, id: string, props: ServiceProps);
/**
* Registers an ELB as a new instance with unique name instanceId in this service.
*/
registerLoadBalancer(id: string, loadBalancer: elbv2.ILoadBalancerV2, customAttributes?: {
[key: string]: string;
}): IInstance;
/**
* Registers a resource that is accessible using values other than an IP address or a domain name (CNAME).
*/
registerNonIpInstance(id: string, props: NonIpInstanceBaseProps): IInstance;
/**
* Registers a resource that is accessible using an IP address.
*/
registerIpInstance(id: string, props: IpInstanceBaseProps): IInstance;
/**
* Registers a resource that is accessible using a CNAME.
*/
registerCnameInstance(id: string, props: CnameInstanceBaseProps): IInstance;
}
/**
* Settings for an optional Amazon Route 53 health check. If you specify settings for a health check, AWS Cloud Map
* associates the health check with all the records that you specify in DnsConfig. Only valid with a PublicDnsNamespace.
*/
export interface HealthCheckConfig {
/**
* The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is
* healthy. Cannot be modified once created. Supported values are HTTP, HTTPS, and TCP.
*
* @default HTTP
*/
readonly type?: HealthCheckType;
/**
* The path that you want Route 53 to request when performing health checks. Do not use when health check type is TCP.
*
* @default '/'
*/
readonly resourcePath?: string;
/**
* The number of consecutive health checks that an endpoint must pass or fail for Route 53 to change the current
* status of the endpoint from unhealthy to healthy or vice versa.
*
* @default 1
*/
readonly failureThreshold?: number;
}
/**
* Specifies information about an optional custom health check.
*/
export interface HealthCheckCustomConfig {
/**
* The number of 30-second intervals that you want Cloud Map to wait after receiving an
* UpdateInstanceCustomHealthStatus request before it changes the health status of a service instance.
*
* @default 1
*/
readonly failureThreshold?: number;
}
/**
* Specifies information about the discovery type of a service
*/
export declare enum DiscoveryType {
/**
* Instances are discoverable via API only
*/
API = "API",
/**
* Instances are discoverable via DNS or API
*/
DNS_AND_API = "DNS_AND_API"
}
export declare enum DnsRecordType {
/**
* An A record
*/
A = "A",
/**
* An AAAA record
*/
AAAA = "AAAA",
/**
* Both an A and AAAA record
*/
A_AAAA = "A, AAAA",
/**
* A Srv record
*/
SRV = "SRV",
/**
* A CNAME record
*/
CNAME = "CNAME"
}
export declare enum RoutingPolicy {
/**
* Route 53 returns the applicable value from one randomly selected instance from among the instances that you
* registered using the same service.
*/
WEIGHTED = "WEIGHTED",
/**
* If you define a health check for the service and the health check is healthy, Route 53 returns the applicable value
* for up to eight instances.
*/
MULTIVALUE = "MULTIVALUE"
}
export declare enum HealthCheckType {
/**
* Route 53 tries to establish a TCP connection. If successful, Route 53 submits an HTTP request and waits for an HTTP
* status code of 200 or greater and less than 400.
*/
HTTP = "HTTP",
/**
* Route 53 tries to establish a TCP connection. If successful, Route 53 submits an HTTPS request and waits for an
* HTTP status code of 200 or greater and less than 400. If you specify HTTPS for the value of Type, the endpoint
* must support TLS v1.0 or later.
*/
HTTPS = "HTTPS",
/**
* Route 53 tries to establish a TCP connection.
* If you specify TCP for Type, don't specify a value for ResourcePath.
*/
TCP = "TCP"
}
export {};

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long