{
 "Resources": {
  "enrichmentfunctionServiceRoleF21A0515": {
   "Type": "AWS::IAM::Role",
   "Properties": {
    "AssumeRolePolicyDocument": {
     "Statement": [
      {
       "Action": "sts:AssumeRole",
       "Effect": "Allow",
       "Principal": {
        "Service": "lambda.amazonaws.com"
       }
      }
     ],
     "Version": "2012-10-17"
    },
    "ManagedPolicyArns": [
     {
      "Fn::Join": [
       "",
       [
        "arn:",
        {
         "Ref": "AWS::Partition"
        },
        ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
       ]
      ]
     }
    ]
   }
  },
  "enrichmentfunction84C1BE72": {
   "Type": "AWS::Lambda::Function",
   "Properties": {
    "Code": {
     "ZipFile": "exports.handler = async (event) => { console.log(event); return {'statusCode': 200, 'body': ''}; }"
    },
    "Handler": "index.handler",
    "Role": {
     "Fn::GetAtt": [
      "enrichmentfunctionServiceRoleF21A0515",
      "Arn"
     ]
    },
    "Runtime": "nodejs22.x"
   },
   "DependsOn": [
    "enrichmentfunctionServiceRoleF21A0515"
   ],
   "Metadata": {
    "cfn_nag": {
     "rules_to_suppress": [
      {
       "id": "W58",
       "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct"
      },
      {
       "id": "W89",
       "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct"
      },
      {
       "id": "W92",
       "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct"
      }
     ]
    }
   }
  },
  "lambdadbsstptestServiceRole4515C09E": {
   "Type": "AWS::IAM::Role",
   "Properties": {
    "AssumeRolePolicyDocument": {
     "Statement": [
      {
       "Action": "sts:AssumeRole",
       "Effect": "Allow",
       "Principal": {
        "Service": "lambda.amazonaws.com"
       }
      }
     ],
     "Version": "2012-10-17"
    },
    "ManagedPolicyArns": [
     {
      "Fn::Join": [
       "",
       [
        "arn:",
        {
         "Ref": "AWS::Partition"
        },
        ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
       ]
      ]
     }
    ]
   }
  },
  "lambdadbsstptestE56C39A8": {
   "Type": "AWS::Lambda::Function",
   "Properties": {
    "Code": {
     "ZipFile": "exports.handler = async (event) => console.log(event)"
    },
    "Handler": "index.handler",
    "Role": {
     "Fn::GetAtt": [
      "lambdadbsstptestServiceRole4515C09E",
      "Arn"
     ]
    },
    "Runtime": "nodejs22.x"
   },
   "DependsOn": [
    "lambdadbsstptestServiceRole4515C09E"
   ],
   "Metadata": {
    "cfn_nag": {
     "rules_to_suppress": [
      {
       "id": "W58",
       "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct"
      },
      {
       "id": "W89",
       "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct"
      },
      {
       "id": "W92",
       "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct"
      }
     ]
    }
   }
  },
  "testdbspipesstatesconstructDynamoTable5457FA02": {
   "Type": "AWS::DynamoDB::Table",
   "Properties": {
    "AttributeDefinitions": [
     {
      "AttributeName": "id",
      "AttributeType": "S"
     }
    ],
    "BillingMode": "PAY_PER_REQUEST",
    "KeySchema": [
     {
      "AttributeName": "id",
      "KeyType": "HASH"
     }
    ],
    "PointInTimeRecoverySpecification": {
     "PointInTimeRecoveryEnabled": true
    },
    "SSESpecification": {
     "SSEEnabled": true
    },
    "StreamSpecification": {
     "StreamViewType": "NEW_AND_OLD_IMAGES"
    }
   },
   "UpdateReplacePolicy": "Retain",
   "DeletionPolicy": "Retain",
   "Metadata": {
    "guard": {
     "SuppressedRules": [
      "DYNAMODB_TABLE_ENCRYPTED_KMS"
     ]
    }
   }
  },
  "testdbspipesstatesconstructStateMachineLogGroup1E17AD86": {
   "Type": "AWS::Logs::LogGroup",
   "Properties": {
    "LogGroupName": {
     "Fn::Join": [
      "",
      [
       "/aws/vendedlogs/states/constructs/dbspstp-lambda-function-enrichmenttest-dbs-pipes-states-constructStateMachineLog-",
       {
        "Fn::Select": [
         2,
         {
          "Fn::Split": [
           "/",
           {
            "Ref": "AWS::StackId"
           }
          ]
         }
        ]
       }
      ]
     ]
    }
   },
   "UpdateReplacePolicy": "Retain",
   "DeletionPolicy": "Retain",
   "Metadata": {
    "cfn_nag": {
     "rules_to_suppress": [
      {
       "id": "W86",
       "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely"
      },
      {
       "id": "W84",
       "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
      }
     ]
    }
   }
  },
  "testdbspipesstatesconstructStateMachineRole802AA550": {
   "Type": "AWS::IAM::Role",
   "Properties": {
    "AssumeRolePolicyDocument": {
     "Statement": [
      {
       "Action": "sts:AssumeRole",
       "Effect": "Allow",
       "Principal": {
        "Service": "states.amazonaws.com"
       }
      }
     ],
     "Version": "2012-10-17"
    }
   }
  },
  "testdbspipesstatesconstructStateMachineRoleDefaultPolicy12413F49": {
   "Type": "AWS::IAM::Policy",
   "Properties": {
    "PolicyDocument": {
     "Statement": [
      {
       "Action": "lambda:InvokeFunction",
       "Effect": "Allow",
       "Resource": [
        {
         "Fn::GetAtt": [
          "lambdadbsstptestE56C39A8",
          "Arn"
         ]
        },
        {
         "Fn::Join": [
          "",
          [
           {
            "Fn::GetAtt": [
             "lambdadbsstptestE56C39A8",
             "Arn"
            ]
           },
           ":*"
          ]
         ]
        }
       ]
      },
      {
       "Action": [
        "logs:CreateLogDelivery",
        "logs:DeleteLogDelivery",
        "logs:DescribeLogGroups",
        "logs:DescribeResourcePolicies",
        "logs:GetLogDelivery",
        "logs:ListLogDeliveries",
        "logs:PutResourcePolicy",
        "logs:UpdateLogDelivery"
       ],
       "Effect": "Allow",
       "Resource": "*"
      }
     ],
     "Version": "2012-10-17"
    },
    "PolicyName": "testdbspipesstatesconstructStateMachineRoleDefaultPolicy12413F49",
    "Roles": [
     {
      "Ref": "testdbspipesstatesconstructStateMachineRole802AA550"
     }
    ]
   },
   "Metadata": {
    "cfn_nag": {
     "rules_to_suppress": [
      {
       "id": "W12",
       "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code"
      }
     ]
    }
   }
  },
  "testdbspipesstatesconstructStateMachine9909327F": {
   "Type": "AWS::StepFunctions::StateMachine",
   "Properties": {
    "DefinitionString": {
     "Fn::Join": [
      "",
      [
       "{\"StartAt\":\"taskdbsstp-test\",\"States\":{\"taskdbsstp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:",
       {
        "Ref": "AWS::Partition"
       },
       ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"",
       {
        "Fn::GetAtt": [
         "lambdadbsstptestE56C39A8",
         "Arn"
        ]
       },
       "\",\"Payload.$\":\"$\"}}}}"
      ]
     ]
    },
    "LoggingConfiguration": {
     "Destinations": [
      {
       "CloudWatchLogsLogGroup": {
        "LogGroupArn": {
         "Fn::GetAtt": [
          "testdbspipesstatesconstructStateMachineLogGroup1E17AD86",
          "Arn"
         ]
        }
       }
      }
     ],
     "Level": "ERROR"
    },
    "RoleArn": {
     "Fn::GetAtt": [
      "testdbspipesstatesconstructStateMachineRole802AA550",
      "Arn"
     ]
    }
   },
   "DependsOn": [
    "testdbspipesstatesconstructStateMachineRoleDefaultPolicy12413F49",
    "testdbspipesstatesconstructStateMachineRole802AA550"
   ],
   "UpdateReplacePolicy": "Delete",
   "DeletionPolicy": "Delete"
  },
  "testdbspipesstatesconstructExecutionFailedAlarm6678470E": {
   "Type": "AWS::CloudWatch::Alarm",
   "Properties": {
    "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ",
    "ComparisonOperator": "GreaterThanOrEqualToThreshold",
    "Dimensions": [
     {
      "Name": "StateMachineArn",
      "Value": {
       "Ref": "testdbspipesstatesconstructStateMachine9909327F"
      }
     }
    ],
    "EvaluationPeriods": 1,
    "MetricName": "ExecutionsFailed",
    "Namespace": "AWS/States",
    "Period": 300,
    "Statistic": "Sum",
    "Threshold": 1
   }
  },
  "testdbspipesstatesconstructExecutionThrottledAlarm0286BB10": {
   "Type": "AWS::CloudWatch::Alarm",
   "Properties": {
    "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ",
    "ComparisonOperator": "GreaterThanOrEqualToThreshold",
    "Dimensions": [
     {
      "Name": "StateMachineArn",
      "Value": {
       "Ref": "testdbspipesstatesconstructStateMachine9909327F"
      }
     }
    ],
    "EvaluationPeriods": 1,
    "MetricName": "ExecutionThrottled",
    "Namespace": "AWS/States",
    "Period": 300,
    "Statistic": "Sum",
    "Threshold": 1
   }
  },
  "testdbspipesstatesconstructExecutionAbortedAlarmF4C945F2": {
   "Type": "AWS::CloudWatch::Alarm",
   "Properties": {
    "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ",
    "ComparisonOperator": "GreaterThanOrEqualToThreshold",
    "Dimensions": [
     {
      "Name": "StateMachineArn",
      "Value": {
       "Ref": "testdbspipesstatesconstructStateMachine9909327F"
      }
     }
    ],
    "EvaluationPeriods": 1,
    "MetricName": "ExecutionsAborted",
    "Namespace": "AWS/States",
    "Period": 300,
    "Statistic": "Maximum",
    "Threshold": 1
   }
  },
  "testdbspipesstatesconstructdlqF765E6A0": {
   "Type": "AWS::SQS::Queue",
   "Properties": {
    "KmsMasterKeyId": "alias/aws/sqs"
   },
   "UpdateReplacePolicy": "Delete",
   "DeletionPolicy": "Delete"
  },
  "testdbspipesstatesconstructdlqPolicyB08573AE": {
   "Type": "AWS::SQS::QueuePolicy",
   "Properties": {
    "PolicyDocument": {
     "Statement": [
      {
       "Action": [
        "sqs:AddPermission",
        "sqs:DeleteMessage",
        "sqs:GetQueueAttributes",
        "sqs:ReceiveMessage",
        "sqs:RemovePermission",
        "sqs:SendMessage",
        "sqs:SetQueueAttributes"
       ],
       "Effect": "Allow",
       "Principal": {
        "AWS": {
         "Fn::Join": [
          "",
          [
           "arn:",
           {
            "Ref": "AWS::Partition"
           },
           ":iam::",
           {
            "Ref": "AWS::AccountId"
           },
           ":root"
          ]
         ]
        }
       },
       "Resource": {
        "Fn::GetAtt": [
         "testdbspipesstatesconstructdlqF765E6A0",
         "Arn"
        ]
       },
       "Sid": "QueueOwnerOnlyAccess"
      },
      {
       "Action": "SQS:*",
       "Condition": {
        "Bool": {
         "aws:SecureTransport": "false"
        }
       },
       "Effect": "Deny",
       "Principal": {
        "AWS": "*"
       },
       "Resource": {
        "Fn::GetAtt": [
         "testdbspipesstatesconstructdlqF765E6A0",
         "Arn"
        ]
       },
       "Sid": "HttpsOnly"
      }
     ],
     "Version": "2012-10-17"
    },
    "Queues": [
     {
      "Ref": "testdbspipesstatesconstructdlqF765E6A0"
     }
    ]
   }
  },
  "testdbspipesstatesconstructPipeRoletestdbspipesstatesconstruct4E57732C": {
   "Type": "AWS::IAM::Role",
   "Properties": {
    "AssumeRolePolicyDocument": {
     "Statement": [
      {
       "Action": "sts:AssumeRole",
       "Effect": "Allow",
       "Principal": {
        "Service": "pipes.amazonaws.com"
       }
      }
     ],
     "Version": "2012-10-17"
    },
    "Policies": [
     {
      "PolicyDocument": {
       "Statement": [
        {
         "Action": [
          "dynamodb:DescribeStream",
          "dynamodb:GetRecords",
          "dynamodb:GetShardIterator",
          "dynamodb:ListStreams"
         ],
         "Effect": "Allow",
         "Resource": {
          "Fn::GetAtt": [
           "testdbspipesstatesconstructDynamoTable5457FA02",
           "StreamArn"
          ]
         }
        },
        {
         "Action": "sqs:SendMessage",
         "Effect": "Allow",
         "Resource": {
          "Fn::GetAtt": [
           "testdbspipesstatesconstructdlqF765E6A0",
           "Arn"
          ]
         }
        }
       ],
       "Version": "2012-10-17"
      },
      "PolicyName": "sourcePolicy"
     },
     {
      "PolicyDocument": {
       "Statement": [
        {
         "Action": "states:StartExecution",
         "Effect": "Allow",
         "Resource": {
          "Ref": "testdbspipesstatesconstructStateMachine9909327F"
         }
        }
       ],
       "Version": "2012-10-17"
      },
      "PolicyName": "targetPolicy"
     }
    ]
   },
   "Metadata": {
    "guard": {
     "SuppressedRules": [
      "IAM_NO_INLINE_POLICY_CHECK"
     ]
    }
   }
  },
  "testdbspipesstatesconstructenrichmentpolicytestdbspipesstatesconstruct28034D11": {
   "Type": "AWS::IAM::Policy",
   "Properties": {
    "PolicyDocument": {
     "Statement": [
      {
       "Action": "lambda:InvokeFunction",
       "Effect": "Allow",
       "Resource": {
        "Fn::GetAtt": [
         "enrichmentfunction84C1BE72",
         "Arn"
        ]
       }
      }
     ],
     "Version": "2012-10-17"
    },
    "PolicyName": "testdbspipesstatesconstructenrichmentpolicytestdbspipesstatesconstruct28034D11",
    "Roles": [
     {
      "Ref": "testdbspipesstatesconstructPipeRoletestdbspipesstatesconstruct4E57732C"
     }
    ]
   }
  },
  "testdbspipesstatesconstructLogGrouptestdbspipesstatesconstructAB6BC73F": {
   "Type": "AWS::Logs::LogGroup",
   "Properties": {
    "LogGroupName": {
     "Fn::Join": [
      "",
      [
       "/aws/vendedlogs/pipes/constructs/dbspstp-lambda-function-enrichmenttest-dbs-pipes-states-constructPipesLog-",
       {
        "Fn::Select": [
         2,
         {
          "Fn::Split": [
           "/",
           {
            "Ref": "AWS::StackId"
           }
          ]
         }
        ]
       }
      ]
     ]
    }
   },
   "UpdateReplacePolicy": "Retain",
   "DeletionPolicy": "Retain",
   "Metadata": {
    "cfn_nag": {
     "rules_to_suppress": [
      {
       "id": "W86",
       "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely"
      },
      {
       "id": "W84",
       "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
      }
     ]
    }
   }
  },
  "testdbspipesstatesconstructpipetestdbspipesstatesconstruct6F9C482F": {
   "Type": "AWS::Pipes::Pipe",
   "Properties": {
    "Enrichment": {
     "Fn::GetAtt": [
      "enrichmentfunction84C1BE72",
      "Arn"
     ]
    },
    "LogConfiguration": {
     "CloudwatchLogsLogDestination": {
      "LogGroupArn": {
       "Fn::GetAtt": [
        "testdbspipesstatesconstructLogGrouptestdbspipesstatesconstructAB6BC73F",
        "Arn"
       ]
      }
     },
     "Level": "TRACE"
    },
    "RoleArn": {
     "Fn::GetAtt": [
      "testdbspipesstatesconstructPipeRoletestdbspipesstatesconstruct4E57732C",
      "Arn"
     ]
    },
    "Source": {
     "Fn::GetAtt": [
      "testdbspipesstatesconstructDynamoTable5457FA02",
      "StreamArn"
     ]
    },
    "SourceParameters": {
     "DynamoDBStreamParameters": {
      "DeadLetterConfig": {
       "Arn": {
        "Fn::GetAtt": [
         "testdbspipesstatesconstructdlqF765E6A0",
         "Arn"
        ]
       }
      },
      "MaximumRetryAttempts": 3,
      "StartingPosition": "LATEST"
     }
    },
    "Target": {
     "Ref": "testdbspipesstatesconstructStateMachine9909327F"
    },
    "TargetParameters": {
     "StepFunctionStateMachineParameters": {
      "InvocationType": "FIRE_AND_FORGET"
     }
    }
   }
  }
 },
 "Parameters": {
  "BootstrapVersion": {
   "Type": "AWS::SSM::Parameter::Value<String>",
   "Default": "/cdk-bootstrap/hnb659fds/version",
   "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
  }
 },
 "Rules": {
  "CheckBootstrapVersion": {
   "Assertions": [
    {
     "Assert": {
      "Fn::Not": [
       {
        "Fn::Contains": [
         [
          "1",
          "2",
          "3",
          "4",
          "5"
         ],
         {
          "Ref": "BootstrapVersion"
         }
        ]
       }
      ]
     },
     "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
    }
   ]
  }
 }
}