Documentation
¶
Overview ¶
The CDK Construct Library that helps you build ECS services using simple extensions
Index ¶
- func Environment_IsConstruct(x interface{}) *bool
- func ImportedEnvironment_IsConstruct(x interface{}) *bool
- func NewAliasedPortExtension_Override(a AliasedPortExtension, props *AliasedPortProps)
- func NewAliasedPortMutatingHook_Override(a AliasedPortMutatingHook, props *AliasedPortMutatingHookProps)
- func NewAppMeshExtension_Override(a AppMeshExtension, props *MeshProps)
- func NewAssignPublicIpExtension_Override(a AssignPublicIpExtension, options *AssignPublicIpExtensionOptions)
- func NewCloudwatchAgentExtension_Override(c CloudwatchAgentExtension)
- func NewContainerMutatingHook_Override(c ContainerMutatingHook)
- func NewContainer_Override(c Container, props *ContainerExtensionProps)
- func NewEnvironment_Override(e Environment, scope constructs.Construct, id *string, props *EnvironmentProps)
- func NewFireLensExtension_Override(f FireLensExtension)
- func NewFirelensMutatingHook_Override(f FirelensMutatingHook, props *FirelensProps)
- func NewHttpLoadBalancerExtension_Override(h HttpLoadBalancerExtension, props *HttpLoadBalancerProps)
- func NewImportedEnvironment_Override(i ImportedEnvironment, scope constructs.Construct, id *string, ...)
- func NewInjectableTopic_Override(i InjectableTopic, props *InjectableTopicProps)
- func NewInjecterExtension_Override(i InjecterExtension, props *InjecterExtensionProps)
- func NewQueueExtension_Override(q QueueExtension, props *QueueExtensionProps)
- func NewScaleOnCpuUtilization_Override(s ScaleOnCpuUtilization, props *CpuScalingProps)deprecated
- func NewServiceDescription_Override(s ServiceDescription)
- func NewServiceExtension_Override(s ServiceExtension, name *string)
- func NewService_Override(s Service, scope constructs.Construct, id *string, props *ServiceProps)
- func NewTopicSubscription_Override(t TopicSubscription, props *TopicSubscriptionProps)
- func NewXRayExtension_Override(x XRayExtension)
- func Service_IsConstruct(x interface{}) *bool
- type AliasedPortExtension
- type AliasedPortMutatingHook
- type AliasedPortMutatingHookProps
- type AliasedPortProps
- type AppMeshExtension
- type AssignPublicIpDnsOptions
- type AssignPublicIpExtension
- type AssignPublicIpExtensionOptions
- type AutoScalingOptions
- type CloudwatchAgentExtension
- type ConnectToProps
- type Container
- type ContainerExtensionProps
- type ContainerMutatingHook
- type CpuScalingProps
- type Environment
- type EnvironmentAttributes
- type EnvironmentCapacityType
- type EnvironmentProps
- type FireLensExtension
- type FirelensMutatingHook
- type FirelensProps
- type HttpLoadBalancerExtension
- type HttpLoadBalancerProps
- type IEnvironment
- type IGrantInjectable
- type IInjectable
- type ISubscribable
- type ImportedEnvironment
- type InjectableTopic
- type InjectableTopicProps
- type InjecterExtension
- type InjecterExtensionProps
- type MeshProps
- type Protocol
- type QueueAutoScalingOptions
- type QueueExtension
- type QueueExtensionProps
- type ScaleOnCpuUtilization
- type Service
- type ServiceBuild
- type ServiceDescription
- type ServiceExtension
- type ServiceProps
- type SubscriptionQueue
- type TopicSubscription
- type TopicSubscriptionProps
- type XRayExtension
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Environment_IsConstruct ¶
func Environment_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.
func ImportedEnvironment_IsConstruct ¶
func ImportedEnvironment_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.
func NewAliasedPortExtension_Override ¶
func NewAliasedPortExtension_Override(a AliasedPortExtension, props *AliasedPortProps)
Experimental.
func NewAliasedPortMutatingHook_Override ¶
func NewAliasedPortMutatingHook_Override(a AliasedPortMutatingHook, props *AliasedPortMutatingHookProps)
Experimental.
func NewAppMeshExtension_Override ¶
func NewAppMeshExtension_Override(a AppMeshExtension, props *MeshProps)
Experimental.
func NewAssignPublicIpExtension_Override ¶
func NewAssignPublicIpExtension_Override(a AssignPublicIpExtension, options *AssignPublicIpExtensionOptions)
Experimental.
func NewCloudwatchAgentExtension_Override ¶
func NewCloudwatchAgentExtension_Override(c CloudwatchAgentExtension)
Experimental.
func NewContainerMutatingHook_Override ¶
func NewContainerMutatingHook_Override(c ContainerMutatingHook)
Experimental.
func NewContainer_Override ¶
func NewContainer_Override(c Container, props *ContainerExtensionProps)
Experimental.
func NewEnvironment_Override ¶
func NewEnvironment_Override(e Environment, scope constructs.Construct, id *string, props *EnvironmentProps)
Experimental.
func NewFireLensExtension_Override ¶
func NewFireLensExtension_Override(f FireLensExtension)
Experimental.
func NewFirelensMutatingHook_Override ¶
func NewFirelensMutatingHook_Override(f FirelensMutatingHook, props *FirelensProps)
Experimental.
func NewHttpLoadBalancerExtension_Override ¶
func NewHttpLoadBalancerExtension_Override(h HttpLoadBalancerExtension, props *HttpLoadBalancerProps)
Experimental.
func NewImportedEnvironment_Override ¶
func NewImportedEnvironment_Override(i ImportedEnvironment, scope constructs.Construct, id *string, props *EnvironmentAttributes)
Experimental.
func NewInjectableTopic_Override ¶
func NewInjectableTopic_Override(i InjectableTopic, props *InjectableTopicProps)
Experimental.
func NewInjecterExtension_Override ¶
func NewInjecterExtension_Override(i InjecterExtension, props *InjecterExtensionProps)
Experimental.
func NewQueueExtension_Override ¶
func NewQueueExtension_Override(q QueueExtension, props *QueueExtensionProps)
Experimental.
func NewScaleOnCpuUtilization_Override
deprecated
func NewScaleOnCpuUtilization_Override(s ScaleOnCpuUtilization, props *CpuScalingProps)
Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling .
func NewServiceDescription_Override ¶
func NewServiceDescription_Override(s ServiceDescription)
Experimental.
func NewServiceExtension_Override ¶
func NewServiceExtension_Override(s ServiceExtension, name *string)
Experimental.
func NewService_Override ¶
func NewService_Override(s Service, scope constructs.Construct, id *string, props *ServiceProps)
Experimental.
func NewTopicSubscription_Override ¶
func NewTopicSubscription_Override(t TopicSubscription, props *TopicSubscriptionProps)
Experimental.
func Service_IsConstruct ¶
func Service_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.
Types ¶
type AliasedPortExtension ¶
type AliasedPortExtension interface { ServiceExtension // Experimental. Alias() *string // Experimental. SetAlias(val *string) // Experimental. AliasPort() *float64 // Experimental. SetAliasPort(val *float64) // Experimental. AppProtocol() awsecs.AppProtocol // Experimental. SetAppProtocol(val awsecs.AppProtocol) // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // Experimental. Namespace() *string // Experimental. SetNamespace(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
Experimental.
func NewAliasedPortExtension ¶
func NewAliasedPortExtension(props *AliasedPortProps) AliasedPortExtension
Experimental.
type AliasedPortMutatingHook ¶
type AliasedPortMutatingHook interface { ContainerMutatingHook // This is a hook for modifying the container definition of any upstream containers. // // This is primarily used for the main application container. // For example, the Firelens extension wants to be able to modify the logging // settings of the application container. // Experimental. MutateContainerDefinition(props *awsecs.ContainerDefinitionOptions) *awsecs.ContainerDefinitionOptions }
This hook modifies the application container's settings so that its primary port mapping has a name. Experimental.
func NewAliasedPortMutatingHook ¶
func NewAliasedPortMutatingHook(props *AliasedPortMutatingHookProps) AliasedPortMutatingHook
Experimental.
type AliasedPortMutatingHookProps ¶
type AliasedPortMutatingHookProps struct { // The port on the container which receives traffic. // // This is the same as the `containerPort` property of port mapping. // Experimental. AliasPort *float64 `field:"required" json:"aliasPort" yaml:"aliasPort"` // The name by which to refer to this port mapping. // Experimental. PortMappingName *string `field:"required" json:"portMappingName" yaml:"portMappingName"` // The protocol which this port mapping expects to receive. // Default: - none. // // Experimental. Protocol awsecs.AppProtocol `field:"optional" json:"protocol" yaml:"protocol"` }
Experimental.
type AliasedPortProps ¶
type AliasedPortProps struct { // The DNS alias to advertise for downstream clients. // Experimental. Alias *string `field:"required" json:"alias" yaml:"alias"` // The traffic port for clients to use to connect to the DNS alias. // Default: - same as containerPort. // // Experimental. AliasPort *float64 `field:"optional" json:"aliasPort" yaml:"aliasPort"` // The protocol to use over the specified port. // // May be one of HTTP, HTTP2, or GRPC. // Default: - none. // // Experimental. AppProtocol awsecs.AppProtocol `field:"optional" json:"appProtocol" yaml:"appProtocol"` }
AliasedPortProps defines the properties of an aliased port extension. Experimental.
type AppMeshExtension ¶
type AppMeshExtension interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // The protocol used for AppMesh routing. // // default - Protocol.HTTP // Experimental. Protocol() Protocol // Experimental. Route() awsappmesh.Route // Experimental. SetRoute(val awsappmesh.Route) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // Experimental. VirtualNode() awsappmesh.VirtualNode // Experimental. SetVirtualNode(val awsappmesh.VirtualNode) // Experimental. VirtualRouter() awsappmesh.VirtualRouter // Experimental. SetVirtualRouter(val awsappmesh.VirtualRouter) // Experimental. VirtualService() awsappmesh.VirtualService // Experimental. SetVirtualService(val awsappmesh.VirtualService) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(otherService Service, _connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
This extension adds an Envoy sidecar to the task definition and creates the App Mesh resources required to route network traffic to the container in a service mesh.
The service will then be available to other App Mesh services at the address `<service name>.<environment name>`. For example, a service called `orders` deploying in an environment called `production` would be accessible to other App Mesh enabled services at the address `http://orders.production`. Experimental.
func NewAppMeshExtension ¶
func NewAppMeshExtension(props *MeshProps) AppMeshExtension
Experimental.
type AssignPublicIpDnsOptions ¶
type AssignPublicIpDnsOptions struct { // Name of the record to add to the zone and in which to add the task IP addresses to. // // Example: // 'myservice' // // Experimental. RecordName *string `field:"required" json:"recordName" yaml:"recordName"` // A DNS Zone to expose task IPs in. // Experimental. Zone awsroute53.IHostedZone `field:"required" json:"zone" yaml:"zone"` }
Experimental.
type AssignPublicIpExtension ¶
type AssignPublicIpExtension interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // Experimental. Dns() *AssignPublicIpDnsOptions // Experimental. SetDns(val *AssignPublicIpDnsOptions) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, _scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
Modifies the service to assign a public ip to each task and optionally exposes public IPs in a Route 53 record set.
Note: If you want to change the DNS zone or record name, you will need to remove this extension completely and then re-add it. Experimental.
func NewAssignPublicIpExtension ¶
func NewAssignPublicIpExtension(options *AssignPublicIpExtensionOptions) AssignPublicIpExtension
Experimental.
type AssignPublicIpExtensionOptions ¶
type AssignPublicIpExtensionOptions struct { // Enable publishing task public IPs to a recordset in a Route 53 hosted zone. // // Note: If you want to change the DNS zone or record name, you will need to // remove this extension completely and then re-add it. // Experimental. Dns *AssignPublicIpDnsOptions `field:"optional" json:"dns" yaml:"dns"` }
Experimental.
type AutoScalingOptions ¶
type AutoScalingOptions struct { // The maximum number of tasks when scaling out. // Experimental. MaxTaskCount *float64 `field:"required" json:"maxTaskCount" yaml:"maxTaskCount"` // The minimum number of tasks when scaling in. // Default: - 1. // // Experimental. MinTaskCount *float64 `field:"optional" json:"minTaskCount" yaml:"minTaskCount"` // The target value for CPU utilization across all tasks in the service. // Experimental. TargetCpuUtilization *float64 `field:"optional" json:"targetCpuUtilization" yaml:"targetCpuUtilization"` // The target value for memory utilization across all tasks in the service. // Experimental. TargetMemoryUtilization *float64 `field:"optional" json:"targetMemoryUtilization" yaml:"targetMemoryUtilization"` }
Experimental.
type CloudwatchAgentExtension ¶
type CloudwatchAgentExtension interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
This extension adds a CloudWatch agent to the task definition and configures the task to be able to publish metrics to CloudWatch. Experimental.
func NewCloudwatchAgentExtension ¶
func NewCloudwatchAgentExtension() CloudwatchAgentExtension
Experimental.
type ConnectToProps ¶
type ConnectToProps struct { // localBindPort is the local port that this application should use when calling the upstream service in ECS Consul Mesh Extension Currently, this parameter will only be used in the ECSConsulMeshExtension https://github.com/aws-ia/ecs-consul-mesh-extension. // Experimental. LocalBindPort *float64 `field:"optional" json:"localBindPort" yaml:"localBindPort"` }
connectToProps will have all the extra parameters which are required for connecting services. Experimental.
type Container ¶
type Container interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The log group into which application container logs should be routed. // Experimental. LogGroup() awslogs.ILogGroup // Experimental. SetLogGroup(val awslogs.ILogGroup) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // The port on which the container expects to receive network traffic. // Experimental. TrafficPort() *float64 // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
The main container of a service.
This is generally the container which runs your application business logic. Other extensions will attach sidecars alongside this main container. Experimental.
type ContainerExtensionProps ¶
type ContainerExtensionProps struct { // How much CPU the container requires. // Experimental. Cpu *float64 `field:"required" json:"cpu" yaml:"cpu"` // The image to run. // Experimental. Image awsecs.ContainerImage `field:"required" json:"image" yaml:"image"` // How much memory in megabytes the container requires. // Experimental. MemoryMiB *float64 `field:"required" json:"memoryMiB" yaml:"memoryMiB"` // What port the image listen for traffic on. // Experimental. TrafficPort *float64 `field:"required" json:"trafficPort" yaml:"trafficPort"` // Environment variables to pass into the container. // Default: - No environment variables. // // Experimental. Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The environment files to pass to the container. // See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html // // Default: - No environment files. // // Experimental. EnvironmentFiles *[]awsecs.EnvironmentFile `field:"optional" json:"environmentFiles" yaml:"environmentFiles"` // The log group into which application container logs should be routed. // Default: - A log group is automatically created for you if the `ECS_SERVICE_EXTENSIONS_ENABLE_DEFAULT_LOG_DRIVER` feature flag is set. // // Experimental. LogGroup awslogs.ILogGroup `field:"optional" json:"logGroup" yaml:"logGroup"` // The secret environment variables to pass to the container. // Default: - No secret environment variables. // // Experimental. Secrets *map[string]awsecs.Secret `field:"optional" json:"secrets" yaml:"secrets"` }
Setting for the main application container of a service. Experimental.
type ContainerMutatingHook ¶
type ContainerMutatingHook interface { // This is a hook for modifying the container definition of any upstream containers. // // This is primarily used for the main application container. // For example, the Firelens extension wants to be able to modify the logging // settings of the application container. // Experimental. MutateContainerDefinition(props *awsecs.ContainerDefinitionOptions) *awsecs.ContainerDefinitionOptions }
This is an abstract class wrapper for a mutating hook.
It is extended by any extension which wants to mutate other extension's containers. Experimental.
type CpuScalingProps ¶
type CpuScalingProps struct { // How many tasks to launch initially. // Default: - 2. // // Deprecated: use the `minTaskCount` and `maxTaskCount` properties of `autoScaleTaskCount` in the `Service` construct // to configure the auto scaling target for the service. For more information, please refer // https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . InitialTaskCount *float64 `field:"optional" json:"initialTaskCount" yaml:"initialTaskCount"` // The maximum number of tasks when scaling out. // Default: - 8. // // Deprecated: use the `minTaskCount` and `maxTaskCount` properties of `autoScaleTaskCount` in the `Service` construct // to configure the auto scaling target for the service. For more information, please refer // https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . MaxTaskCount *float64 `field:"optional" json:"maxTaskCount" yaml:"maxTaskCount"` // The minimum number of tasks when scaling in. // Default: - 2. // // Deprecated: use the `minTaskCount` and `maxTaskCount` properties of `autoScaleTaskCount` in the `Service` construct // to configure the auto scaling target for the service. For more information, please refer // https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . MinTaskCount *float64 `field:"optional" json:"minTaskCount" yaml:"minTaskCount"` // How long to wait between scale in actions. // Default: - 60 seconds. // // Deprecated: use the `minTaskCount` and `maxTaskCount` properties of `autoScaleTaskCount` in the `Service` construct // to configure the auto scaling target for the service. For more information, please refer // https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ScaleInCooldown awscdk.Duration `field:"optional" json:"scaleInCooldown" yaml:"scaleInCooldown"` // How long to wait between scale out actions. // Default: - 60 seconds. // // Deprecated: use the `minTaskCount` and `maxTaskCount` properties of `autoScaleTaskCount` in the `Service` construct // to configure the auto scaling target for the service. For more information, please refer // https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ScaleOutCooldown awscdk.Duration `field:"optional" json:"scaleOutCooldown" yaml:"scaleOutCooldown"` // The CPU utilization to try ot maintain. // Default: - 50%. // // Deprecated: use the `minTaskCount` and `maxTaskCount` properties of `autoScaleTaskCount` in the `Service` construct // to configure the auto scaling target for the service. For more information, please refer // https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . TargetCpuUtilization *float64 `field:"optional" json:"targetCpuUtilization" yaml:"targetCpuUtilization"` }
The autoscaling settings. Deprecated: use the `minTaskCount` and `maxTaskCount` properties of `autoScaleTaskCount` in the `Service` construct to configure the auto scaling target for the service. For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling .
type Environment ¶
type Environment interface { constructs.Construct IEnvironment // The capacity type used by the service's cluster. // Experimental. CapacityType() EnvironmentCapacityType // The cluster that is providing capacity for this service. // Experimental. Cluster() awsecs.ICluster // The name of this environment. // Experimental. Id() *string // The tree node. // Experimental. Node() constructs.Node // The VPC where environment services should be placed. // Experimental. Vpc() awsec2.IVpc // Add a default cloudmap namespace to the environment's cluster. // // The environment's cluster must not be imported. // Experimental. AddDefaultCloudMapNamespace(options *awsecs.CloudMapNamespaceOptions) // Returns a string representation of this construct. // Experimental. ToString() *string }
An environment into which to deploy a service.
This environment can either be instantiated with a pre-existing AWS VPC and ECS cluster, or it can create its own VPC and cluster. By default, it will create a cluster with Fargate capacity. Experimental.
func NewEnvironment ¶
func NewEnvironment(scope constructs.Construct, id *string, props *EnvironmentProps) Environment
Experimental.
type EnvironmentAttributes ¶
type EnvironmentAttributes struct { // The capacity type used by the service's cluster. // Experimental. CapacityType EnvironmentCapacityType `field:"required" json:"capacityType" yaml:"capacityType"` // The cluster that is providing capacity for this service. // Experimental. Cluster awsecs.ICluster `field:"required" json:"cluster" yaml:"cluster"` }
Experimental.
type EnvironmentCapacityType ¶
type EnvironmentCapacityType string
The types of capacity that are supported.
These capacity types may change the behavior of an extension. Experimental.
const ( // Specify that the environment should use AWS Fargate for hosting containers. // Experimental. EnvironmentCapacityType_FARGATE EnvironmentCapacityType = "FARGATE" // Specify that the environment should launch containers onto EC2 instances. // Experimental. EnvironmentCapacityType_EC2 EnvironmentCapacityType = "EC2" )
type EnvironmentProps ¶
type EnvironmentProps struct { // The type of capacity to use for this environment. // Default: - EnvironmentCapacityType.FARGATE // // Experimental. CapacityType EnvironmentCapacityType `field:"optional" json:"capacityType" yaml:"capacityType"` // The ECS cluster which provides compute capacity to this service. // // [disable-awslint:ref-via-interface]. // Default: - Create a new cluster. // // Experimental. Cluster awsecs.Cluster `field:"optional" json:"cluster" yaml:"cluster"` // The VPC used by the service for networking. // Default: - Create a new VPC. // // Experimental. Vpc awsec2.IVpc `field:"optional" json:"vpc" yaml:"vpc"` }
Settings for the environment where you want to deploy your services. Experimental.
type FireLensExtension ¶
type FireLensExtension interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
This extension adds a FluentBit log router to the task definition and does all the configuration necessarily to enable log routing for the task using FireLens. Experimental.
type FirelensMutatingHook ¶
type FirelensMutatingHook interface { ContainerMutatingHook // This is a hook for modifying the container definition of any upstream containers. // // This is primarily used for the main application container. // For example, the Firelens extension wants to be able to modify the logging // settings of the application container. // Experimental. MutateContainerDefinition(props *awsecs.ContainerDefinitionOptions) *awsecs.ContainerDefinitionOptions }
This hook modifies the application container's settings so that it routes logs using FireLens. Experimental.
func NewFirelensMutatingHook ¶
func NewFirelensMutatingHook(props *FirelensProps) FirelensMutatingHook
Experimental.
type FirelensProps ¶
type FirelensProps struct { // The log group into which logs should be routed. // Experimental. LogGroup awslogs.LogGroup `field:"required" json:"logGroup" yaml:"logGroup"` // The parent service that is being mutated. // Experimental. ParentService Service `field:"required" json:"parentService" yaml:"parentService"` }
Settings for the hook which mutates the application container to route logs through FireLens. Experimental.
type HttpLoadBalancerExtension ¶
type HttpLoadBalancerExtension interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
This extension add a public facing load balancer for sending traffic to one or more replicas of the application container. Experimental.
func NewHttpLoadBalancerExtension ¶
func NewHttpLoadBalancerExtension(props *HttpLoadBalancerProps) HttpLoadBalancerExtension
Experimental.
type HttpLoadBalancerProps ¶
type HttpLoadBalancerProps struct { // The number of ALB requests per target. // Experimental. RequestsPerTarget *float64 `field:"optional" json:"requestsPerTarget" yaml:"requestsPerTarget"` }
Experimental.
type IEnvironment ¶
type IEnvironment interface { // Add a default cloudmap namespace to the environment's cluster. // Experimental. AddDefaultCloudMapNamespace(options *awsecs.CloudMapNamespaceOptions) // The capacity type used by the service's cluster. // Experimental. CapacityType() EnvironmentCapacityType // The cluster that is providing capacity for this service. // Experimental. Cluster() awsecs.ICluster // The name of this environment. // Experimental. Id() *string // The VPC into which environment services should be placed. // Experimental. Vpc() awsec2.IVpc }
An environment into which to deploy a service. Experimental.
func Environment_FromEnvironmentAttributes ¶
func Environment_FromEnvironmentAttributes(scope constructs.Construct, id *string, attrs *EnvironmentAttributes) IEnvironment
Import an existing environment from its attributes. Experimental.
type IGrantInjectable ¶
type IGrantInjectable interface { IInjectable // Experimental. Grant(taskDefinition awsecs.TaskDefinition) }
An interface that will be implemented by all the injectable resources that need to grant permissions to the task role. Experimental.
type IInjectable ¶
An interface that will be implemented by all the resources that can be published events or written data to. Experimental.
type ISubscribable ¶
type ISubscribable interface { // All classes implementing this interface must also implement the `subscribe()` method. // Experimental. Subscribe(extension QueueExtension) awssqs.IQueue // The `SubscriptionQueue` object for the `ISubscribable` object. // Default: none. // // Experimental. SubscriptionQueue() *SubscriptionQueue }
An interface that will be implemented by all the resources that can be subscribed to. Experimental.
type ImportedEnvironment ¶
type ImportedEnvironment interface { constructs.Construct IEnvironment // The capacity type used by the service's cluster. // Experimental. CapacityType() EnvironmentCapacityType // The cluster that is providing capacity for this service. // Experimental. Cluster() awsecs.ICluster // The name of this environment. // Experimental. Id() *string // The tree node. // Experimental. Node() constructs.Node // The VPC into which environment services should be placed. // Experimental. Vpc() awsec2.IVpc // Adding a default cloudmap namespace to the cluster will throw an error, as we don't own it. // Experimental. AddDefaultCloudMapNamespace(_options *awsecs.CloudMapNamespaceOptions) // Returns a string representation of this construct. // Experimental. ToString() *string }
Experimental.
func NewImportedEnvironment ¶
func NewImportedEnvironment(scope constructs.Construct, id *string, props *EnvironmentAttributes) ImportedEnvironment
Experimental.
type InjectableTopic ¶
type InjectableTopic interface { IGrantInjectable // Experimental. Topic() awssns.ITopic // Experimental. EnvironmentVariables() *map[string]*string // Experimental. Grant(taskDefinition awsecs.TaskDefinition) }
The `InjectableTopic` class represents SNS Topic resource that can be published events to by the parent service. Experimental.
func NewInjectableTopic ¶
func NewInjectableTopic(props *InjectableTopicProps) InjectableTopic
Experimental.
type InjectableTopicProps ¶
type InjectableTopicProps struct { // The SNS Topic to publish events to. // Experimental. Topic awssns.ITopic `field:"required" json:"topic" yaml:"topic"` }
The settings for the `InjectableTopic` class. Experimental.
type InjecterExtension ¶
type InjecterExtension interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // Add hooks to the main application extension so that it is modified to add the injectable resource environment variables to the container environment. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // After the task definition has been created, this hook grants the required permissions to the task role for the parent service. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
This extension accepts a list of `Injectable` resources that the parent service can publish events or write data to.
It sets up the corresponding permissions for the task role of the parent service. Experimental.
func NewInjecterExtension ¶
func NewInjecterExtension(props *InjecterExtensionProps) InjecterExtension
Experimental.
type InjecterExtensionProps ¶
type InjecterExtensionProps struct { // The list of injectable resources for this service. // Experimental. Injectables *[]IInjectable `field:"required" json:"injectables" yaml:"injectables"` }
The settings for the Injecter extension. Experimental.
type MeshProps ¶
type MeshProps struct { // The service mesh into which to register the service. // Experimental. Mesh awsappmesh.Mesh `field:"required" json:"mesh" yaml:"mesh"` // The protocol of the service. // // Valid values are Protocol.HTTP, Protocol.HTTP2, Protocol.TCP, Protocol.GRPC // Default: - Protocol.HTTP // // Experimental. Protocol Protocol `field:"optional" json:"protocol" yaml:"protocol"` }
The settings for the App Mesh extension. Experimental.
type QueueAutoScalingOptions ¶
type QueueAutoScalingOptions struct { // Acceptable amount of time a message can sit in the queue (including the time required to process it). // Experimental. AcceptableLatency awscdk.Duration `field:"required" json:"acceptableLatency" yaml:"acceptableLatency"` // Average amount of time for processing a single message in the queue. // Experimental. MessageProcessingTime awscdk.Duration `field:"required" json:"messageProcessingTime" yaml:"messageProcessingTime"` }
Options for configuring SQS Queue auto scaling. Experimental.
type QueueExtension ¶
type QueueExtension interface { ServiceExtension // Experimental. AutoscalingOptions() *QueueAutoScalingOptions // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // Experimental. EventsQueue() awssqs.IQueue // The log group created by the extension where the AWS Lambda function logs are stored. // Experimental. LogGroup() awslogs.ILogGroup // Experimental. SetLogGroup(val awslogs.ILogGroup) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // Add hooks to the main application extension so that it is modified to add the events queue URL to the container environment. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // This hook creates (if required) and sets the default queue `eventsQueue`. // // It also sets up the subscriptions for // the provided `ISubscribable` objects. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is used to add target tracking // scaling policies for the SQS Queues of the service. It also creates an AWS Lambda // Function for calculating the backlog per task metric. // Experimental. UseService(service interface{}) // After the task definition has been created, this hook grants SQS permissions to the task role. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
This extension creates a default `eventsQueue` for the service (if not provided) and accepts a list of objects of type `ISubscribable` that the `eventsQueue` subscribes to.
It creates the subscriptions and sets up permissions for the service to consume messages from the SQS Queues.
It also configures a target tracking scaling policy for the service to maintain an acceptable queue latency by tracking the backlog per task. For more information, please refer: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-using-sqs-queue.html .
The default queue for this service can be accessed using the getter `<extension>.eventsQueue`. Experimental.
func NewQueueExtension ¶
func NewQueueExtension(props *QueueExtensionProps) QueueExtension
Experimental.
type QueueExtensionProps ¶
type QueueExtensionProps struct { // The user-provided default queue for this service. // // If the `eventsQueue` is not provided, a default SQS Queue is created for the service. // Default: none. // // Experimental. EventsQueue awssqs.IQueue `field:"optional" json:"eventsQueue" yaml:"eventsQueue"` // The user-provided queue delay fields to configure auto scaling for the default queue. // Default: none. // // Experimental. ScaleOnLatency *QueueAutoScalingOptions `field:"optional" json:"scaleOnLatency" yaml:"scaleOnLatency"` // The list of subscriptions for this service. // Default: none. // // Experimental. Subscriptions *[]ISubscribable `field:"optional" json:"subscriptions" yaml:"subscriptions"` }
The settings for the Queue extension. Experimental.
type ScaleOnCpuUtilization ¶
type ScaleOnCpuUtilization interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . Container() awsecs.ContainerDefinition // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . SetContainer(val awsecs.ContainerDefinition) // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ContainerMutatingHooks() *[]ContainerMutatingHook // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . SetContainerMutatingHooks(val *[]ContainerMutatingHook) // How many tasks to launch initially. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . InitialTaskCount() *float64 // The maximum number of tasks when scaling out. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . MaxTaskCount() *float64 // The minimum number of tasks when scaling in. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . MinTaskCount() *float64 // The name of the extension. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . Name() *string // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ParentService() Service // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . SetParentService(val Service) // How long to wait between scale in actions. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ScaleInCooldown() awscdk.Duration // How long to wait between scale out actions. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ScaleOutCooldown() awscdk.Duration // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . Scope() constructs.Construct // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . SetScope(val constructs.Construct) // The CPU utilization to try ot maintain. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . TargetCpuUtilization() *float64 // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . Prehook(parent Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. // For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling . UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
This extension helps you scale your service according to CPU utilization. Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling .
func NewScaleOnCpuUtilization
deprecated
func NewScaleOnCpuUtilization(props *CpuScalingProps) ScaleOnCpuUtilization
Deprecated: To enable target tracking based on CPU utilization, use the `targetCpuUtilization` property of `autoScaleTaskCount` in the `Service` construct. For more information, please refer https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling .
type Service ¶
type Service interface { constructs.Construct // The capacity type that this service will use. // // Valid values are EC2 or FARGATE. // Experimental. CapacityType() EnvironmentCapacityType // The cluster that is providing capacity for this service. // // [disable-awslint:ref-via-interface]. // Experimental. Cluster() awsecs.ICluster // The underlying ECS service that was created. // Experimental. EcsService() interface{} // Experimental. SetEcsService(val interface{}) // The environment where this service was launched. // Experimental. Environment() IEnvironment // The name of the service. // Experimental. Id() *string // The tree node. // Experimental. Node() constructs.Node // The scalable attribute representing task count. // Experimental. ScalableTaskCount() awsecs.ScalableTaskCount // The ServiceDescription used to build this service. // Experimental. ServiceDescription() ServiceDescription // The application target group if the service has an HTTPLoadBalancerExtension. // Experimental. TargetGroup() awselasticloadbalancingv2.ApplicationTargetGroup // Experimental. SetTargetGroup(val awselasticloadbalancingv2.ApplicationTargetGroup) // The generated task definition for this service. // // It is only // generated after .prepare() has been executed. // Experimental. TaskDefinition() awsecs.TaskDefinition // Experimental. SetTaskDefinition(val awsecs.TaskDefinition) // The VPC where this service should be placed. // Experimental. Vpc() awsec2.IVpc // This method adds a new URL for the service. // // This allows extensions to // submit a URL for the service. For example, a load balancer might add its // URL, or App Mesh can add its DNS name for the service. // Experimental. AddURL(urlName *string, url *string) // Tell extensions from one service to connect to extensions from another sevice if they have implemented a hook for it. // Experimental. ConnectTo(service Service, connectToProps *ConnectToProps) // This helper method is used to set the `autoScalingPoliciesEnabled` attribute whenever an auto scaling policy is configured for the service. // Experimental. EnableAutoScalingPolicy() // Retrieve a URL for the service. // // The URL must have previously been // stored by one of the URL providing extensions. // Experimental. GetURL(urlName *string) *string // Returns a string representation of this construct. // Experimental. ToString() *string }
This Service construct serves as a Builder class for an ECS service.
It supports various extensions and keeps track of any mutating state, allowing it to build up an ECS service progressively. Experimental.
func NewService ¶
func NewService(scope constructs.Construct, id *string, props *ServiceProps) Service
Experimental.
type ServiceBuild ¶
type ServiceBuild struct { // The cluster in which to launch the service. // Experimental. Cluster awsecs.ICluster `field:"required" json:"cluster" yaml:"cluster"` // The task definition registered to this service. // Experimental. TaskDefinition awsecs.TaskDefinition `field:"required" json:"taskDefinition" yaml:"taskDefinition"` // Specifies whether the task's elastic network interface receives a public IP address. // // If true, each task will receive a public IP address. // Default: - false. // // Experimental. AssignPublicIp *bool `field:"optional" json:"assignPublicIp" yaml:"assignPublicIp"` // Configuration for how to register the service in service discovery. // Default: - No Cloud Map configured. // // Experimental. CloudMapOptions *awsecs.CloudMapOptions `field:"optional" json:"cloudMapOptions" yaml:"cloudMapOptions"` // How many tasks to run. // Default: - 1. // // Experimental. DesiredCount *float64 `field:"optional" json:"desiredCount" yaml:"desiredCount"` // How long the healthcheck can fail during initial task startup before the task is considered unhealthy. // // This is used to give the task more // time to start passing healthchecks. // Default: - No grace period. // // Experimental. HealthCheckGracePeriod awscdk.Duration `field:"optional" json:"healthCheckGracePeriod" yaml:"healthCheckGracePeriod"` // Maximum percentage of tasks that can be launched. // Default: - 200. // // Experimental. MaxHealthyPercent *float64 `field:"optional" json:"maxHealthyPercent" yaml:"maxHealthyPercent"` // Minimum healthy task percentage. // Default: - 100. // // Experimental. MinHealthyPercent *float64 `field:"optional" json:"minHealthyPercent" yaml:"minHealthyPercent"` // Configuration for service connect for this service. // Default: - No Service Connect configured. // // Experimental. ServiceConnectConfiguration *awsecs.ServiceConnectProps `field:"optional" json:"serviceConnectConfiguration" yaml:"serviceConnectConfiguration"` }
A set of mutable service props in the process of being assembled using a builder pattern.
They will eventually to be translated into an ecs.Ec2ServiceProps or ecs.FargateServiceProps interface, depending on the environment's capacity type. Experimental.
type ServiceDescription ¶
type ServiceDescription interface { // The list of extensions that have been registered to run when preparing this service. // Experimental. Extensions() *map[string]ServiceExtension // Experimental. SetExtensions(val *map[string]ServiceExtension) // Adds a new extension to the service. // // The extensions mutate a service // to add resources to or configure properties for the service. // Experimental. Add(extension ServiceExtension) ServiceDescription // Get the extension with a specific name. // // This is generally used by // extensions in order to discover each other. // Experimental. Get(name *string) ServiceExtension }
A ServiceDescription is a wrapper for all of the extensions that a user wants to add to an ECS Service.
It collects all of the extensions that are added to a service, allowing each extension to query the full list of extensions added to a service to determine information about how to self-configure. Experimental.
type ServiceExtension ¶
type ServiceExtension interface { // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(parent Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
The shape of a service extension.
This abstract class is implemented by other extensions that extend the hooks to implement any custom logic that they want to run during each step of preparing the service. Experimental.
type ServiceProps ¶
type ServiceProps struct { // The environment to launch the service in. // Experimental. Environment IEnvironment `field:"required" json:"environment" yaml:"environment"` // The ServiceDescription used to build the service. // Experimental. ServiceDescription ServiceDescription `field:"required" json:"serviceDescription" yaml:"serviceDescription"` // The options for configuring the auto scaling target. // Default: none. // // Experimental. AutoScaleTaskCount *AutoScalingOptions `field:"optional" json:"autoScaleTaskCount" yaml:"autoScaleTaskCount"` // The desired number of instantiations of the task definition to keep running on the service. // Default: - When creating the service, default is 1; when updating the service, default uses // the current task number. // // Experimental. DesiredCount *float64 `field:"optional" json:"desiredCount" yaml:"desiredCount"` // The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. // Default: - A task role is automatically created for you. // // Experimental. TaskRole awsiam.IRole `field:"optional" json:"taskRole" yaml:"taskRole"` }
The settings for an ECS Service. Experimental.
type SubscriptionQueue ¶
type SubscriptionQueue struct { // The user-provided queue to subscribe to the given topic. // Experimental. Queue awssqs.IQueue `field:"required" json:"queue" yaml:"queue"` // The user-provided queue delay fields to configure auto scaling for the topic-specific queue. // Default: none. // // Experimental. ScaleOnLatency *QueueAutoScalingOptions `field:"optional" json:"scaleOnLatency" yaml:"scaleOnLatency"` }
`SubscriptionQueue` represents the subscription queue object which includes the topic-specific queue and its corresponding auto scaling fields. Experimental.
type TopicSubscription ¶
type TopicSubscription interface { ISubscribable // The queue that subscribes to the given topic. // Default: none. // // Deprecated: use `subscriptionQueue`. Queue() awssqs.IQueue // The subscription queue object for this subscription. // Default: none. // // Experimental. SubscriptionQueue() *SubscriptionQueue // Experimental. Topic() awssns.ITopic // This method sets up SNS Topic subscriptions for the SQS queue provided by the user. // // If a `queue` is not provided, // the default `eventsQueue` subscribes to the given topic. // // Returns: the queue subscribed to the given topic. // Experimental. Subscribe(extension QueueExtension) awssqs.IQueue }
The `TopicSubscription` class represents an SNS Topic resource that can be subscribed to by the service queues. Experimental.
func NewTopicSubscription ¶
func NewTopicSubscription(props *TopicSubscriptionProps) TopicSubscription
Experimental.
type TopicSubscriptionProps ¶
type TopicSubscriptionProps struct { // The SNS Topic to subscribe to. // Experimental. Topic awssns.ITopic `field:"required" json:"topic" yaml:"topic"` // The user-provided queue to subscribe to the given topic. // Default: none. // // Deprecated: use `topicSubscriptionQueue`. Queue awssqs.IQueue `field:"optional" json:"queue" yaml:"queue"` // The object representing topic-specific queue and corresponding queue delay fields to configure auto scaling. // // If not provided, the default `eventsQueue` will subscribe to the given topic. // Default: none. // // Experimental. TopicSubscriptionQueue *SubscriptionQueue `field:"optional" json:"topicSubscriptionQueue" yaml:"topicSubscriptionQueue"` }
The topic-specific settings for creating the queue subscriptions. Experimental.
type XRayExtension ¶
type XRayExtension interface { ServiceExtension // The container for this extension. // // Most extensions have a container, but not // every extension is required to have a container. Some extensions may just // modify the properties of the service, or create external resources // connected to the service. // Experimental. Container() awsecs.ContainerDefinition // Experimental. SetContainer(val awsecs.ContainerDefinition) // Experimental. ContainerMutatingHooks() *[]ContainerMutatingHook // Experimental. SetContainerMutatingHooks(val *[]ContainerMutatingHook) // The name of the extension. // Experimental. Name() *string // Experimental. SetName(val *string) // The service which this extension is being added to. // // Initially, extensions are collected into a ServiceDescription, but no service // exists yet. Later, when the ServiceDescription is used to create a service, // the extension is told what Service it is now working on. // Experimental. ParentService() Service // Experimental. SetParentService(val Service) // Experimental. Scope() constructs.Construct // Experimental. SetScope(val constructs.Construct) // This hook allows another service extension to register a mutating hook for changing the primary container of this extension. // // This is primarily used // for the application extension. For example, the Firelens extension wants to // be able to modify the settings of the application container to // route logs through Firelens. // Experimental. AddContainerMutatingHook(hook ContainerMutatingHook) // A hook that allows the extension to add hooks to other extensions that are registered. // Experimental. AddHooks() // This hook allows the extension to establish a connection to extensions from another service. // // Usually used for things like // allowing one service to talk to the load balancer or service mesh // proxy for another service. // Experimental. ConnectToService(service Service, connectToProps *ConnectToProps) // Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created. // Experimental. ModifyServiceProps(props *ServiceBuild) *ServiceBuild // This is a hook which allows extensions to modify the settings of the task definition prior to it being created. // // For example, the App Mesh // extension needs to configure an Envoy proxy in the task definition, // or the Application extension wants to set the overall resource for // the task. // Experimental. ModifyTaskDefinitionProps(props *awsecs.TaskDefinitionProps) *awsecs.TaskDefinitionProps // A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance. // Experimental. Prehook(service Service, scope constructs.Construct) // Once all containers are added to the task definition, this hook is called for each extension to give it a chance to resolve its dependency graph so that its container starts in the right order based on the other extensions that were enabled. // Experimental. ResolveContainerDependencies() // When this hook is implemented by extension, it allows the extension to use the service which has been created. // // It is generally used to // create any final resources which might depend on the service itself. // Experimental. UseService(service interface{}) // Once the task definition is created, this hook is called for each extension to give it a chance to add containers to the task definition, change the task definition's role to add permissions, etc. // Experimental. UseTaskDefinition(taskDefinition awsecs.TaskDefinition) }
This extension adds an X-Ray daemon inside the task definition for capturing application trace spans and submitting them to the AWS X-Ray service. Experimental.
Source Files
¶
- AliasedPortExtension.go
- AliasedPortExtension__checks.go
- AliasedPortMutatingHook.go
- AliasedPortMutatingHookProps.go
- AliasedPortMutatingHook__checks.go
- AliasedPortProps.go
- AppMeshExtension.go
- AppMeshExtension__checks.go
- AssignPublicIpDnsOptions.go
- AssignPublicIpExtension.go
- AssignPublicIpExtensionOptions.go
- AssignPublicIpExtension__checks.go
- AutoScalingOptions.go
- CloudwatchAgentExtension.go
- CloudwatchAgentExtension__checks.go
- ConnectToProps.go
- Container.go
- ContainerExtensionProps.go
- ContainerMutatingHook.go
- ContainerMutatingHook__checks.go
- Container__checks.go
- CpuScalingProps.go
- Environment.go
- EnvironmentAttributes.go
- EnvironmentCapacityType.go
- EnvironmentProps.go
- Environment__checks.go
- FireLensExtension.go
- FireLensExtension__checks.go
- FirelensMutatingHook.go
- FirelensMutatingHook__checks.go
- FirelensProps.go
- HttpLoadBalancerExtension.go
- HttpLoadBalancerExtension__checks.go
- HttpLoadBalancerProps.go
- IEnvironment.go
- IEnvironment__checks.go
- IGrantInjectable.go
- IGrantInjectable__checks.go
- IInjectable.go
- ISubscribable.go
- ISubscribable__checks.go
- ImportedEnvironment.go
- ImportedEnvironment__checks.go
- InjectableTopic.go
- InjectableTopicProps.go
- InjectableTopic__checks.go
- InjecterExtension.go
- InjecterExtensionProps.go
- InjecterExtension__checks.go
- MeshProps.go
- Protocol.go
- QueueAutoScalingOptions.go
- QueueExtension.go
- QueueExtensionProps.go
- QueueExtension__checks.go
- ScaleOnCpuUtilization.go
- ScaleOnCpuUtilization__checks.go
- Service.go
- ServiceBuild.go
- ServiceDescription.go
- ServiceDescription__checks.go
- ServiceExtension.go
- ServiceExtension__checks.go
- ServiceProps.go
- Service__checks.go
- SubscriptionQueue.go
- TopicSubscription.go
- TopicSubscriptionProps.go
- TopicSubscription__checks.go
- XRayExtension.go
- XRayExtension__checks.go
- main.go