Aws.ecsRegisterTaskDefinition()

Register a ECS task definition.

Usage

Hover over inputs/exits for more info.

var Aws = require('machinepack-aws');


// Register a ECS task definition.

Aws.ecsRegisterTaskDefinition({

accessKeyId: 'akid',

secretAccessKey: 'secret',

family: 'aFamily',

containerDefinitions: 'JSON encoded containerDefinitions',

region: 'us-west-2',

apiVersion: '2014-11-13',

volumes: [ { host: { sourcePath: 'STRING_VALUE' }, name: 'STRING_VALUE' } ],

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// The container definition must be a valid strigified json object

invalidContainerDefinitions: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

accessKeyId required

AWS IAM user access key id.

'akid'
secretAccessKey required

AWS IAM user secret access key

'secret'
family required

The ECS family name

'aFamily'
containerDefinitions required

Describes what the new container will look like

'JSON encoded containerDefinitions'
region

Which region to use. Defaults to us-west-2

'us-west-2'
apiVersion

Which api version to use. Defaults to: latest

'2014-11-13'
volumes

[ { host: { sourcePath: 'STRING_VALUE' }, name: 'STRING_VALUE' } ]

Exits

error

An unexpected error occurred.

invalidContainerDefinitions

The container definition must be a valid strigified json object

success

OK.

{ taskDefinition: 
   { containerDefinitions: 
      [ { cpu: 1,
          environment: [ { name: 'ENV_NAME', value: 'ENV_VALUE' } ],
          essential: true,
          image: 'docker/imageName',
          memory: 256,
          mountPoints: [],
          name: 'aName',
          portMappings: [ { containerPort: 80, hostPort: 0 } ],
          volumesFrom: [] } ],
     family: 'taskName',
     revision: 1,
     taskDefinitionArn: 'arn:aws:ecs:us-west-2:575231334330:task-definition/taskName:1',
     volumes: [] } }