AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
aws.ecs.getService
Explore with Pulumi AI
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,
});
import pulumi
import pulumi_aws as aws
example = aws.ecs.get_service(service_name="example",
cluster_arn=example_aws_ecs_cluster["arn"])
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
})
}
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,
});
});
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());
}
}
variables:
example:
fn::invoke:
Function: aws:ecs:getService
Arguments:
serviceName: example
clusterArn: ${exampleAwsEcsCluster.arn}
Using getService
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
function getServiceOutput(args: GetServiceOutputArgs, opts?: InvokeOptions): Output<GetServiceResult>
def get_service(cluster_arn: Optional[str] = None,
service_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetServiceResult
def get_service_output(cluster_arn: Optional[pulumi.Input[str]] = None,
service_name: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetServiceResult]
func LookupService(ctx *Context, args *LookupServiceArgs, opts ...InvokeOption) (*LookupServiceResult, error)
func LookupServiceOutput(ctx *Context, args *LookupServiceOutputArgs, opts ...InvokeOption) LookupServiceResultOutput
> Note: This function is named LookupService
in the Go SDK.
public static class GetService
{
public static Task<GetServiceResult> InvokeAsync(GetServiceArgs args, InvokeOptions? opts = null)
public static Output<GetServiceResult> Invoke(GetServiceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ecs/getService:getService
arguments:
# arguments dictionary
The following arguments are supported:
- Cluster
Arn string - ARN of the ECS Cluster
- Service
Name string - Name of the ECS Service
- Dictionary<string, string>
- Resource tags.
- Cluster
Arn string - ARN of the ECS Cluster
- Service
Name string - Name of the ECS Service
- map[string]string
- Resource tags.
- cluster
Arn String - ARN of the ECS Cluster
- service
Name String - Name of the ECS Service
- Map<String,String>
- Resource tags.
- cluster
Arn string - ARN of the ECS Cluster
- service
Name string - Name of the ECS Service
- {[key: string]: string}
- Resource tags.
- cluster_
arn str - ARN of the ECS Cluster
- service_
name str - Name of the ECS Service
- Mapping[str, str]
- Resource tags.
- cluster
Arn String - ARN of the ECS Cluster
- service
Name String - Name of the ECS Service
- Map<String>
- Resource tags.
getService Result
The following output properties are available:
- Arn string
- ARN of the ECS Service
- Cluster
Arn string - Desired
Count int - Number of tasks for the ECS Service
- Id string
- The provider-assigned unique ID for this managed resource.
- Launch
Type string - Launch type for the ECS Service
- Scheduling
Strategy string - Scheduling strategy for the ECS Service
- Service
Name string - Dictionary<string, string>
- Resource tags.
- Task
Definition string - Family for the latest ACTIVE revision or full ARN of the task definition.
- Arn string
- ARN of the ECS Service
- Cluster
Arn string - Desired
Count int - Number of tasks for the ECS Service
- Id string
- The provider-assigned unique ID for this managed resource.
- Launch
Type string - Launch type for the ECS Service
- Scheduling
Strategy string - Scheduling strategy for the ECS Service
- Service
Name string - map[string]string
- Resource tags.
- Task
Definition string - Family for the latest ACTIVE revision or full ARN of the task definition.
- arn String
- ARN of the ECS Service
- cluster
Arn String - desired
Count Integer - Number of tasks for the ECS Service
- id String
- The provider-assigned unique ID for this managed resource.
- launch
Type String - Launch type for the ECS Service
- scheduling
Strategy String - Scheduling strategy for the ECS Service
- service
Name String - Map<String,String>
- Resource tags.
- task
Definition String - Family for the latest ACTIVE revision or full ARN of the task definition.
- arn string
- ARN of the ECS Service
- cluster
Arn string - desired
Count number - Number of tasks for the ECS Service
- id string
- The provider-assigned unique ID for this managed resource.
- launch
Type string - Launch type for the ECS Service
- scheduling
Strategy string - Scheduling strategy for the ECS Service
- service
Name string - {[key: string]: string}
- Resource tags.
- task
Definition string - Family for the latest ACTIVE revision or full ARN of the task definition.
- arn str
- ARN of the ECS Service
- cluster_
arn str - desired_
count int - Number of tasks for the ECS Service
- id str
- The provider-assigned unique ID for this managed resource.
- launch_
type str - Launch type for the ECS Service
- scheduling_
strategy str - Scheduling strategy for the ECS Service
- service_
name str - Mapping[str, str]
- Resource tags.
- task_
definition str - Family for the latest ACTIVE revision or full ARN of the task definition.
- arn String
- ARN of the ECS Service
- cluster
Arn String - desired
Count Number - Number of tasks for the ECS Service
- id String
- The provider-assigned unique ID for this managed resource.
- launch
Type String - Launch type for the ECS Service
- scheduling
Strategy String - Scheduling strategy for the ECS Service
- service
Name String - Map<String>
- Resource tags.
- task
Definition String - Family for the latest ACTIVE revision or full ARN of the task definition.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.