Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions src/components/ecs-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const service = new studion.EcsService('api', {
desiredCount: 2,
enableServiceAutoDiscovery: true,
autoscaling: {
// Partial autoscaling config keeps default min/max counts
enabled: true,
minCount: 2,
maxCount: 6,
},
volumes: [{ name: 'shared-data' }],
Expand Down Expand Up @@ -103,7 +103,7 @@ export const persistentMountTargetIds = ecsService.persistentStorage.apply(
- The CloudWatch log group always uses `retentionInDays: 14` and defaults `namePrefix` to `/ecs/${name}-` unless `logGroupNamePrefix` is provided.
- The service always uses `launchType: 'FARGATE'` and `enableExecuteCommand: true`.
- The task definition always uses `networkMode: 'awsvpc'` and `requiresCompatibilities: ['FARGATE']`.
- Default ECS settings are `deploymentController: 'ECS'`, `desiredCount: 1`, `size: 'small'`, `assignPublicIp: false`, service discovery disabled, and autoscaling disabled with min/max counts of `1`.
- Default ECS settings are `deploymentController: 'ECS'`, `desiredCount: 1`, `size: 'small'`, `assignPublicIp: false`, service discovery disabled, and autoscaling disabled with min/max counts of `1`. Partial `autoscaling` objects preserve omitted defaults, so `autoscaling: { enabled: true }` keeps `minCount: 1` and `maxCount: 1` unless you override them.
- Network placement depends on `assignPublicIp`: public subnets are used when it is `true`, otherwise private subnets are used.
- Autoscaling, when enabled, is fixed to target-tracking policies for `ECSServiceAverageMemoryUtilization` and `ECSServiceAverageCPUUtilization`, both with `targetValue: 70`.
- Declaring any volumes creates one shared encrypted EFS file system, one access point rooted at `/data`, and exposes the resulting storage resources through `persistentStorage`; all logical ECS volumes map to that same backing storage.
Expand Down Expand Up @@ -146,27 +146,27 @@ class EcsService extends pulumi.ComponentResource {

Direct constructor input: `args: EcsService.Args`

| Property | Description |
| ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `cluster`\*<br/>`pulumi.Input<aws.ecs.Cluster>` | ECS cluster that will run the service. |
| `vpc`\*<br/>`pulumi.Input<awsx.ec2.Vpc>` | Provides subnets, VPC ID, and CIDR-based security group rules. |
| `containers`\*<br/>`EcsService.Container[]` | Full task container list. |
| `loadBalancers`<br/>`pulumi.Input<EcsService.LoadBalancerConfig[]>` | Optional ECS service-to-target-group registrations. |
| `volumes`<br/>`pulumi.Input<pulumi.Input<EcsService.PersistentStorageVolume>[]>` | Any non-empty value triggers creation of shared EFS-backed persistent storage. Default: `[]`. |
| `name`<br/>`pulumi.Input<string>` | ECS service name override. Default: component name. |
| `deploymentController`<br/>`'ECS' \| 'CODE_DEPLOY' \| 'EXTERNAL'` | ECS deployment controller type. Default: `'ECS'`. |
| `desiredCount`<br/>`pulumi.Input<number>` | Initial desired task count. Default: `1`. |
| `family`<br/>`pulumi.Input<string>` | Task definition family. Default: `<name>-task-definition-<stack>`. |
| `size`<br/>`pulumi.Input<TaskSize>` | CPU/memory preset or explicit `{ cpu, memory }` object. Default: `'small'`. |
| `logGroupNamePrefix`<br/>`pulumi.Input<string>` | Passed to `aws.cloudwatch.LogGroup.namePrefix`. Default: `/ecs/<name>-`. |
| `securityGroup`<br/>`pulumi.Input<aws.ec2.SecurityGroup>` | If omitted, the component creates a VPC-wide internal service security group. Default: generated default SG. |
| `assignPublicIp`<br/>`boolean` | Selects public subnets when `true`, otherwise private subnets. Default: `false`. |
| `taskExecutionRoleInlinePolicies`<br/>`pulumi.Input<pulumi.Input<EcsService.RoleInlinePolicy>[]>` | Extra inline policies merged into the generated execution role. Default: `[]`. |
| `taskRoleInlinePolicies`<br/>`pulumi.Input<pulumi.Input<EcsService.RoleInlinePolicy>[]>` | Extra inline policies merged into the generated task role. Default: `[]`. |
| `enableServiceAutoDiscovery`<br/>`boolean` | Creates a private DNS namespace and Cloud Map service. Default: `false`. |
| `autoscaling`<br/>`pulumi.Input<{ enabled: boolean; minCount?: pulumi.Input<number>; maxCount?: pulumi.Input<number> }>` | ECS target-tracking autoscaling configuration. Default: disabled. |
| `region`<br/>`pulumi.Input<string>` | AWS region used for region-specific ECS settings such as CloudWatch Logs. Default: active AWS provider's region. |
| `tags`<br/>`pulumi.Input<EcsService.Tags>` | Additional tags merged with the package common tags. |
| Property | Description |
| ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cluster`\*<br/>`pulumi.Input<aws.ecs.Cluster>` | ECS cluster that will run the service. |
| `vpc`\*<br/>`pulumi.Input<awsx.ec2.Vpc>` | Provides subnets, VPC ID, and CIDR-based security group rules. |
| `containers`\*<br/>`EcsService.Container[]` | Full task container list. |
| `loadBalancers`<br/>`pulumi.Input<EcsService.LoadBalancerConfig[]>` | Optional ECS service-to-target-group registrations. |
| `volumes`<br/>`pulumi.Input<pulumi.Input<EcsService.PersistentStorageVolume>[]>` | Any non-empty value triggers creation of shared EFS-backed persistent storage. Default: `[]`. |
| `name`<br/>`pulumi.Input<string>` | ECS service name override. Default: component name. |
| `deploymentController`<br/>`'ECS' \| 'CODE_DEPLOY' \| 'EXTERNAL'` | ECS deployment controller type. Default: `'ECS'`. |
| `desiredCount`<br/>`pulumi.Input<number>` | Initial desired task count. Default: `1`. |
| `family`<br/>`pulumi.Input<string>` | Task definition family. Default: `<name>-task-definition-<stack>`. |
| `size`<br/>`pulumi.Input<TaskSize>` | CPU/memory preset or explicit `{ cpu, memory }` object. Default: `'small'`. |
| `logGroupNamePrefix`<br/>`pulumi.Input<string>` | Passed to `aws.cloudwatch.LogGroup.namePrefix`. Default: `/ecs/<name>-`. |
| `securityGroup`<br/>`pulumi.Input<aws.ec2.SecurityGroup>` | If omitted, the component creates a VPC-wide internal service security group. Default: generated default SG. |
| `assignPublicIp`<br/>`boolean` | Selects public subnets when `true`, otherwise private subnets. Default: `false`. |
| `taskExecutionRoleInlinePolicies`<br/>`pulumi.Input<pulumi.Input<EcsService.RoleInlinePolicy>[]>` | Extra inline policies merged into the generated execution role. Default: `[]`. |
| `taskRoleInlinePolicies`<br/>`pulumi.Input<pulumi.Input<EcsService.RoleInlinePolicy>[]>` | Extra inline policies merged into the generated task role. Default: `[]`. |
| `enableServiceAutoDiscovery`<br/>`boolean` | Creates a private DNS namespace and Cloud Map service. Default: `false`. |
| `autoscaling`<br/>`pulumi.Input<{ enabled: boolean; minCount?: pulumi.Input<number>; maxCount?: pulumi.Input<number> }>` | ECS target-tracking autoscaling configuration. Partial configs preserve omitted nested defaults. Default: `{ enabled: false, minCount: 1, maxCount: 1 }`. |
| `region`<br/>`pulumi.Input<string>` | AWS region used for region-specific ECS settings such as CloudWatch Logs. Default: active AWS provider's region. |
| `tags`<br/>`pulumi.Input<EcsService.Tags>` | Additional tags merged with the package common tags. |

**Outputs**

Expand Down
Loading