AWS- DynamoDB table not created via EC2 using AWS pipeline (website in maintenance for DataPipeline service)

135 views Asked by At

My EC2 instance created via my pipeline is not able to create my tableTest in dynamodb. I'm not able to get more info in the console since there website for AWS DataPipeline is in maitenance...

My configuration pipeline definitions.json :

{
     "objects": [
     {
         "id" : "CreateDirectory",
         "type" : "ShellCommandActivity",
         "command" : "aws dynamodb create-table --table-name tableTest \
--attribute-definitions AttributeName=Test,AttributeType=S \
--key-schema AttributeName=Test,KeyType=HASH \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES",
         "runsOn" : {"ref": "instance"}
     },
     {
         "id": "Default",
         "scheduleType": "ondemand",
         "failureAndRerunMode": "CASCADE",
         "name": "Default",
         "role": "DataPipelineDefaultRole",
         "resourceRole": "DataPipelineDefaultRole"
     },
     {
         "id" : "instance",
         "name" : "instance",
         "type" : "Ec2Resource",
         "actionOnTaskFailure" : "terminate",
         "actionOnResourceFailure" : "retryAll",
         "maximumRetries" : "1",
         "instanceType" : "t2.micro",
         "securityGroups" : ["sg-XXXXX"],
         "subnetId":"subnet-YYYYY],
         "associatePublicAddress":"false",
         "role" : "DataPipelineDefaultRole",
         "resourceRole" : "DataPipelineDefaultResourceRole"
     }]
}

Roles are the same from https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-iam-roles.html

When I activate pipeline, my EC2 is created but my command in the first block is not executed, why ???

1

There are 1 answers

1
Leeroy Hannigan On

This is very likely caused by the fact you're using Datapipeline deprecated roles:

If you created a pipeline before October 3, 2022 using the AWS Data Pipeline console with default roles, AWS Data Pipeline created the DataPipelineDefaultRole for you and attached the AWSDataPipelineRole managed policy to the role. As of October 3, 2022, the AWSDataPipelineRole managed policy is deprecated and the pipeline role must be specified for a pipeline when using the console.

We recommend that you review existing pipelines and determine if the DataPipelineDefaultRole is associated with the pipeline and whether the AWSDataPipelineRole is attached to that role. If so, review the access that this policy allows to ensure it is appropriate for your security requirements. Add, update, or replace the policies and policy statements attached to this role as necessary. Alternatively, you can update a pipeline to use a role that you create with different permissions policies.

https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-iam-roles.html

I would also question your need to use DataPipeline at all anymore, there are much better services which can achieve the same goals more efficiently, such as AWS Glue.