amazon-archives / awsmobile-cli

CLI experience for Frontend developers in the JavaScript ecosystem.
Apache License 2.0
142 stars 35 forks source link

Set the awsRegion attribute of appsync/dataSources with parameter or argument. #141

Open komushi opened 6 years ago

komushi commented 6 years ago

There is a mandatory attribute 'awsRegion' in the file of 'awsmobilejs/backend/appsync/dataSources.json'. By invoking 'awsmobile init' the appsync backend including the dataSources will be created. I would like the region attribute being specified with the value from 'awsmobile configure'.

Wondering whether this could be achieved by configuration like below.

{
    "dataSources": [
        {
            "name": "MyTable",
            "description": null,
            "type": "AMAZON_DYNAMODB",
            "serviceRoleArn": "{managed-by-awsmobile-cli}",
            "dynamodbConfig": {
                "tableName": "MyTable-{suffix}",
                "awsRegion": "{configured_region}",
                "useCallerCredentials": false
            }
        }
    ],
....
UnleashedMind commented 6 years ago

Thanks for the feedback, I will mark this as a feature request.