ystia/yorc

AWS region parameter not passed to terraform during bootstrap

tibeer opened this issue · 3 comments

Bug Report

Description

When bootstrapping yorc with aws, the region value is not passed to YorcCompute/infra.tf.json.

Expected behavior

Region value should be available in YorcCompute/infra.tf.json

Actual behavior

Region value is absent in YorcCompute/infra.tf.json

Steps to reproduce the issue

  1. Start completly fresh
  2. YORC_DEBUG=1 yorc bootstrap
  3. Follow the wizzard and select a region (eg. eu-central-1)
  4. Wait til the bootstrap failes
  5. Investigate your logs: yorc deployments logs -b bootstrap-2021-07-13--07-35-25
  6. Find this section:
[2021-07-13T07:36:18.825776734Z][INFO][bootstrap-2021-07-13--07-35-25][install][e112ceb8-20c0-4abf-ba19-849225c7caee][403e39eb-7ffb-418b-a58f-28370b62a996][YorcCompute][][delegate][install][]
Initializing the backend...

Successfully configured the backend "consul"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

[2021-07-13T07:36:19.291056747Z][ERROR][bootstrap-2021-07-13--07-35-25][install][e112ceb8-20c0-4abf-ba19-849225c7caee][403e39eb-7ffb-418b-a58f-28370b62a996][YorcCompute][][delegate][install][]
Error: Error running plan: 1 error(s) occurred:

* provider.aws: Not a valid region: 

Additional information you deem important (e.g. issue happens only occasionally)

Issue prevents using AWS.

Additional environment details (infrastructure implied: AWS, OpenStack, etc.)

Setting an environment variable like "AWS_DEFAULT_REGION" is not honered by yorc.

Output of yorc version

Yorc Server 4.1.2
Database schema version: 1.3.1
Revision: "d7792d82d66f05e3ce65c69f68697cf9279b22e1"

Yorc configuration file

ansible:
  debug: true
  keep_generated_recipes: true
working_directory: work
workers_number: 30
resources_prefix: bootstrap-
locations_file_path: work/locations.yorc.yaml
terraform:
  plugins_dir: /home/ubuntu/work
  keep_generated_files: true

Priority

Medium

Hi @tibeer

Currently we distinguish locations properties for the Yorc instance that performs the bootstrap from location properties of the bootstrapped Yorc instance.

The wizard/survey during the bootstrap process collects values for the bootstrapped Yorc instance.

Location properties for the Yorc instance that performs the bootstrap can be provided using a configuration file as described in the documentation.

I agree that this is a bit complex, we are thinking on how to make this configuration more intuitive during the bootstrap process.

Please let us know if this solves your issue.

@loicalbertin I guess i figured it out. For all other having the same or similar issues: I redeployed yorc a couple of times and "just" killed the yorc server, but not the consul instance. That resulted in wrong location data stored in consul.
I'm still facing some more issues but I guess I'll figure that out later. Thanks and regards!

Yes @tibeer, I forgot to specify it.
You can easily achieve a cleanup that also kills Consul and Yorc by using the yorc bootstrap cleanup command