question

chris avatar image
chris asked

ask-cli does not deploy to eu-west-1

I tried to use the ask deploy command. But it does not deploy to the correct region.

$ cat ~/.ask/cli_config 
{
  "profiles": {
    "myprofile": {
      "aws_profile": "myprofile",
      "token": {
        "access_token": "*****",
        "refresh_token": "******",
        "token_type": "bearer",
        "expires_in": 3600,
        "expires_at": "*******"
      },
      "vendor_id": "*********"
    }
  }
}
$ cat ~/.ask/config 
{
  "apis": {
    "custom": {
      "endpoint": {
        "uri": "arn:aws:lambda:eu-west-1:XXXX"
      },
      "regions": {
        "EU": {
          "endpoint": {
            "uri": "arn:aws:lambda:eu-west-1:XXXX"
          }
        }
      }
    }
  }
}
$ cat ~/.aws/config 
[myprofile]
region = eu-west-1
output = json
$ ask deploy --profile myprofile
-------------------- Update Skill Project --------------------
Skill Id: amzn1.ask.skill.*****-****-****-****-********
Skill deployment finished.
Model deployment finished.
Lambda deployment finished.
Your skill is now deployed and enabled in the development stage.
Try invoking the skill by saying “Alexa, open {your_skill_invocation_name}” or simulate an invocation via the `ask simulate` command.


Skill available but in US region.

$ ask deploy --profile myprofile --endpointRegion eu-west-1


  error: unknown option `--endpointRegion'


Does not work.

:(

ask cli
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ron Wang avatar image
Ron Wang answered

Hi all!

The region for the Lambda creation right now is controlled by the region where Lambda belongs to. Take an example of the "apis" object in skill.json below:

"apis": {
  "custom": {
    "endpoint": {
      "sourceDir": "lambda/custom"
    },
    "regions": {
      "NA": {
        "endpoint": {
          "sourceDir": "lambda/custom"
        }
      },
      "EU": {
        "endpoint": {
          "sourceDir": "lambda/custom"
        }
      },
    }
  }
}

This example sets three regions: "default" (apis.custom.endpoint is the default region), "NA", and "EU". CLI will create two Lambdas one for us-east-1 one for eu-west-1.

TLDR. CLI's current logic is creating Lambda with the following mapping:

    'default' : 'us-east-1',
    'NA' : 'us-east-1',
    'EU' : 'eu-west-1',
    'IN' : 'eu-west-1',
    'FE' : 'ap-northeast-1'

So if you want to use CLI's handy advantage of creating Lambda, you will need to specify the target region, and reuse the ARN created by this.

We cannot use .aws/config's region setting for different regions because we recommend creating Lambda in the closest region. But we will definitely think about supporting the region setting in .aws/config for default region in the short term.

Thanks,

Ron

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KAIYIN@AMAZON.COM avatar image KAIYIN@AMAZON.COM commented ·

Hi Ron, do you want to make a knowledge base article using the same content?

0 Likes 0 ·
Anand@Amazon avatar image
Anand@Amazon answered

Hi chris,

Let me explain this whole things in detail:

There is no "endpointRegion" attributes for deploy command.

Check here for more details about deploy command.

EndpointRegion you can define within profile which you already set to eu-west-1 for "myprofile".

Whenever you run deploy command skill.json file get executed all the time. So there is a section called locale where you have to provide details for all the locales for which you want to create your skill.

By default en-US.json is already mentioned when you create a project with "new" command that's why you able to create skill for US region but not for other regions.

And the interaction model for all different locale you can create under model folder like en-US.json, en-GB.json

Note : Your issue is not about eu-west-1 server but it's about adding different locale in your project.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chris avatar image
chris answered

Hi Anand, so by adding the locale de-DE or en-GB it deploys to eu-west-1? That is an strange behavior isn't it? Or did we misunderstand each? Because my problem is that it is deployed not on eu-west-1 (just clarifying because your note slightly confuses me)

3 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Anand@Amazon avatar image Anand@Amazon ♦ commented ·

Hi Chris,

Apologies if I was not very helpful earlier. Let me explain in detail.

Locales JSON file is only for creating skill in different marketplace. It not related to your us-east-1 or eu-west-1.

We have provided region wise endpoints where alexa is available like US (N. Virginia) - us-east-1 and for Europe and India - EU (Ireland) - eu-east-1.

You can add this settings in your profile which you are using for your skill deployment.

First install AWS CLI and then run below command. You can refer this link to setup.

$ aws configure
aws_access_key_id= <Get it from AWS IAM>
aws_secret_access_key= <Get it from AWS IAM>
region= us-east-1/eu-west-1 //region from where you want to deploy your lambda code 
output=json

Refer this link for more details about how to create different profile with different endpoints.

0 Likes 0 ·
chris avatar image chris Anand@Amazon ♦ commented ·

Hi @Anand@Amazon I already had the region configured in my aws config.
It still does not work. Always deploys to US....

0 Likes 0 ·
Anand@Amazon avatar image Anand@Amazon ♦ chris commented ·

Hi Chris,

Can you try below steps?

1. Create your sample project using ask cli.

2. Update {skill-project}/.ask/config file with

"apis": { "custom": { "endpoint": { "uri": "arn:aws:lambda:eu-west-1:XXXX" }, "regions": { "EU": { "endpoint": { "uri": "arn:aws:lambda:eu-west-1:XXXX" } } } } }

I have added 'regions' to 'apis' node of the config file located in skill project folder.

I think this will work for you.

0 Likes 0 ·
chris avatar image
chris answered

Nope!

{
  "manifest": {
    "publishingInformation": {
      "locales": {
        "en-GB": {
          "summary": "Sample Short Description",
          "examplePhrases": [
            "Alexa open hello world",
            "Alexa tell hello world I am Jeff",
            "Alexa tell hello world my name is Peter"
          ],
          "name": "testskill",
          "description": "Sample Full Description"
        }
      },
      "isAvailableWorldwide": true,
      "testingInstructions": "Sample Testing Instructions.",
      "category": "EDUCATION_AND_REFERENCE",
      "distributionCountries": []
    },
    "apis": {
      "custom": {
        "endpoint": {
          "sourceDir": "lambda/custom"
        }
      }
    },
    "manifestVersion": "1.0"
  }
}

Gets still deployed to us-east-1 instead of eu-west-1

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chris avatar image
chris answered

For test purposes and after diving into the source of ask-cli I tried to explicit set the endpoint.uri to a pre-created lambda function in eu-west-1. Did not work either. Ask deploy still creates a new function is us-east-1

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DiscoPixel avatar image
DiscoPixel answered

My solution for that issue is: I create the skill for eu-west-1 online, then pull it via ask cli and after that deployment works.

Ask and AWS config are set to eu-west-1, but by default it always deploys to the US. So Amazon should really fix that issue soon!

What never works is just deploying a single lambda function to eu-west-1. I always have to run the full ask deploy...

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dennis avatar image
Dennis answered

I got the same problem, i think there is no way to deploy to other locations as the default us-east-1.

i tried it with de_DE.json files, and locals "de_DE" in my skill.json manifest, i wrote also:

...
      "isAvailableWorldwide": false,
      "distributionCountries": [
        "DE"
      ]
...

but no luck, the lambda function will still be deployed to us-east-1 Virgina.

I have added 'regions' to 'apis' node of the config file located in skill project folder and the config file,
no luck neither.
@Anand could you show us how a config and skill.json need to be written ?

Thx a lot

Dennis

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mihail avatar image
Mihail answered

Any update on this? I am facing the same problem.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

RamaK avatar image
RamaK answered

Any update on this? I am facing the same problem.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-f0fd3105-3800-4449-bbdd-4b76ca5b3b9e avatar image
newuser-f0fd3105-3800-4449-bbdd-4b76ca5b3b9e answered

same issue, I clone an existing skill that i didnt use the ask cli to create, added inskill purchasing, tried to deploy and i get:

Functions from \'eu-west-1\' are not reachable in this region (\'us-east-1\')

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.