Divya
Divya

Reputation: 105

ASK-CLI deploy not working for hosting 'AWS with CloudFormation' - Alexa region "default": Access Denied

I have performed aws configure and ask configure after installing ask-cli.
While setting up new skill using ask new selected NodeJS, AWS with CloudFormation.
Trying to deploy the skill using ask deploy, getting [Error]: CliError: The CloudFormation deploy failed for Alexa region "default": Access Denied.
Tried setting the region in ~/.aws/config and in ~/.aws/credentials, still running into same error.
What should be done to fix the issue?

Skill creation enter image description here

Error deploying skill enter image description here

Upvotes: 0

Views: 1050

Answers (2)

Julian George
Julian George

Reputation: 121

I got this problem when the AWS IAM user I linked with ask configure didn't have the full permissions. To fix this, you need to go to IAM and update the permissions of the user linked to the CLI to this: https://github.com/openhab/openhab-alexa/issues/509#issuecomment-1167337129.

For my purposes, I generalized the policies a bit (since I'm just using the CLI in a dev environment) and just adding the following policies worked for me:

  • AmazonS3FullAccess
  • AWSCloudFormationFullAccess
  • AWSLambda_FullAccess
  • CloudWatchLogsFullAccess
  • IAMFullAccess

Upvotes: 0

AymKdn
AymKdn

Reputation: 3917

I've been able to deploy.

After running aws configure, I called ask new, and I think the solution was to not select AWS With CloudFormation but AWS Lambda: screenshot

I wanted to use an existing skill that I previously created in the web UI. So I created two folders: lambda and skill-package. Then I used ask init saying I don't want to use AWS CloudFormation to deploy: screenshot

Next, I added my region in ask-resources.json, under skillInfrastructure:

{
  "askcliResourcesVersion": "2020-03-31",
  "profiles": {
    "default": {
      "skillMetadata": {
        "src": "./skill-package"
      },
      "code": {
        "default": {
          "src": "./lambda"
        }
      },
      "skillInfrastructure": {
        "type": "@ask-cli/lambda-deployer",
        "userConfig": {
          "runtime": "nodejs12.x",
          "handler": "index.js",
          "awsRegion": "eu-west-1"
        }
      }
    }
  }
}

And I finished with ask deploy that worked!

Upvotes: 2

Related Questions