Git Product home page Git Product logo

learn-terraform-circleci's People

Contributors

calebalbers avatar duplo83 avatar hashicorp-copywrite[bot] avatar im2nguyen avatar judithpatudith avatar mdeggies avatar ritsok avatar robin-norwood avatar topfunky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-terraform-circleci's Issues

terraform s3 error on CIrcleCI- aws.Config.CredentialsChainVerboseErrors terraform

I am using AWS docker image on circleci pipeline.

  init-tf:
    docker:
      - image: docker.mirror.hashicorp.services/hashicorp/terraform:light
    working_directory: ~/project
    steps:
      - checkout
      - run:
          name: list of things in that
          command: ls -a
      - run:
          name: terraform init
          command: sh scripts/init.sh dev

When I apply this error message pops up.

Error: error configuring S3 Backend: no valid credential sources for S3 Backend found.
│ 
│ Please see https://www.terraform.io/docs/language/settings/backends/s3.html
│ for more information about providing credentials.
│ 
│ Error: NoCredentialProviders: no valid providers in chain. Deprecated.
│ 	For verbose messaging see aws.Config.CredentialsChainVerboseErrors

And this is my backend tf file with backend -

provider "aws" {
	access_key = "${var.aws_access_key}"
    secret_key = "${var.aws_secret_key}"
    region  = "${var.aws_region}"
}

terraform {
  backend "s3" {

  }
}

I have added my access_key credentials in environment variable but it keeps throwing this error.
Someone on stackoverflow suggested to hard code credentials on tf code or pass while init, but it should not be a good practice and threat for public projects.
Please note that the same codes and commands work on my unix machine (mac air m1).

Any idea how I can solve this for circleci?

Line missing in code snippet

pip install --user awscli
export PATH="~/.local/bin:$PATH"
git clone https://github.com/hashicorp/learn-terraform-circleci/ .
pwd
aws s3 sync --acl public-read "/home/circleci/project/assets" s3://${APP_BUCKET}

In case people are wondering where that "assets" directory comes from:
the git clone line is missing in the learn.hashicorp.com tutorial.

When running the lab this error occurs during the CI process.


│ Error: Unsupported Terraform Core version

│ on main.tf line 8, in terraform:
│ 8: required_version = "~> 3.22.0"

│ This configuration does not support Terraform version 1.0.0. To proceed, either choose another supported Terraform version or update this version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.

Update using CircleCI 2.1 syntax?

It would be fab if you could provide a version of this example using the CircleCI 2.1 syntax. I think this would simplify your example a fair bit - as I don't think you'd need all the YAML merging maps type 'magic' any more.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.