Daemon class
Provides an ECS Daemon resource, which manages a daemon that runs exactly one task on each container instance in an ECS cluster.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ecs.Daemon("example", {
name: "example-daemon",
clusterArn: exampleAwsEcsCluster.arn,
daemonTaskDefinitionArn: exampleAwsEcsDaemonTaskDefinition.arn,
capacityProviderArns: [exampleAwsEcsCapacityProvider.arn],
});
import pulumi
import pulumi_aws as aws
example = aws.ecs.Daemon("example",
name="example-daemon",
cluster_arn=example_aws_ecs_cluster["arn"],
daemon_task_definition_arn=example_aws_ecs_daemon_task_definition["arn"],
capacity_provider_arns=[example_aws_ecs_capacity_provider["arn"]])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ecs.Daemon("example", new()
{
Name = "example-daemon",
ClusterArn = exampleAwsEcsCluster.Arn,
DaemonTaskDefinitionArn = exampleAwsEcsDaemonTaskDefinition.Arn,
CapacityProviderArns = new[]
{
exampleAwsEcsCapacityProvider.Arn,
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewDaemon(ctx, "example", &ecs.DaemonArgs{
Name: pulumi.String("example-daemon"),
ClusterArn: pulumi.Any(exampleAwsEcsCluster.Arn),
DaemonTaskDefinitionArn: pulumi.Any(exampleAwsEcsDaemonTaskDefinition.Arn),
CapacityProviderArns: pulumi.StringArray{
exampleAwsEcsCapacityProvider.Arn,
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_ecs_daemon" "example" {
name = "example-daemon"
cluster_arn = exampleAwsEcsCluster.arn
daemon_task_definition_arn = exampleAwsEcsDaemonTaskDefinition.arn
capacity_provider_arns = [exampleAwsEcsCapacityProvider.arn]
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecs.Daemon;
import com.pulumi.aws.ecs.DaemonArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 Daemon("example", DaemonArgs.builder()
.name("example-daemon")
.clusterArn(exampleAwsEcsCluster.arn())
.daemonTaskDefinitionArn(exampleAwsEcsDaemonTaskDefinition.arn())
.capacityProviderArns(exampleAwsEcsCapacityProvider.arn())
.build());
}
}
resources:
example:
type: aws:ecs:Daemon
properties:
name: example-daemon
clusterArn: ${exampleAwsEcsCluster.arn}
daemonTaskDefinitionArn: ${exampleAwsEcsDaemonTaskDefinition.arn}
capacityProviderArns:
- ${exampleAwsEcsCapacityProvider.arn}
With Deployment Configuration
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ecs.Daemon("example", {
deploymentConfiguration: {
alarms: {
alarmNames: ["example-alarm"],
enable: true,
},
drainPercent: 50,
bakeTimeInMinutes: 10,
},
name: "example-daemon",
clusterArn: exampleAwsEcsCluster.arn,
daemonTaskDefinitionArn: exampleAwsEcsDaemonTaskDefinition.arn,
capacityProviderArns: [exampleAwsEcsCapacityProvider.arn],
});
import pulumi
import pulumi_aws as aws
example = aws.ecs.Daemon("example",
deployment_configuration={
"alarms": {
"alarm_names": ["example-alarm"],
"enable": True,
},
"drain_percent": float(50),
"bake_time_in_minutes": 10,
},
name="example-daemon",
cluster_arn=example_aws_ecs_cluster["arn"],
daemon_task_definition_arn=example_aws_ecs_daemon_task_definition["arn"],
capacity_provider_arns=[example_aws_ecs_capacity_provider["arn"]])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ecs.Daemon("example", new()
{
DeploymentConfiguration = new Aws.Ecs.Inputs.DaemonDeploymentConfigurationArgs
{
Alarms = new Aws.Ecs.Inputs.DaemonDeploymentConfigurationAlarmsArgs
{
AlarmNames = new[]
{
"example-alarm",
},
Enable = true,
},
DrainPercent = 50,
BakeTimeInMinutes = 10,
},
Name = "example-daemon",
ClusterArn = exampleAwsEcsCluster.Arn,
DaemonTaskDefinitionArn = exampleAwsEcsDaemonTaskDefinition.Arn,
CapacityProviderArns = new[]
{
exampleAwsEcsCapacityProvider.Arn,
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewDaemon(ctx, "example", &ecs.DaemonArgs{
DeploymentConfiguration: &ecs.DaemonDeploymentConfigurationArgs{
Alarms: &ecs.DaemonDeploymentConfigurationAlarmsArgs{
AlarmNames: pulumi.StringArray{
pulumi.String("example-alarm"),
},
Enable: pulumi.Bool(true),
},
DrainPercent: pulumi.Float64(50),
BakeTimeInMinutes: pulumi.Int(10),
},
Name: pulumi.String("example-daemon"),
ClusterArn: pulumi.Any(exampleAwsEcsCluster.Arn),
DaemonTaskDefinitionArn: pulumi.Any(exampleAwsEcsDaemonTaskDefinition.Arn),
CapacityProviderArns: pulumi.StringArray{
exampleAwsEcsCapacityProvider.Arn,
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_ecs_daemon" "example" {
deployment_configuration = {
alarms = {
alarm_names = ["example-alarm"]
enable = true
}
drain_percent = 50
bake_time_in_minutes = 10
}
name = "example-daemon"
cluster_arn = exampleAwsEcsCluster.arn
daemon_task_definition_arn = exampleAwsEcsDaemonTaskDefinition.arn
capacity_provider_arns = [exampleAwsEcsCapacityProvider.arn]
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecs.Daemon;
import com.pulumi.aws.ecs.DaemonArgs;
import com.pulumi.aws.ecs.inputs.DaemonDeploymentConfigurationArgs;
import com.pulumi.aws.ecs.inputs.DaemonDeploymentConfigurationAlarmsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 Daemon("example", DaemonArgs.builder()
.deploymentConfiguration(DaemonDeploymentConfigurationArgs.builder()
.alarms(DaemonDeploymentConfigurationAlarmsArgs.builder()
.alarmNames("example-alarm")
.enable(true)
.build())
.drainPercent(50.0)
.bakeTimeInMinutes(10)
.build())
.name("example-daemon")
.clusterArn(exampleAwsEcsCluster.arn())
.daemonTaskDefinitionArn(exampleAwsEcsDaemonTaskDefinition.arn())
.capacityProviderArns(exampleAwsEcsCapacityProvider.arn())
.build());
}
}
resources:
example:
type: aws:ecs:Daemon
properties:
deploymentConfiguration:
alarms:
alarmNames:
- example-alarm
enable: true
drainPercent: 50
bakeTimeInMinutes: 10
name: example-daemon
clusterArn: ${exampleAwsEcsCluster.arn}
daemonTaskDefinitionArn: ${exampleAwsEcsDaemonTaskDefinition.arn}
capacityProviderArns:
- ${exampleAwsEcsCapacityProvider.arn}
With Tags
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ecs.Daemon("example", {
name: "example-daemon",
clusterArn: exampleAwsEcsCluster.arn,
daemonTaskDefinitionArn: exampleAwsEcsDaemonTaskDefinition.arn,
capacityProviderArns: [exampleAwsEcsCapacityProvider.arn],
tags: {
Environment: "production",
Application: "example",
},
});
import pulumi
import pulumi_aws as aws
example = aws.ecs.Daemon("example",
name="example-daemon",
cluster_arn=example_aws_ecs_cluster["arn"],
daemon_task_definition_arn=example_aws_ecs_daemon_task_definition["arn"],
capacity_provider_arns=[example_aws_ecs_capacity_provider["arn"]],
tags={
"Environment": "production",
"Application": "example",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ecs.Daemon("example", new()
{
Name = "example-daemon",
ClusterArn = exampleAwsEcsCluster.Arn,
DaemonTaskDefinitionArn = exampleAwsEcsDaemonTaskDefinition.Arn,
CapacityProviderArns = new[]
{
exampleAwsEcsCapacityProvider.Arn,
},
Tags =
{
{ "Environment", "production" },
{ "Application", "example" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewDaemon(ctx, "example", &ecs.DaemonArgs{
Name: pulumi.String("example-daemon"),
ClusterArn: pulumi.Any(exampleAwsEcsCluster.Arn),
DaemonTaskDefinitionArn: pulumi.Any(exampleAwsEcsDaemonTaskDefinition.Arn),
CapacityProviderArns: pulumi.StringArray{
exampleAwsEcsCapacityProvider.Arn,
},
Tags: pulumi.StringMap{
"Environment": pulumi.String("production"),
"Application": pulumi.String("example"),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_ecs_daemon" "example" {
name = "example-daemon"
cluster_arn = exampleAwsEcsCluster.arn
daemon_task_definition_arn = exampleAwsEcsDaemonTaskDefinition.arn
capacity_provider_arns = [exampleAwsEcsCapacityProvider.arn]
tags = {
"Environment" = "production"
"Application" = "example"
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecs.Daemon;
import com.pulumi.aws.ecs.DaemonArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 Daemon("example", DaemonArgs.builder()
.name("example-daemon")
.clusterArn(exampleAwsEcsCluster.arn())
.daemonTaskDefinitionArn(exampleAwsEcsDaemonTaskDefinition.arn())
.capacityProviderArns(exampleAwsEcsCapacityProvider.arn())
.tags(Map.ofEntries(
Map.entry("Environment", "production"),
Map.entry("Application", "example")
))
.build());
}
}
resources:
example:
type: aws:ecs:Daemon
properties:
name: example-daemon
clusterArn: ${exampleAwsEcsCluster.arn}
daemonTaskDefinitionArn: ${exampleAwsEcsDaemonTaskDefinition.arn}
capacityProviderArns:
- ${exampleAwsEcsCapacityProvider.arn}
tags:
Environment: production
Application: example
Import
Identity Schema
Required
arn(String) ARN of the ECS Daemon.
Using pulumi import, import ECS Daemons using the ARN. For example:
$ pulumi import aws:ecs/daemon:Daemon example arn:aws:ecs:us-east-1:123456789012:daemon/example-cluster/example-daemon
Constructors
- Daemon(String name, {DaemonArgs? args, CustomResourceOptions? options})
-
Creates a new Daemon.
nameThe Pulumi resource name.argsArguments used to configure this Daemon. The set of arguments for Daemon.optionsResource options controlling this resource's behavior. - Daemon.reference(String urn)
- Creates a typed reference to an existing Daemon resource.
Properties
-
arn
↔ Output<
String> -
ARN of the daemon.
latefinal
-
capacityProviderArns
↔ Output<
List< String> > -
Set of capacity provider ARNs to use for the daemon.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
clusterArn
↔ Output<
String> -
ARN of the ECS cluster where the daemon will run.
latefinal
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
daemonTaskDefinitionArn
↔ Output<
String> -
ARN of the daemon task definition to use for the daemon. Drift is not detected on this attribute because the API may report a stale revision while a deployment is in progress.
latefinal
-
deploymentArn
↔ Output<
String> -
ARN of the most recent daemon deployment.
latefinal
-
deploymentConfiguration
↔ Output<
DaemonDeploymentConfiguration?> -
Configuration for daemon deployments. See Deployment Configuration below.
latefinal
-
enableEcsManagedTags
↔ Output<
bool?> -
Whether to enable Amazon ECS managed tags for the tasks within the daemon.
latefinal
-
enableExecuteCommand
↔ Output<
bool?> -
Whether to enable Amazon ECS Exec for the tasks within the daemon.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
name
↔ Output<
String> -
Name of the daemon.
latefinal
-
propagateTags
↔ Output<
String?> -
Whether to propagate tags from the daemon to tasks. Valid values are
DAEMONorNONE.latefinal -
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
status
↔ Output<
String> -
Status of the daemon. Valid values are
ACTIVEorDELETE_IN_PROGRESS.latefinal -
Key-value map of resource tags. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
timeouts
↔ Output<
DaemonTimeouts?> -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited