CapacityProvider

class CapacityProvider : KotlinCustomResource

Provides an ECS cluster capacity provider. More information can be found on the ECS Developer Guide.

NOTE: Associating an ECS Capacity Provider to an Auto Scaling Group will automatically add the AmazonECSManaged tag to the Auto Scaling Group. This tag should be included in the aws.autoscaling.Group resource configuration to prevent the provider from removing it in subsequent executions as well as ensuring the AmazonECSManaged tag is propagated to all EC2 Instances in the Auto Scaling Group if min_size is above 0 on creation. Any EC2 Instances in the Auto Scaling Group without this tag must be manually be updated, otherwise they may cause unexpected scaling behavior and metrics.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.autoscaling.Group;
import com.pulumi.aws.autoscaling.GroupArgs;
import com.pulumi.aws.autoscaling.inputs.GroupTagArgs;
import com.pulumi.aws.ecs.CapacityProvider;
import com.pulumi.aws.ecs.CapacityProviderArgs;
import com.pulumi.aws.ecs.inputs.CapacityProviderAutoScalingGroupProviderArgs;
import com.pulumi.aws.ecs.inputs.CapacityProviderAutoScalingGroupProviderManagedScalingArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testGroup = new Group("testGroup", GroupArgs.builder()
.tags(GroupTagArgs.builder()
.key("AmazonECSManaged")
.value(true)
.propagateAtLaunch(true)
.build())
.build());
var testCapacityProvider = new CapacityProvider("testCapacityProvider", CapacityProviderArgs.builder()
.autoScalingGroupProvider(CapacityProviderAutoScalingGroupProviderArgs.builder()
.autoScalingGroupArn(testGroup.arn())
.managedTerminationProtection("ENABLED")
.managedScaling(CapacityProviderAutoScalingGroupProviderManagedScalingArgs.builder()
.maximumScalingStepSize(1000)
.minimumScalingStepSize(1)
.status("ENABLED")
.targetCapacity(10)
.build())
.build())
.build());
}
}

Import

ECS Capacity Providers can be imported using the name, e.g.,

$ pulumi import aws:ecs/capacityProvider:CapacityProvider example example

Properties

Link copied to clipboard
val arn: Output<String>

ARN that identifies the capacity provider.

Link copied to clipboard

Configuration block for the provider for the ECS auto scaling group. Detailed below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Name of the capacity provider.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>