AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.11.0 published on Wednesday, Aug 17, 2022 by Pulumi

getContainerDefinition

The ECS container definition data source allows access to details of a specific container within an AWS ECS service.

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var ecs_mongo = Aws.Ecs.GetContainerDefinition.Invoke(new()
    {
        TaskDefinition = aws_ecs_task_definition.Mongo.Id,
        ContainerName = "mongodb",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.GetContainerDefinition(ctx, &ecs.GetContainerDefinitionArgs{
			TaskDefinition: aws_ecs_task_definition.Mongo.Id,
			ContainerName:  "mongodb",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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.GetContainerDefinitionArgs;
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 ecs-mongo = EcsFunctions.getContainerDefinition(GetContainerDefinitionArgs.builder()
            .taskDefinition(aws_ecs_task_definition.mongo().id())
            .containerName("mongodb")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

ecs_mongo = aws.ecs.get_container_definition(task_definition=aws_ecs_task_definition["mongo"]["id"],
    container_name="mongodb")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ecs-mongo = aws.ecs.getContainerDefinition({
    taskDefinition: aws_ecs_task_definition.mongo.id,
    containerName: "mongodb",
});
variables:
  ecs-mongo:
    Fn::Invoke:
      Function: aws:ecs:getContainerDefinition
      Arguments:
        taskDefinition: ${aws_ecs_task_definition.mongo.id}
        containerName: mongodb

Using getContainerDefinition

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 getContainerDefinition(args: GetContainerDefinitionArgs, opts?: InvokeOptions): Promise<GetContainerDefinitionResult>
function getContainerDefinitionOutput(args: GetContainerDefinitionOutputArgs, opts?: InvokeOptions): Output<GetContainerDefinitionResult>
def get_container_definition(container_name: Optional[str] = None,
                             task_definition: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetContainerDefinitionResult
def get_container_definition_output(container_name: Optional[pulumi.Input[str]] = None,
                             task_definition: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetContainerDefinitionResult]
func GetContainerDefinition(ctx *Context, args *GetContainerDefinitionArgs, opts ...InvokeOption) (*GetContainerDefinitionResult, error)
func GetContainerDefinitionOutput(ctx *Context, args *GetContainerDefinitionOutputArgs, opts ...InvokeOption) GetContainerDefinitionResultOutput

> Note: This function is named GetContainerDefinition in the Go SDK.

public static class GetContainerDefinition 
{
    public static Task<GetContainerDefinitionResult> InvokeAsync(GetContainerDefinitionArgs args, InvokeOptions? opts = null)
    public static Output<GetContainerDefinitionResult> Invoke(GetContainerDefinitionInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetContainerDefinitionResult> getContainerDefinition(GetContainerDefinitionArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:ecs/getContainerDefinition:getContainerDefinition
  Arguments:
    # Arguments dictionary

The following arguments are supported:

ContainerName string

The name of the container definition

TaskDefinition string

The ARN of the task definition which contains the container

ContainerName string

The name of the container definition

TaskDefinition string

The ARN of the task definition which contains the container

containerName String

The name of the container definition

taskDefinition String

The ARN of the task definition which contains the container

containerName string

The name of the container definition

taskDefinition string

The ARN of the task definition which contains the container

container_name str

The name of the container definition

task_definition str

The ARN of the task definition which contains the container

containerName String

The name of the container definition

taskDefinition String

The ARN of the task definition which contains the container

getContainerDefinition Result

The following output properties are available:

ContainerName string
Cpu int

The CPU limit for this container definition

DisableNetworking bool

Indicator if networking is disabled

DockerLabels Dictionary<string, string>

Set docker labels

Environment Dictionary<string, string>

The environment in use

Id string

The provider-assigned unique ID for this managed resource.

Image string

The docker image in use, including the digest

ImageDigest string

The digest of the docker image in use

Memory int

The memory limit for this container definition

MemoryReservation int

The soft limit (in MiB) of memory to reserve for the container. When system memory is under contention, Docker attempts to keep the container memory to this soft limit

TaskDefinition string
ContainerName string
Cpu int

The CPU limit for this container definition

DisableNetworking bool

Indicator if networking is disabled

DockerLabels map[string]string

Set docker labels

Environment map[string]string

The environment in use

Id string

The provider-assigned unique ID for this managed resource.

Image string

The docker image in use, including the digest

ImageDigest string

The digest of the docker image in use

Memory int

The memory limit for this container definition

MemoryReservation int

The soft limit (in MiB) of memory to reserve for the container. When system memory is under contention, Docker attempts to keep the container memory to this soft limit

TaskDefinition string
containerName String
cpu Integer

The CPU limit for this container definition

disableNetworking Boolean

Indicator if networking is disabled

dockerLabels Map<String,String>

Set docker labels

environment Map<String,String>

The environment in use

id String

The provider-assigned unique ID for this managed resource.

image String

The docker image in use, including the digest

imageDigest String

The digest of the docker image in use

memory Integer

The memory limit for this container definition

memoryReservation Integer

The soft limit (in MiB) of memory to reserve for the container. When system memory is under contention, Docker attempts to keep the container memory to this soft limit

taskDefinition String
containerName string
cpu number

The CPU limit for this container definition

disableNetworking boolean

Indicator if networking is disabled

dockerLabels {[key: string]: string}

Set docker labels

environment {[key: string]: string}

The environment in use

id string

The provider-assigned unique ID for this managed resource.

image string

The docker image in use, including the digest

imageDigest string

The digest of the docker image in use

memory number

The memory limit for this container definition

memoryReservation number

The soft limit (in MiB) of memory to reserve for the container. When system memory is under contention, Docker attempts to keep the container memory to this soft limit

taskDefinition string
container_name str
cpu int

The CPU limit for this container definition

disable_networking bool

Indicator if networking is disabled

docker_labels Mapping[str, str]

Set docker labels

environment Mapping[str, str]

The environment in use

id str

The provider-assigned unique ID for this managed resource.

image str

The docker image in use, including the digest

image_digest str

The digest of the docker image in use

memory int

The memory limit for this container definition

memory_reservation int

The soft limit (in MiB) of memory to reserve for the container. When system memory is under contention, Docker attempts to keep the container memory to this soft limit

task_definition str
containerName String
cpu Number

The CPU limit for this container definition

disableNetworking Boolean

Indicator if networking is disabled

dockerLabels Map<String>

Set docker labels

environment Map<String>

The environment in use

id String

The provider-assigned unique ID for this managed resource.

image String

The docker image in use, including the digest

imageDigest String

The digest of the docker image in use

memory Number

The memory limit for this container definition

memoryReservation Number

The soft limit (in MiB) of memory to reserve for the container. When system memory is under contention, Docker attempts to keep the container memory to this soft limit

taskDefinition String

Package Details

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

This Pulumi package is based on the aws Terraform Provider.