get Service
The ECS Service data source allows access to details of a specific Service within a AWS ECS Cluster.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ecs.getService({
serviceName: "example",
clusterArn: exampleAwsEcsCluster.arn,
});
Content copied to clipboard
import pulumi
import pulumi_aws as aws
example = aws.ecs.get_service(service_name="example",
cluster_arn=example_aws_ecs_cluster["arn"])
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Ecs.GetService.Invoke(new()
{
ServiceName = "example",
ClusterArn = exampleAwsEcsCluster.Arn,
});
});
Content copied to clipboard
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 {
_, err := ecs.LookupService(ctx, &ecs.LookupServiceArgs{
ServiceName: "example",
ClusterArn: exampleAwsEcsCluster.Arn,
}, nil)
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecs.EcsFunctions;
import com.pulumi.aws.ecs.inputs.GetServiceArgs;
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) {
final var example = EcsFunctions.getService(GetServiceArgs.builder()
.serviceName("example")
.clusterArn(exampleAwsEcsCluster.arn())
.build());
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: aws:ecs:getService
arguments:
serviceName: example
clusterArn: ${exampleAwsEcsCluster.arn}
Content copied to clipboard
Return
A collection of values returned by getService.
Parameters
argument
A collection of arguments for invoking getService.
suspend fun getService(clusterArn: String, serviceName: String, tags: Map<String, String>? = null): GetServiceResult
Return
A collection of values returned by getService.
Parameters
cluster Arn
ARN of the ECS Cluster
service Name
Name of the ECS Service
tags
Resource tags.
See also
Return
A collection of values returned by getService.
Parameters
argument
Builder for com.pulumi.aws.ecs.kotlin.inputs.GetServicePlainArgs.