hashicorp / learn-terraform-circleci Goto Github PK
View Code? Open in Web Editor NEWSupplemental repository for Learn content on CircleCI
Home Page: https://learn.hashicorp.com/tutorials/terraform/circle-ci
License: MIT License
Supplemental repository for Learn content on CircleCI
Home Page: https://learn.hashicorp.com/tutorials/terraform/circle-ci
License: MIT License
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?
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.
This is example about aws which is good, but i need to do same with my azure infrastructure creation, can you please give me example like this similar ?
╷
│ 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.
╵
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.