hashicorp / learn-terraform-modules-use

https://developer.hashicorp.com/terraform/tutorials/modules/module-use?in=terraform%2Fmodules
Mozilla Public License 2.0
20 stars 69 forks source link

Can't run locally using AWS SSO / Identity Center temporally credentials #11

Open lgvo opened 5 months ago

lgvo commented 5 months ago

I'm having issues to run the tutorial with the locally (Terraform Community Edition), looks like the module is getting lost when using AWS SSO / Identity Center temporally credentials.

Updating the modules and providers fixed the issue, but there is not public ids by default after the update, I don't think it should be a issue, maybe just output the instance ids instead.

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: configuring Terraform AWS Provider: loading configuration: profile "default" is configured to use SSO but is missing required configuration: sso_region, sso_start_url
│ 
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on main.tf line 4, in provider "aws":
│    4: provider "aws" {
│ 
╵
MarkofTheKanes commented 4 months ago

Hi @lgvo . I had to first manually create an AWS credentials file (see first first for details and then remove the AWS_PROFILE env setting to get it to work but it still needs to be fixed.

lgvo commented 4 months ago

Hi @MarkofTheKanes.

Thanks for the information!

I'm using the SSO as my default profile so no need for the AWS_PROFILE env settings. The sso_region and sso_start_url are both well defined on my ~/.aws/config, so the error don't make much sense (Error: configuring Terraform AWS Provider: loading configuration: profile "default" is configured to use SSO but is missing required configuration: sso_region, sso_start_url). It's probably related to the AWS provider and/or SDK.

Updating the provider and the modules fixed the issue for me.