
com.pulumi.aws.ecs.kotlin.ClusterCapacityProvidersArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.ecs.kotlin
import com.pulumi.aws.ecs.ClusterCapacityProvidersArgs.builder
import com.pulumi.aws.ecs.kotlin.inputs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs
import com.pulumi.aws.ecs.kotlin.inputs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Manages the capacity providers of an ECS Cluster.
* More information about capacity providers can be found in the [ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.ecs.Cluster("example", {name: "my-cluster"});
* const exampleClusterCapacityProviders = new aws.ecs.ClusterCapacityProviders("example", {
* clusterName: example.name,
* capacityProviders: ["FARGATE"],
* defaultCapacityProviderStrategies: [{
* base: 1,
* weight: 100,
* capacityProvider: "FARGATE",
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.ecs.Cluster("example", name="my-cluster")
* example_cluster_capacity_providers = aws.ecs.ClusterCapacityProviders("example",
* cluster_name=example.name,
* capacity_providers=["FARGATE"],
* default_capacity_provider_strategies=[{
* "base": 1,
* "weight": 100,
* "capacity_provider": "FARGATE",
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Ecs.Cluster("example", new()
* {
* Name = "my-cluster",
* });
* var exampleClusterCapacityProviders = new Aws.Ecs.ClusterCapacityProviders("example", new()
* {
* ClusterName = example.Name,
* CapacityProviders = new[]
* {
* "FARGATE",
* },
* DefaultCapacityProviderStrategies = new[]
* {
* new Aws.Ecs.Inputs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs
* {
* Base = 1,
* Weight = 100,
* CapacityProvider = "FARGATE",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := ecs.NewCluster(ctx, "example", &ecs.ClusterArgs{
* Name: pulumi.String("my-cluster"),
* })
* if err != nil {
* return err
* }
* _, err = ecs.NewClusterCapacityProviders(ctx, "example", &ecs.ClusterCapacityProvidersArgs{
* ClusterName: example.Name,
* CapacityProviders: pulumi.StringArray{
* pulumi.String("FARGATE"),
* },
* DefaultCapacityProviderStrategies: ecs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArray{
* &ecs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs{
* Base: pulumi.Int(1),
* Weight: pulumi.Int(100),
* CapacityProvider: pulumi.String("FARGATE"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.ecs.Cluster;
* import com.pulumi.aws.ecs.ClusterArgs;
* import com.pulumi.aws.ecs.ClusterCapacityProviders;
* import com.pulumi.aws.ecs.ClusterCapacityProvidersArgs;
* import com.pulumi.aws.ecs.inputs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs;
* 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 example = new Cluster("example", ClusterArgs.builder()
* .name("my-cluster")
* .build());
* var exampleClusterCapacityProviders = new ClusterCapacityProviders("exampleClusterCapacityProviders", ClusterCapacityProvidersArgs.builder()
* .clusterName(example.name())
* .capacityProviders("FARGATE")
* .defaultCapacityProviderStrategies(ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs.builder()
* .base(1)
* .weight(100)
* .capacityProvider("FARGATE")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:ecs:Cluster
* properties:
* name: my-cluster
* exampleClusterCapacityProviders:
* type: aws:ecs:ClusterCapacityProviders
* name: example
* properties:
* clusterName: ${example.name}
* capacityProviders:
* - FARGATE
* defaultCapacityProviderStrategies:
* - base: 1
* weight: 100
* capacityProvider: FARGATE
* ```
*
* ## Import
* Using `pulumi import`, import ECS cluster capacity providers using the `cluster_name` attribute. For example:
* ```sh
* $ pulumi import aws:ecs/clusterCapacityProviders:ClusterCapacityProviders example my-cluster
* ```
* @property capacityProviders Set of names of one or more capacity providers to associate with the cluster. Valid values also include `FARGATE` and `FARGATE_SPOT`.
* @property clusterName Name of the ECS cluster to manage capacity providers for.
* @property defaultCapacityProviderStrategies Set of capacity provider strategies to use by default for the cluster. Detailed below.
*/
public data class ClusterCapacityProvidersArgs(
public val capacityProviders: Output>? = null,
public val clusterName: Output? = null,
public val defaultCapacityProviderStrategies: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.ecs.ClusterCapacityProvidersArgs =
com.pulumi.aws.ecs.ClusterCapacityProvidersArgs.builder()
.capacityProviders(capacityProviders?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.clusterName(clusterName?.applyValue({ args0 -> args0 }))
.defaultCapacityProviderStrategies(
defaultCapacityProviderStrategies?.applyValue({ args0 ->
args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) })
}),
).build()
}
/**
* Builder for [ClusterCapacityProvidersArgs].
*/
@PulumiTagMarker
public class ClusterCapacityProvidersArgsBuilder internal constructor() {
private var capacityProviders: Output>? = null
private var clusterName: Output? = null
private var defaultCapacityProviderStrategies:
Output>? = null
/**
* @param value Set of names of one or more capacity providers to associate with the cluster. Valid values also include `FARGATE` and `FARGATE_SPOT`.
*/
@JvmName("pecaywdgvhoweumr")
public suspend fun capacityProviders(`value`: Output>) {
this.capacityProviders = value
}
@JvmName("ucwxmgckivjuvceh")
public suspend fun capacityProviders(vararg values: Output) {
this.capacityProviders = Output.all(values.asList())
}
/**
* @param values Set of names of one or more capacity providers to associate with the cluster. Valid values also include `FARGATE` and `FARGATE_SPOT`.
*/
@JvmName("odwrfttccjsstrnh")
public suspend fun capacityProviders(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy