Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FASTLY PLUGIN requires FASTLY_API_KEY set on workstation even when FASTLY_API_KEY env variable set in atlas #1

Closed
hashibot opened this issue Jun 13, 2017 · 1 comment

Comments

@hashibot
Copy link

This issue was originally opened by @neillturner as hashicorp/terraform#8156. It was migrated here as part of the provider split. The original body of the issue is below.


Fastly requires an api key to be specified to access the fastly api.
you can specify this as an environment variable FASTLY_API_KEY which is obviously
preferable as then you don't have to put the value in the terraform code.

when you run terraform with the remote option and atlas you can set the environment variable FASTLY_API_KEY in atalas.

however if you don't first set it on your workstation before calling terraform like this
export FASTLY_API_KEY="fakekey"
then you get error api_key not set.
You should not need to do this.

With the AWS provider you can set the environment variables

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY 

in atlas
and you don't have to set the environment variables to some faske value before running terraform remote
on your workstation. I gues the AWS providers check wher ethe environment variable is set in atlas.

Terraform Version 0.6.16

Affected Resource(s)

provider "fastly"  
resource "fastly_service_v1"

Terraform Configuration Files

just create a fastly service without specifying a provider

resource "fastly_service_v1" "demo" {
  name = "demofastly"

  domain {
    name    = "demo.notexample.com"
    comment = "demo"
  }

  backend {
    address = "127.0.0.1"
    name    = "localhost"
    port    = 80
  }

  force_destroy = true
}

Debug Output

gives a message saying fastly provider api_key doesn't have a value.

Expected Behavior

it should check that atlas has the env variable FASTLY_API_KEY and if so not require the default value

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  • Setup a terraform file as above.
  • Run terraform
terraform remote config 
terraform push
  • in atlas set the env variable FASTLY_API_KEY

Workaround

before running terraform

export FASTLY_API_KEY="fakekey"
@radeksimko radeksimko added the bug label Oct 16, 2017
bridgetlane pushed a commit to bridgetlane/terraform-provider-fastly that referenced this issue May 2, 2018
phamann pushed a commit that referenced this issue Aug 10, 2020
@Integralist
Copy link
Collaborator

Closing as stale. Please open a new issue after testing with the latest Terraform provider if this is still an issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants