UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

110 lines 5.49 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getTaskExecutionOutput = exports.getTaskExecution = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Data source for managing an AWS ECS (Elastic Container) Task Execution. This data source calls the [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) API, allowing execution of one-time tasks that don't fit a standard resource lifecycle. See the feature request issue for additional context. * * > **NOTE on preview operations:** This data source calls the `RunTask` API on every read operation, which means new task(s) may be created from a `pulumi preview` command if all attributes are known. Placing this functionality behind a data source is an intentional trade off to enable use cases requiring a one-time task execution without relying on provisioners. Caution should be taken to ensure the data source is only executed once, or that the resulting tasks can safely run in parallel. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.ecs.getTaskExecution({ * cluster: exampleAwsEcsCluster.id, * taskDefinition: exampleAwsEcsTaskDefinition.arn, * desiredCount: 1, * launchType: "FARGATE", * networkConfiguration: { * subnets: exampleAwsSubnet.map(__item => __item.id), * securityGroups: [exampleAwsSecurityGroup.id], * assignPublicIp: false, * }, * }); * ``` */ function getTaskExecution(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("aws:ecs/getTaskExecution:getTaskExecution", { "capacityProviderStrategies": args.capacityProviderStrategies, "clientToken": args.clientToken, "cluster": args.cluster, "desiredCount": args.desiredCount, "enableEcsManagedTags": args.enableEcsManagedTags, "enableExecuteCommand": args.enableExecuteCommand, "group": args.group, "launchType": args.launchType, "networkConfiguration": args.networkConfiguration, "overrides": args.overrides, "placementConstraints": args.placementConstraints, "placementStrategies": args.placementStrategies, "platformVersion": args.platformVersion, "propagateTags": args.propagateTags, "referenceId": args.referenceId, "region": args.region, "startedBy": args.startedBy, "tags": args.tags, "taskDefinition": args.taskDefinition, }, opts); } exports.getTaskExecution = getTaskExecution; /** * Data source for managing an AWS ECS (Elastic Container) Task Execution. This data source calls the [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) API, allowing execution of one-time tasks that don't fit a standard resource lifecycle. See the feature request issue for additional context. * * > **NOTE on preview operations:** This data source calls the `RunTask` API on every read operation, which means new task(s) may be created from a `pulumi preview` command if all attributes are known. Placing this functionality behind a data source is an intentional trade off to enable use cases requiring a one-time task execution without relying on provisioners. Caution should be taken to ensure the data source is only executed once, or that the resulting tasks can safely run in parallel. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.ecs.getTaskExecution({ * cluster: exampleAwsEcsCluster.id, * taskDefinition: exampleAwsEcsTaskDefinition.arn, * desiredCount: 1, * launchType: "FARGATE", * networkConfiguration: { * subnets: exampleAwsSubnet.map(__item => __item.id), * securityGroups: [exampleAwsSecurityGroup.id], * assignPublicIp: false, * }, * }); * ``` */ function getTaskExecutionOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("aws:ecs/getTaskExecution:getTaskExecution", { "capacityProviderStrategies": args.capacityProviderStrategies, "clientToken": args.clientToken, "cluster": args.cluster, "desiredCount": args.desiredCount, "enableEcsManagedTags": args.enableEcsManagedTags, "enableExecuteCommand": args.enableExecuteCommand, "group": args.group, "launchType": args.launchType, "networkConfiguration": args.networkConfiguration, "overrides": args.overrides, "placementConstraints": args.placementConstraints, "placementStrategies": args.placementStrategies, "platformVersion": args.platformVersion, "propagateTags": args.propagateTags, "referenceId": args.referenceId, "region": args.region, "startedBy": args.startedBy, "tags": args.tags, "taskDefinition": args.taskDefinition, }, opts); } exports.getTaskExecutionOutput = getTaskExecutionOutput; //# sourceMappingURL=getTaskExecution.js.map