moto/moto
Jordan Sanders 6dfd64ff3c
More accurately mock ECS RegisterTaskDefinition (#3584)
The mocked response for ECS RegisterTaskDefinition has drifted from what
actually returns when run against a real ECS endpoint. I created a
minimal task definition for both EC2:

```
>>> ecs.register_task_definition(
      family="moto",
      containerDefinitions=[
          {
              "name": "hello_world",
              "image": "hello-world:latest",
              "memory": 400
           }
       ]
  )["taskDefinition"]

{'taskDefinitionArn': 'arn:aws:ecs:us-east-1:************:task-definition/moto:1',
 'containerDefinitions': [{'name': 'hello_world',
   'image': 'hello-world:latest',
   'cpu': 0,
   'memory': 400,
   'portMappings': [],
   'essential': True,
   'environment': [],
   'mountPoints': [],
   'volumesFrom': []}],
 'family': 'moto',
 'revision': 1,
 'volumes': [],
 'status': 'ACTIVE',
 'placementConstraints': [],
 'compatibilities': ['EC2']}
```

and FARGATE:
```
>>> ecs.register_task_definition(
      family="moto",
      containerDefinitions=[
          {
              "name": "hello_world",
              "image": "hello-world:latest",
              "memory": 400
           }
       ],
       requiresCompatibilities=["FARGATE"],
       networkMode="awsvpc",
       cpu="256",
       memory="512"
  )["taskDefinition"]

{'taskDefinitionArn': 'arn:aws:ecs:us-east-1:************:task-definition/moto:2',
 'containerDefinitions': [{'name': 'hello_world',
   'image': 'hello-world:latest',
   'cpu': 0,
   'memory': 400,
   'portMappings': [],
   'essential': True,
   'environment': [],
   'mountPoints': [],
   'volumesFrom': []}],
 'family': 'moto',
 'networkMode': 'awsvpc',
 'revision': 2,
 'volumes': [],
 'status': 'ACTIVE',
 'requiresAttributes': [{'name': 'com.amazonaws.ecs.capability.docker-remote-api.1.18'},
  {'name': 'ecs.capability.task-eni'}],
 'placementConstraints': [],
 'compatibilities': ['EC2', 'FARGATE'],
 'requiresCompatibilities': ['FARGATE'],
 'cpu': '256',
 'memory': '512'}
```

This change adds several default keys to the task based on those two
real responses and the AWS documentation:
https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RegisterTaskDefinition.html

The mock still doesn't match the real response exactly but it's much
closer than it was before.
2021-01-09 14:07:35 +00:00
..
acm Tech Debt - Remove duplicate AWSError classes 2020-11-05 11:20:18 +00:00
apigateway List dependencies for services - add integration test to verify 2020-09-13 16:08:23 +01:00
applicationautoscaling Linting 2020-11-11 15:55:37 +00:00
athena Linting 2020-11-11 15:55:37 +00:00
autoscaling Remove boto package dependency 2020-11-26 23:59:15 -08:00
awslambda Enable AWSLambda and STS mocking for AWS China regions/endpoints (#3574) 2021-01-08 14:22:12 +00:00
batch Fix Race Condition in batch:SubmitJob (#3480) 2020-11-18 10:49:25 +00:00
cloudformation Fix:Cloudformation descibe stacks special chars (#3514) 2020-12-06 08:11:52 +00:00
cloudwatch Fix:CloudWatch List metrics with dimensions (#3461) 2020-11-20 12:38:48 +00:00
codecommit List dependencies for services - add integration test to verify 2020-09-13 16:08:23 +01:00
codepipeline List dependencies for services - add integration test to verify 2020-09-13 16:08:23 +01:00
cognitoidentity #2800 - CognitoIdentity - Fix format of Identity ID 2020-04-04 14:09:38 +01:00
cognitoidp Support cognito admin user password auth flow (#3547) 2020-12-15 07:48:52 +00:00
config Linting 2020-11-11 15:55:37 +00:00
core Fix failures with latest responses library (0.12.1) (#3466) 2020-11-16 07:20:33 +00:00
datapipeline Iam cloudformation update, singificant cloudformation refactoring (#3218) 2020-08-27 10:11:47 +01:00
datasync Add missing regions to all services 2019-12-26 17:12:22 +01:00
dynamodb Decentralize cloudformation naming responsibilities (#3201) 2020-08-01 15:23:36 +01:00
dynamodb2 #3506 - DynamoDB - Allow StringSets to be passed to update_item() (#3519) 2020-12-07 09:31:53 +00:00
dynamodbstreams Prevent JSON dumps error when dealing with complex types 2020-04-06 17:21:26 +10:00
ec2 Fix: handling of boolean value privateDnsEnabled in ec2:VpcEndpoint (#3566) 2021-01-08 08:05:44 +00:00
ec2instanceconnect Remove boto package dependency 2020-11-26 23:59:15 -08:00
ecr ecr: Fix "imageDigest" value in ecr.list_images() response (#3436) 2020-11-05 14:10:23 +00:00
ecs More accurately mock ECS RegisterTaskDefinition (#3584) 2021-01-09 14:07:35 +00:00
elasticbeanstalk Fix: elasticbeanstalk ApplicationArn does not contain ApplicationName (#3511) 2020-12-04 10:31:28 +00:00
elb Remove boto package dependency 2020-11-26 23:59:15 -08:00
elbv2 Iam cloudformation update, singificant cloudformation refactoring (#3218) 2020-08-27 10:11:47 +01:00
emr Fix: EMR ReleaseLabel validation does not respect semantic versioning (#3489) 2020-11-22 18:54:59 +00:00
events EventBridge: put_rule and list_rules should store and retrieve EventBusName property (#3472) 2020-11-17 15:36:17 +00:00
forecast Refactor Forecast to also use shared AWSError class 2020-11-06 16:34:09 +00:00
glacier Fixed linter errors 2019-12-26 21:03:49 +01:00
glue Add glue.batch_update_partition (#3534) 2020-12-10 20:03:37 +00:00
iam Implement IAM instance profile associations (#3482) 2020-11-20 22:00:53 +00:00
instance_metadata Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
iot Linting 2020-11-11 15:55:37 +00:00
iotdata Back to Black 2020-11-10 14:12:38 +01:00
kinesis Linting 2020-11-11 15:55:37 +00:00
kinesisvideo Linting 2020-11-11 15:55:37 +00:00
kinesisvideoarchivedmedia Linting 2020-11-11 15:55:37 +00:00
kms List dependencies for services - add integration test to verify 2020-09-13 16:08:23 +01:00
logs Fix: nextToken value in logs:DescribeLogGroups response (#3398) 2020-10-21 09:47:09 +01:00
managedblockchain Fix Blockchain to work with new API (#3575) 2021-01-07 11:18:50 +00:00
opsworks Fix the online status in OpsWorks 2020-05-07 10:57:27 +03:00
organizations Linting 2020-11-11 15:55:37 +00:00
packages Remove boto package dependency 2020-11-26 23:59:15 -08:00
polly Fixed linter errors 2019-12-26 21:03:49 +01:00
ram Linting 2020-11-11 15:55:37 +00:00
rds Remove boto package dependency 2020-11-26 23:59:15 -08:00
rds2 Fix:RDS:add DBParameterGroupArn in describe-db-parameter-groups & cre… (#3462) 2020-12-01 19:53:01 +00:00
redshift Fix: ClusterType, NumberOfNodes not validated when modifying Redshift cluster (#3513) 2020-12-04 13:22:19 +00:00
resourcegroups Fix resource groups tests (#3204) 2020-07-31 07:18:52 +01:00
resourcegroupstaggingapi Add ec2.vpc resource support to Tagging API (#3375) 2020-10-10 19:05:21 +01:00
route53 Route53: Implement dummy GetChange endpoint (#3486) 2020-11-20 07:21:05 +00:00
s3 Fix: ListObjectsV2 behaving differently than AWS API (#3545) 2020-12-13 13:38:25 +00:00
s3bucket_path Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
sagemaker Linting 2020-11-11 15:55:37 +00:00
secretsmanager Fix: describe/list attribute discrepancy in Secrets Manager (#3432) 2020-11-03 14:18:56 +00:00
ses Fix:SES:Get Template Html part (#3504) 2020-12-03 07:42:19 +00:00
sns Enabled SNS endpoint attr must be lowercased (#3543) 2020-12-14 15:08:33 +00:00
sqs Fix Blockchain to work with new API (#3575) 2021-01-07 11:18:50 +00:00
ssm Add ssm:SendCommand support for instance tag Targets 2020-11-08 00:06:35 -08:00
stepfunctions Add basic get_execution_history implementation for Step Functions (#3507) 2020-12-03 18:32:06 +00:00
sts Enable AWSLambda and STS mocking for AWS China regions/endpoints (#3574) 2021-01-08 14:22:12 +00:00
swf Add SWF domain and type undeprecation 2020-03-05 23:37:17 +10:00
templates Add about page. 2017-03-12 19:58:40 -04:00
transcribe Linting 2020-11-11 15:55:37 +00:00
utilities Rename DockerUtilities to differentiate from docker-dependency 2020-11-09 16:31:18 +00:00
xray Tech Debt - Remove duplicate AWSError classes 2020-11-05 11:20:18 +00:00
__init__.py Adds some basic endpoints for Amazon Forecast (#3434) 2020-11-06 08:23:47 +00:00
backends.py Adds some basic endpoints for Amazon Forecast (#3434) 2020-11-06 08:23:47 +00:00
compat.py Fix linter errors. 2019-12-17 21:35:52 +05:30
server.py #3494 fix using EventBridge via Go SDK (#3495) 2020-11-26 08:52:58 +00:00
settings.py Add basic get_execution_history implementation for Step Functions (#3507) 2020-12-03 18:32:06 +00:00