awslabs / rds-snapshot-tool

The Snapshot Tool for Amazon RDS automates the task of creating manual snapshots, copying them into a different account and a different region, and deleting them after a specified number of days
Apache License 2.0
341 stars 146 forks source link

Template error: Unable to get mapping for Buckets::us-west-1::Bucket #16

Closed aleksey-alt closed 5 years ago

aleksey-alt commented 5 years ago

Even if I specify my own bucket in CodeBucket parameter I still get the error "Template validation error: Template error: Unable to get mapping for Buckets::us-west-1::Bucket" when I create resources using CloudFormation templates.

I tried to create resources in us-west-1 region.

autodeck commented 5 years ago

I have the same problem. I can see there is no mapping for that region - see from line 84 in the source template - so that makes sense. However, if I try us-east-1, which is in the mappings I get the following error:

Template validation error: Template format error: Unresolved resource dependencies [lambdaShareSnapshotsRDS] in the Resources block of the template

aleksey-alt commented 5 years ago

@autodeck Forgot to mention: obvious workaround is adding the following lines into source and destination templates (and use own bucket):

            "us-west-1": {
                "Bucket": "snapshots-tool-rds-us-west-1-no-such-bucket"
            },

before any other bucket in Mappings

mrcoronel commented 5 years ago

@aleksey-alt I'll add the mapping for us-west-1 and a couple of other regions where Step Functions is now available when I do my next commit. You can use SourceRegionOverride as a workaround for now

mrcoronel commented 5 years ago

@autodeck It works perfectly for me, both with the default bucket (us-east-1) and a test bucket (us-west-2). Bear in mind the bucket needs to be in the same region where you are deploying, but I'm not sure it will fail in that way if that's the case

autodeck commented 5 years ago

@mrcoronel - To clarify, I'm running snapshots_tool_rds_source.json in us-east-1 and have CodeBucket set to DEFAULT_BUCKET and SourceRegionOverride set to NO.

I'm not sure what I'm doing wrong? Thanks

autodeck commented 5 years ago

The problem seems to be if I set ShareSnapshots to False. It I set it to TRUE then it works fine! (I don't need to copy the snapshots to a different account).

mrcoronel commented 5 years ago

@autodeck Found the issue - fixed in the next commit