AWS Native

v0.43.0 published on Thursday, Dec 1, 2022 by Pulumi

CapacityProvider

Resource Type definition for AWS::ECS::CapacityProvider.

Example Usage

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var myCapacityProvider = new AwsNative.ECS.CapacityProvider("myCapacityProvider", new()
    {
        AutoScalingGroupProvider = new AwsNative.ECS.Inputs.CapacityProviderAutoScalingGroupProviderArgs
        {
            AutoScalingGroupArn = "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup",
            ManagedScaling = new AwsNative.ECS.Inputs.CapacityProviderManagedScalingArgs
            {
                MaximumScalingStepSize = 10,
                MinimumScalingStepSize = 1,
                Status = AwsNative.ECS.CapacityProviderManagedScalingStatus.Enabled,
                TargetCapacity = 100,
            },
            ManagedTerminationProtection = AwsNative.ECS.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Enabled,
        },
        Tags = new[]
        {
            new AwsNative.ECS.Inputs.CapacityProviderTagArgs
            {
                Key = "environment",
                Value = "production",
            },
        },
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

my_capacity_provider = aws_native.ecs.CapacityProvider("myCapacityProvider",
    auto_scaling_group_provider=aws_native.ecs.CapacityProviderAutoScalingGroupProviderArgs(
        auto_scaling_group_arn="arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup",
        managed_scaling=aws_native.ecs.CapacityProviderManagedScalingArgs(
            maximum_scaling_step_size=10,
            minimum_scaling_step_size=1,
            status=aws_native.ecs.CapacityProviderManagedScalingStatus.ENABLED,
            target_capacity=100,
        ),
        managed_termination_protection=aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.ENABLED,
    ),
    tags=[aws_native.ecs.CapacityProviderTagArgs(
        key="environment",
        value="production",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const myCapacityProvider = new aws_native.ecs.CapacityProvider("myCapacityProvider", {
    autoScalingGroupProvider: {
        autoScalingGroupArn: "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup",
        managedScaling: {
            maximumScalingStepSize: 10,
            minimumScalingStepSize: 1,
            status: aws_native.ecs.CapacityProviderManagedScalingStatus.Enabled,
            targetCapacity: 100,
        },
        managedTerminationProtection: aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Enabled,
    },
    tags: [{
        key: "environment",
        value: "production",
    }],
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var myCapacityProvider = new AwsNative.ECS.CapacityProvider("myCapacityProvider", new()
    {
        AutoScalingGroupProvider = new AwsNative.ECS.Inputs.CapacityProviderAutoScalingGroupProviderArgs
        {
            AutoScalingGroupArn = "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup",
            ManagedScaling = new AwsNative.ECS.Inputs.CapacityProviderManagedScalingArgs
            {
                MaximumScalingStepSize = 10,
                MinimumScalingStepSize = 1,
                Status = AwsNative.ECS.CapacityProviderManagedScalingStatus.Enabled,
                TargetCapacity = 100,
            },
            ManagedTerminationProtection = AwsNative.ECS.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Enabled,
        },
        Tags = new[]
        {
            new AwsNative.ECS.Inputs.CapacityProviderTagArgs
            {
                Key = "environment",
                Value = "production",
            },
        },
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

my_capacity_provider = aws_native.ecs.CapacityProvider("myCapacityProvider",
    auto_scaling_group_provider=aws_native.ecs.CapacityProviderAutoScalingGroupProviderArgs(
        auto_scaling_group_arn="arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup",
        managed_scaling=aws_native.ecs.CapacityProviderManagedScalingArgs(
            maximum_scaling_step_size=10,
            minimum_scaling_step_size=1,
            status=aws_native.ecs.CapacityProviderManagedScalingStatus.ENABLED,
            target_capacity=100,
        ),
        managed_termination_protection=aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.ENABLED,
    ),
    tags=[aws_native.ecs.CapacityProviderTagArgs(
        key="environment",
        value="production",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const myCapacityProvider = new aws_native.ecs.CapacityProvider("myCapacityProvider", {
    autoScalingGroupProvider: {
        autoScalingGroupArn: "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:autoScalingGroupName/MyAutoScalingGroup",
        managedScaling: {
            maximumScalingStepSize: 10,
            minimumScalingStepSize: 1,
            status: aws_native.ecs.CapacityProviderManagedScalingStatus.Enabled,
            targetCapacity: 100,
        },
        managedTerminationProtection: aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Enabled,
    },
    tags: [{
        key: "environment",
        value: "production",
    }],
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var autoScalingGroupArn1 = config.Require("autoScalingGroupArn1");
    var autoScalingGroupArn2 = config.Require("autoScalingGroupArn2");
    var capacityProvider1 = new AwsNative.ECS.CapacityProvider("capacityProvider1", new()
    {
        AutoScalingGroupProvider = new AwsNative.ECS.Inputs.CapacityProviderAutoScalingGroupProviderArgs
        {
            AutoScalingGroupArn = autoScalingGroupArn1,
            ManagedScaling = new AwsNative.ECS.Inputs.CapacityProviderManagedScalingArgs
            {
                Status = AwsNative.ECS.CapacityProviderManagedScalingStatus.Enabled,
            },
            ManagedTerminationProtection = AwsNative.ECS.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Disabled,
        },
    });

    var capacityProvider2 = new AwsNative.ECS.CapacityProvider("capacityProvider2", new()
    {
        AutoScalingGroupProvider = new AwsNative.ECS.Inputs.CapacityProviderAutoScalingGroupProviderArgs
        {
            AutoScalingGroupArn = autoScalingGroupArn2,
            ManagedScaling = new AwsNative.ECS.Inputs.CapacityProviderManagedScalingArgs
            {
                Status = AwsNative.ECS.CapacityProviderManagedScalingStatus.Enabled,
            },
            ManagedTerminationProtection = AwsNative.ECS.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Disabled,
        },
    });

    var cluster = new AwsNative.ECS.Cluster("cluster");

    var clusterCPAssociation = new AwsNative.ECS.ClusterCapacityProviderAssociations("clusterCPAssociation", new()
    {
        Cluster = cluster.Id,
        CapacityProviders = new[]
        {
            capacityProvider1.Id,
            capacityProvider2.Id,
        },
        DefaultCapacityProviderStrategy = new[]
        {
            new AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
            {
                Base = 2,
                Weight = 6,
                CapacityProvider = capacityProvider1.Id,
            },
            new AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
            {
                Base = 0,
                Weight = 10,
                CapacityProvider = capacityProvider2.Id,
            },
        },
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

config = pulumi.Config()
auto_scaling_group_arn1 = config.require("autoScalingGroupArn1")
auto_scaling_group_arn2 = config.require("autoScalingGroupArn2")
capacity_provider1 = aws_native.ecs.CapacityProvider("capacityProvider1", auto_scaling_group_provider=aws_native.ecs.CapacityProviderAutoScalingGroupProviderArgs(
    auto_scaling_group_arn=auto_scaling_group_arn1,
    managed_scaling=aws_native.ecs.CapacityProviderManagedScalingArgs(
        status=aws_native.ecs.CapacityProviderManagedScalingStatus.ENABLED,
    ),
    managed_termination_protection=aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.DISABLED,
))
capacity_provider2 = aws_native.ecs.CapacityProvider("capacityProvider2", auto_scaling_group_provider=aws_native.ecs.CapacityProviderAutoScalingGroupProviderArgs(
    auto_scaling_group_arn=auto_scaling_group_arn2,
    managed_scaling=aws_native.ecs.CapacityProviderManagedScalingArgs(
        status=aws_native.ecs.CapacityProviderManagedScalingStatus.ENABLED,
    ),
    managed_termination_protection=aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.DISABLED,
))
cluster = aws_native.ecs.Cluster("cluster")
cluster_cpassociation = aws_native.ecs.ClusterCapacityProviderAssociations("clusterCPAssociation",
    cluster=cluster.id,
    capacity_providers=[
        capacity_provider1.id,
        capacity_provider2.id,
    ],
    default_capacity_provider_strategy=[
        aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs(
            base=2,
            weight=6,
            capacity_provider=capacity_provider1.id,
        ),
        aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs(
            base=0,
            weight=10,
            capacity_provider=capacity_provider2.id,
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const config = new pulumi.Config();
const autoScalingGroupArn1 = config.require("autoScalingGroupArn1");
const autoScalingGroupArn2 = config.require("autoScalingGroupArn2");
const capacityProvider1 = new aws_native.ecs.CapacityProvider("capacityProvider1", {autoScalingGroupProvider: {
    autoScalingGroupArn: autoScalingGroupArn1,
    managedScaling: {
        status: aws_native.ecs.CapacityProviderManagedScalingStatus.Enabled,
    },
    managedTerminationProtection: aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Disabled,
}});
const capacityProvider2 = new aws_native.ecs.CapacityProvider("capacityProvider2", {autoScalingGroupProvider: {
    autoScalingGroupArn: autoScalingGroupArn2,
    managedScaling: {
        status: aws_native.ecs.CapacityProviderManagedScalingStatus.Enabled,
    },
    managedTerminationProtection: aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Disabled,
}});
const cluster = new aws_native.ecs.Cluster("cluster", {});
const clusterCPAssociation = new aws_native.ecs.ClusterCapacityProviderAssociations("clusterCPAssociation", {
    cluster: cluster.id,
    capacityProviders: [
        capacityProvider1.id,
        capacityProvider2.id,
    ],
    defaultCapacityProviderStrategy: [
        {
            base: 2,
            weight: 6,
            capacityProvider: capacityProvider1.id,
        },
        {
            base: 0,
            weight: 10,
            capacityProvider: capacityProvider2.id,
        },
    ],
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var autoScalingGroupArn1 = config.Require("autoScalingGroupArn1");
    var autoScalingGroupArn2 = config.Require("autoScalingGroupArn2");
    var capacityProvider1 = new AwsNative.ECS.CapacityProvider("capacityProvider1", new()
    {
        AutoScalingGroupProvider = new AwsNative.ECS.Inputs.CapacityProviderAutoScalingGroupProviderArgs
        {
            AutoScalingGroupArn = autoScalingGroupArn1,
            ManagedScaling = new AwsNative.ECS.Inputs.CapacityProviderManagedScalingArgs
            {
                Status = AwsNative.ECS.CapacityProviderManagedScalingStatus.Enabled,
            },
            ManagedTerminationProtection = AwsNative.ECS.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Disabled,
        },
    });

    var capacityProvider2 = new AwsNative.ECS.CapacityProvider("capacityProvider2", new()
    {
        AutoScalingGroupProvider = new AwsNative.ECS.Inputs.CapacityProviderAutoScalingGroupProviderArgs
        {
            AutoScalingGroupArn = autoScalingGroupArn2,
            ManagedScaling = new AwsNative.ECS.Inputs.CapacityProviderManagedScalingArgs
            {
                Status = AwsNative.ECS.CapacityProviderManagedScalingStatus.Enabled,
            },
            ManagedTerminationProtection = AwsNative.ECS.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Disabled,
        },
    });

    var cluster = new AwsNative.ECS.Cluster("cluster");

    var clusterCPAssociation = new AwsNative.ECS.ClusterCapacityProviderAssociations("clusterCPAssociation", new()
    {
        Cluster = cluster.Id,
        CapacityProviders = new[]
        {
            capacityProvider1.Id,
            capacityProvider2.Id,
        },
        DefaultCapacityProviderStrategy = new[]
        {
            new AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
            {
                Base = 2,
                Weight = 6,
                CapacityProvider = capacityProvider1.Id,
            },
            new AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
            {
                Base = 0,
                Weight = 10,
                CapacityProvider = capacityProvider2.Id,
            },
        },
    });

});

Coming soon!

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

config = pulumi.Config()
auto_scaling_group_arn1 = config.require("autoScalingGroupArn1")
auto_scaling_group_arn2 = config.require("autoScalingGroupArn2")
capacity_provider1 = aws_native.ecs.CapacityProvider("capacityProvider1", auto_scaling_group_provider=aws_native.ecs.CapacityProviderAutoScalingGroupProviderArgs(
    auto_scaling_group_arn=auto_scaling_group_arn1,
    managed_scaling=aws_native.ecs.CapacityProviderManagedScalingArgs(
        status=aws_native.ecs.CapacityProviderManagedScalingStatus.ENABLED,
    ),
    managed_termination_protection=aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.DISABLED,
))
capacity_provider2 = aws_native.ecs.CapacityProvider("capacityProvider2", auto_scaling_group_provider=aws_native.ecs.CapacityProviderAutoScalingGroupProviderArgs(
    auto_scaling_group_arn=auto_scaling_group_arn2,
    managed_scaling=aws_native.ecs.CapacityProviderManagedScalingArgs(
        status=aws_native.ecs.CapacityProviderManagedScalingStatus.ENABLED,
    ),
    managed_termination_protection=aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.DISABLED,
))
cluster = aws_native.ecs.Cluster("cluster")
cluster_cpassociation = aws_native.ecs.ClusterCapacityProviderAssociations("clusterCPAssociation",
    cluster=cluster.id,
    capacity_providers=[
        capacity_provider1.id,
        capacity_provider2.id,
    ],
    default_capacity_provider_strategy=[
        aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs(
            base=2,
            weight=6,
            capacity_provider=capacity_provider1.id,
        ),
        aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs(
            base=0,
            weight=10,
            capacity_provider=capacity_provider2.id,
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const config = new pulumi.Config();
const autoScalingGroupArn1 = config.require("autoScalingGroupArn1");
const autoScalingGroupArn2 = config.require("autoScalingGroupArn2");
const capacityProvider1 = new aws_native.ecs.CapacityProvider("capacityProvider1", {autoScalingGroupProvider: {
    autoScalingGroupArn: autoScalingGroupArn1,
    managedScaling: {
        status: aws_native.ecs.CapacityProviderManagedScalingStatus.Enabled,
    },
    managedTerminationProtection: aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Disabled,
}});
const capacityProvider2 = new aws_native.ecs.CapacityProvider("capacityProvider2", {autoScalingGroupProvider: {
    autoScalingGroupArn: autoScalingGroupArn2,
    managedScaling: {
        status: aws_native.ecs.CapacityProviderManagedScalingStatus.Enabled,
    },
    managedTerminationProtection: aws_native.ecs.CapacityProviderAutoScalingGroupProviderManagedTerminationProtection.Disabled,
}});
const cluster = new aws_native.ecs.Cluster("cluster", {});
const clusterCPAssociation = new aws_native.ecs.ClusterCapacityProviderAssociations("clusterCPAssociation", {
    cluster: cluster.id,
    capacityProviders: [
        capacityProvider1.id,
        capacityProvider2.id,
    ],
    defaultCapacityProviderStrategy: [
        {
            base: 2,
            weight: 6,
            capacityProvider: capacityProvider1.id,
        },
        {
            base: 0,
            weight: 10,
            capacityProvider: capacityProvider2.id,
        },
    ],
});

Coming soon!

Create CapacityProvider Resource

new CapacityProvider(name: string, args: CapacityProviderArgs, opts?: CustomResourceOptions);
@overload
def CapacityProvider(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     auto_scaling_group_provider: Optional[CapacityProviderAutoScalingGroupProviderArgs] = None,
                     name: Optional[str] = None,
                     tags: Optional[Sequence[CapacityProviderTagArgs]] = None)
@overload
def CapacityProvider(resource_name: str,
                     args: CapacityProviderArgs,
                     opts: Optional[ResourceOptions] = None)
func NewCapacityProvider(ctx *Context, name string, args CapacityProviderArgs, opts ...ResourceOption) (*CapacityProvider, error)
public CapacityProvider(string name, CapacityProviderArgs args, CustomResourceOptions? opts = null)
public CapacityProvider(String name, CapacityProviderArgs args)
public CapacityProvider(String name, CapacityProviderArgs args, CustomResourceOptions options)
type: aws-native:ecs:CapacityProvider
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CapacityProviderArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args CapacityProviderArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CapacityProviderArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CapacityProviderArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CapacityProviderArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CapacityProvider Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The CapacityProvider resource accepts the following input properties:

Outputs

All input properties are implicitly available as output properties. Additionally, the CapacityProvider resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Supporting Types

CapacityProviderAutoScalingGroupProvider

CapacityProviderAutoScalingGroupProviderManagedTerminationProtection

Disabled
DISABLED
Enabled
ENABLED
CapacityProviderAutoScalingGroupProviderManagedTerminationProtectionDisabled
DISABLED
CapacityProviderAutoScalingGroupProviderManagedTerminationProtectionEnabled
ENABLED
Disabled
DISABLED
Enabled
ENABLED
Disabled
DISABLED
Enabled
ENABLED
DISABLED
DISABLED
ENABLED
ENABLED
"DISABLED"
DISABLED
"ENABLED"
ENABLED

CapacityProviderManagedScaling

CapacityProviderManagedScalingStatus

Disabled
DISABLED
Enabled
ENABLED
CapacityProviderManagedScalingStatusDisabled
DISABLED
CapacityProviderManagedScalingStatusEnabled
ENABLED
Disabled
DISABLED
Enabled
ENABLED
Disabled
DISABLED
Enabled
ENABLED
DISABLED
DISABLED
ENABLED
ENABLED
"DISABLED"
DISABLED
"ENABLED"
ENABLED

CapacityProviderTag

Key string
Value string
Key string
Value string
key String
value String
key string
value string
key str
value str
key String
value String

Package Details

Repository
https://github.com/pulumi/pulumi-aws-native
License
Apache-2.0