current_date = str(dt.now().strftime('%Y-%m-%d'))
target_cluster_snapshot_arn= current_date+'_Development_Aurora'
response = TARGET_CLIENT.copy_db_cluster_snapshot(
SourceDBClusterSnapshotIdentifier=source_cluster_snapshot_arn,
TargetDBClusterSnapshotIdentifier=target_cluster_snapshot_arn,
KmsKeyId='arn:aws:kms:us-west-2:xxxxxxx:key/axxxxxx-e326-4df2-8274-73f87ff02f37',
CopyTags=True,
Tags=[
{
'Key': 'Deletion_Date',
'Value': (dt.now() + datetime.timedelta(days=30)).strftime('%Y-%m-%d')
},
],
SourceRegion=SOURCE_REGION
)
While using the above code in Python I am getting the error as
botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the CopyDBClusterSnapshot operation: Invalid cluster snapshot identifier: 2018-05-22_Development_Aurora
But when i am hardcoding the value in TargerDBClusterSnapshotIdnetifier like below, its working fine
response = TARGET_CLIENT.copy_db_cluster_snapshot(
SourceDBClusterSnapshotIdentifier=source_cluster_snapshot_arn,
TargetDBClusterSnapshotIdentifier='PrashastTest',
KmsKeyId='arn:aws:kms:us-west-2:xxxxxxx:key/xxxxxxb3-e326-4df2-8274-73f87ff02f37',
CopyTags=True,
Tags=[
{
'Key': 'Deletion_Date',
'Value': (dt.now() + datetime.timedelta(days=30)).strftime('%Y-%m-%d')
},
],
SourceRegion=SOURCE_REGION
)
Any pointers why is this happening?