<p>Your proposed snapshot-id is not syntactically valid.  When you tried hard-coding the value, you used a valid identifier.  </p>

<p>Underscores are not allowed, and the identifier can't begin with a number.</p>

<p>Here are the constraints on snapshot identifiers, from the API Reference:</p>

<blockquote>
  <p><strong><code>DBClusterSnapshotIdentifier</code></strong></p>
  
  <p>The identifier of the DB cluster snapshot. This parameter is stored as a lowercase string.</p>
  
  <p>Constraints:</p>
  
  <ul>
  <li><p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
  <li><p>First character must be a letter.</p></li>
  <li><p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
  </ul>
  
  <p><a href="https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBClusterSnapshot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBClusterSnapshot.html</a></p>
</blockquote>

CC BY-SA 4.0
2018-05-23T00:03:15.047Z
2018-05-23T00:03:15.047Z
Michael - sqlbot
<pre><code>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
)
</code></pre>

<p>While using the above code in Python I am getting the error as </p>

<pre><code>botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the CopyDBClusterSnapshot operation: Invalid cluster snapshot identifier:  2018-05-22_Development_Aurora
</code></pre>

<p>But when i am hardcoding the value in TargerDBClusterSnapshotIdnetifier like below, its working fine</p>

<pre><code>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
)
</code></pre>

<p>Any pointers why is this happening?</p>

<amazon-web-services><python><amazon-rds>
Cross Region Copy of Aurora Snapshots
Prashast
# Cross Region Copy of Aurora Snapshots

(Asked by: username_0 on 2018-05-22)

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='username_0Test',
    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?

**Tags:** amazon-web-services, python, amazon-rds


---

## 1 answers

### Answer by username_1 on 2018-05-23. Score: 2 | Accepted answer

Your proposed snapshot-id is not syntactically valid. When you tried hard-coding the value, you used a valid identifier.

Underscores are not allowed, and the identifier can't begin with a number.

Here are the constraints on snapshot identifiers, from the API Reference:

> **`DBClusterSnapshotIdentifier`**
>
> The identifier of the DB cluster snapshot. This parameter is stored as a lowercase string.
>
> Constraints:
>
> * Must contain from 1 to 63 letters, numbers, or hyphens.
> * First character must be a letter.
> * Cannot end with a hyphen or contain two consecutive hyphens.
>
> <https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBClusterSnapshot.html>


---

