akeyless-community / terraform-provider-akeyless

Mozilla Public License 2.0
12 stars 10 forks source link

error "missing required parameter - AccessId " even though it's provided #65

Closed ahmedrad closed 1 year ago

ahmedrad commented 1 year ago

Hello,

I'm using package version 1.2.2

I have a very simple terraform project where I'm trying to create a dynamic secret but keep getting one of two errors: authentication failed: {"error":"InvalidParam","message":"Missing required parameter - AccessId "} even though it's statically provided in the api_login block

or can't create Secret: {"error":"command is not available on public gateway 'gateway-create-producer-aws'"} when I remove the api_gateway_address to get around the first error.

Here's my simple main.tf file:

terraform {
  required_providers {
    akeyless = {
      source = "akeyless-community/akeyless"
    }
  }
}

provider "akeyless" {
  api_gateway_address = "https://mygateway.io:444"
  api_key_login {
    access_id  = "p-****"
    access_key = "****"
  }
}

resource "akeyless_producer_aws" "aws_dynamic_secret" {
  name                         = "/path/aws_role_credentials"
  access_mode                  = "assume_role"
  target_name                  = "/path/aws-account"
  aws_role_arns                = "arn:aws:iam::***:role/awsRole"
  aws_user_programmatic_access = true
  user_ttl                     = "11h"
}
ahmedrad commented 1 year ago

I've also tried port 8080 on the gateway and getting a very similar error:

Error: authentication failed: {
│   "status": "failure",
│   "command": "N/A",
│   "response": [
│     "ERR! access-id or email must be provided"
│   ],
│   "token": "N/A"
│ }
│ 
│ 
│   with provider["registry.terraform.io/akeyless-community/akeyless"],
│   on main.tf line 13, in provider "akeyless":
│   13: provider "akeyless" {
datably commented 1 year ago

I am having the same issue as well.

datably commented 1 year ago

@ahmedrad I just tried this again with my setup. It looks like you need to leave api_gateway_address as a https://api.akeyless.io. At least that worked for me.