import * as core from "@terrascript/core"; export interface OrderedPlacementStrategyArgs extends core.SchemaArgs { field?: string | core.StringOut; type: string | core.StringOut; } export class OrderedPlacementStrategy extends core.Schema { @core.attr(String) public field?: string | core.StringOut; @core.attr(String) public type!: string | core.StringOut; } export interface PlacementConstraintsArgs extends core.SchemaArgs { expression?: string | core.StringOut; type: string | core.StringOut; } export class PlacementConstraints extends core.Schema { @core.attr(String) public expression?: string | core.StringOut; @core.attr(String) public type!: string | core.StringOut; } export interface DeploymentCircuitBreakerArgs extends core.SchemaArgs { enable: boolean | core.BooleanOut; rollback: boolean | core.BooleanOut; } export class DeploymentCircuitBreaker extends core.Schema { @core.attr(Boolean) public enable!: boolean | core.BooleanOut; @core.attr(Boolean) public rollback!: boolean | core.BooleanOut; } export interface CapacityProviderStrategyArgs extends core.SchemaArgs { base?: number | core.NumberOut; capacityProvider: string | core.StringOut; weight?: number | core.NumberOut; } export class CapacityProviderStrategy extends core.Schema { @core.attr(Number) public base?: number | core.NumberOut; @core.attr(String) public capacityProvider!: string | core.StringOut; @core.attr(Number) public weight?: number | core.NumberOut; } export interface DeploymentControllerArgs extends core.SchemaArgs { type?: string | core.StringOut; } export class DeploymentController extends core.Schema { @core.attr(String) public type?: string | core.StringOut; } export interface NetworkConfigurationArgs extends core.SchemaArgs { assignPublicIp?: boolean | core.BooleanOut; securityGroups?: core.Array | core.ArrayOut; subnets: core.Array | core.ArrayOut; } export class NetworkConfiguration extends core.Schema { @core.attr(Boolean) public assignPublicIp?: boolean | core.BooleanOut; @core.attr(String, { kind: "array" }) public securityGroups?: core.Array | core.ArrayOut; @core.attr(String, { kind: "array" }) public subnets!: core.Array | core.ArrayOut; } export interface LoadBalancerArgs extends core.SchemaArgs { containerName: string | core.StringOut; containerPort: number | core.NumberOut; elbName?: string | core.StringOut; targetGroupArn?: string | core.StringOut; } export class LoadBalancer extends core.Schema { @core.attr(String) public containerName!: string | core.StringOut; @core.attr(Number) public containerPort!: number | core.NumberOut; @core.attr(String) public elbName?: string | core.StringOut; @core.attr(String) public targetGroupArn?: string | core.StringOut; } export interface ServiceRegistriesArgs extends core.SchemaArgs { containerName?: string | core.StringOut; containerPort?: number | core.NumberOut; port?: number | core.NumberOut; registryArn: string | core.StringOut; } export class ServiceRegistries extends core.Schema { @core.attr(String) public containerName?: string | core.StringOut; @core.attr(Number) public containerPort?: number | core.NumberOut; @core.attr(Number) public port?: number | core.NumberOut; @core.attr(String) public registryArn!: string | core.StringOut; } export interface ServiceArgs extends core.ResourceArgs { /** * (Optional) Capacity provider strategies to use for the service. Can be one or more. These can be upd * ated without destroying and recreating the service only if `force_new_deployment = true` and not cha * nging from 0 `capacity_provider_strategy` blocks to greater than 0, or vice versa. See below. */ capacityProviderStrategy?: | core.Array | core.ArrayOut; /** * (Optional) ARN of an ECS cluster. */ cluster?: string | core.StringOut; /** * (Optional) Configuration block for deployment circuit breaker. See below. */ deploymentCircuitBreaker?: DeploymentCircuitBreaker; /** * (Optional) Configuration block for deployment controller configuration. See below. */ deploymentController?: DeploymentController; /** * (Optional) Upper limit (as a percentage of the service's desiredCount) of the number of running task * s that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling * strategy. */ deploymentMaximumPercent?: number | core.NumberOut; /** * (Optional) Lower limit (as a percentage of the service's desiredCount) of the number of running task * s that must remain running and healthy in a service during a deployment. */ deploymentMinimumHealthyPercent?: number | core.NumberOut; /** * (Optional) Number of instances of the task definition to place and keep running. Defaults to 0. Do n * ot specify if using the `DAEMON` scheduling strategy. */ desiredCount?: number | core.NumberOut; /** * (Optional) Specifies whether to enable Amazon ECS managed tags for the tasks within the service. */ enableEcsManagedTags?: boolean | core.BooleanOut; /** * (Optional) Specifies whether to enable Amazon ECS Exec for the tasks within the service. */ enableExecuteCommand?: boolean | core.BooleanOut; /** * (Optional) Enable to force a new task deployment of the service. This can be used to update tasks to * use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tas * ks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_ * constraints` updates. */ forceNewDeployment?: boolean | core.BooleanOut; /** * (Optional) Seconds to ignore failing load balancer health checks on newly instantiated tasks to prev * ent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers. */ healthCheckGracePeriodSeconds?: number | core.NumberOut; /** * (Optional) ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your be * half. This parameter is required if you are using a load balancer with your service, but only if you * r task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not spe * cify this role. If your account has already created the Amazon ECS service-linked role, that role is * used by default for your service unless you specify a role here. */ iamRole?: string | core.StringOut; /** * (Optional) Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXT * ERNAL`. Defaults to `EC2`. */ launchType?: string | core.StringOut; /** * (Optional) Configuration block for load balancers. See below. */ loadBalancer?: core.Array | core.ArrayOut; /** * (Required) Name of the service (up to 255 letters, numbers, hyphens, and underscores) */ name: string | core.StringOut; /** * (Optional) Network configuration for the service. This parameter is required for task definitions th * at use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not suppo * rted for other network modes. See below. */ networkConfiguration?: NetworkConfiguration; /** * (Optional) Service level strategy rules that are taken into consideration during task placement. Lis * t from top to bottom in order of precedence. Updates to this configuration will take effect next tas * k deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_stra * tegy` blocks is `5`. See below. */ orderedPlacementStrategy?: | core.Array | core.ArrayOut; /** * (Optional) Rules that are taken into consideration during task placement. Updates to this configurat * ion will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number o * f `placement_constraints` is `10`. See below. */ placementConstraints?: | core.Array | core.ArrayOut; /** * (Optional) Platform version on which to run your service. Only applicable for `launch_type` set to ` * FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the * [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions. * html). */ platformVersion?: string | core.StringOut; /** * (Optional) Specifies whether to propagate the tags from the task definition or the service to the ta * sks. The valid values are `SERVICE` and `TASK_DEFINITION`. */ propagateTags?: string | core.StringOut; /** * (Optional) Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. * Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTE * RNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws. * amazon.com/AmazonECS/latest/APIReference/API_CreateService.html). */ schedulingStrategy?: string | core.StringOut; /** * (Optional) Service discovery registries for the service. The maximum number of `service_registries` * blocks is `1`. See below. */ serviceRegistries?: ServiceRegistries; /** * (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configurati * on block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configurati * on-block) present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ tagsAll?: core.Map | core.MapOut; /** * (Optional) Family and revision (`family:revision`) or full ARN of the task definition that you want * to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is * not specified, the latest `ACTIVE` revision is used. */ taskDefinition?: string | core.StringOut; /** * (Optional) If `true`, Terraform will wait for the service to reach a steady state (like [`aws ecs wa * it services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html) * ) before continuing. Default `false`. */ waitForSteadyState?: boolean | core.BooleanOut; } export class Service extends core.Resource { /** * (Optional) Capacity provider strategies to use for the service. Can be one or more. These can be upd * ated without destroying and recreating the service only if `force_new_deployment = true` and not cha * nging from 0 `capacity_provider_strategy` blocks to greater than 0, or vice versa. See below. */ @core.attr(CapacityProviderStrategy, { kind: "array" }) public capacityProviderStrategy?: | core.Array | core.ArrayOut; /** * (Optional) ARN of an ECS cluster. */ @core.attr(String, { computed: true }) public cluster?: string | core.StringOut; /** * (Optional) Configuration block for deployment circuit breaker. See below. */ @core.attr(DeploymentCircuitBreaker) public deploymentCircuitBreaker?: DeploymentCircuitBreaker; /** * (Optional) Configuration block for deployment controller configuration. See below. */ @core.attr(DeploymentController) public deploymentController?: DeploymentController; /** * (Optional) Upper limit (as a percentage of the service's desiredCount) of the number of running task * s that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling * strategy. */ @core.attr(Number) public deploymentMaximumPercent?: number | core.NumberOut; /** * (Optional) Lower limit (as a percentage of the service's desiredCount) of the number of running task * s that must remain running and healthy in a service during a deployment. */ @core.attr(Number) public deploymentMinimumHealthyPercent?: number | core.NumberOut; /** * (Optional) Number of instances of the task definition to place and keep running. Defaults to 0. Do n * ot specify if using the `DAEMON` scheduling strategy. */ @core.attr(Number) public desiredCount?: number | core.NumberOut; /** * (Optional) Specifies whether to enable Amazon ECS managed tags for the tasks within the service. */ @core.attr(Boolean) public enableEcsManagedTags?: boolean | core.BooleanOut; /** * (Optional) Specifies whether to enable Amazon ECS Exec for the tasks within the service. */ @core.attr(Boolean) public enableExecuteCommand?: boolean | core.BooleanOut; /** * (Optional) Enable to force a new task deployment of the service. This can be used to update tasks to * use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tas * ks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_ * constraints` updates. */ @core.attr(Boolean) public forceNewDeployment?: boolean | core.BooleanOut; /** * (Optional) Seconds to ignore failing load balancer health checks on newly instantiated tasks to prev * ent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers. */ @core.attr(Number) public healthCheckGracePeriodSeconds?: number | core.NumberOut; /** * (Optional) ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your be * half. This parameter is required if you are using a load balancer with your service, but only if you * r task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not spe * cify this role. If your account has already created the Amazon ECS service-linked role, that role is * used by default for your service unless you specify a role here. */ @core.attr(String, { computed: true }) public iamRole?: string | core.StringOut; /** * ARN that identifies the service. */ @core.attr(String, { computed: true }) public id!: string | core.StringOut; /** * (Optional) Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXT * ERNAL`. Defaults to `EC2`. */ @core.attr(String, { computed: true }) public launchType?: string | core.StringOut; /** * (Optional) Configuration block for load balancers. See below. */ @core.attr(LoadBalancer, { kind: "array" }) public loadBalancer?: core.Array | core.ArrayOut; /** * (Required) Name of the service (up to 255 letters, numbers, hyphens, and underscores) */ @core.attr(String) public name!: string | core.StringOut; /** * (Optional) Network configuration for the service. This parameter is required for task definitions th * at use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not suppo * rted for other network modes. See below. */ @core.attr(NetworkConfiguration) public networkConfiguration?: NetworkConfiguration; /** * (Optional) Service level strategy rules that are taken into consideration during task placement. Lis * t from top to bottom in order of precedence. Updates to this configuration will take effect next tas * k deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_stra * tegy` blocks is `5`. See below. */ @core.attr(OrderedPlacementStrategy, { kind: "array" }) public orderedPlacementStrategy?: | core.Array | core.ArrayOut; /** * (Optional) Rules that are taken into consideration during task placement. Updates to this configurat * ion will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number o * f `placement_constraints` is `10`. See below. */ @core.attr(PlacementConstraints, { kind: "array" }) public placementConstraints?: | core.Array | core.ArrayOut; /** * (Optional) Platform version on which to run your service. Only applicable for `launch_type` set to ` * FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the * [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions. * html). */ @core.attr(String, { computed: true }) public platformVersion?: string | core.StringOut; /** * (Optional) Specifies whether to propagate the tags from the task definition or the service to the ta * sks. The valid values are `SERVICE` and `TASK_DEFINITION`. */ @core.attr(String) public propagateTags?: string | core.StringOut; /** * (Optional) Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. * Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTE * RNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws. * amazon.com/AmazonECS/latest/APIReference/API_CreateService.html). */ @core.attr(String) public schedulingStrategy?: string | core.StringOut; /** * (Optional) Service discovery registries for the service. The maximum number of `service_registries` * blocks is `1`. See below. */ @core.attr(ServiceRegistries) public serviceRegistries?: ServiceRegistries; /** * (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configurati * on block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configurati * on-block) present, tags with matching keys will overwrite those defined at the provider-level. */ @core.attr(String, { kind: "map" }) public tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ @core.attr(String, { computed: true, kind: "map" }) public tagsAll?: core.Map | core.MapOut; /** * (Optional) Family and revision (`family:revision`) or full ARN of the task definition that you want * to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is * not specified, the latest `ACTIVE` revision is used. */ @core.attr(String) public taskDefinition?: string | core.StringOut; /** * (Optional) If `true`, Terraform will wait for the service to reach a steady state (like [`aws ecs wa * it services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html) * ) before continuing. Default `false`. */ @core.attr(Boolean) public waitForSteadyState?: boolean | core.BooleanOut; constructor(name: string, args?: ServiceArgs) { super(name, "aws_ecs_service", args); } public override getNamespace(): string { return "aws_ecs"; } }