sparse-intern-71089
07/14/2021, 5:10 PMbillowy-army-68599
billowy-army-68599
billowy-army-68599
many-yak-61188
07/14/2021, 5:44 PMmany-yak-61188
07/17/2021, 4:19 PMpulumi preview
fails in a github workflow/runner environment where the runner is self hosted on ec2 instance. I'll recap my attempts and the steps I took to try to debug the issue.many-yak-61188
07/17/2021, 4:19 PMmany-yak-61188
07/17/2021, 4:21 PMpulumi up
in my github workflow, it fails with the error belowmany-yak-61188
07/17/2021, 4:21 PMerror: 1 error occurred:
* error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
Please see <https://registry.terraform.io/providers/hashicorp/aws>
for more information about providing credentials.
Error: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
many-yak-61188
07/17/2021, 4:25 PMcurl
and aws cli
. Posting output from aws cli belowmany-yak-61188
07/17/2021, 4:25 PMaws configure list
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************BUOX iam-role
secret_key ****************Ynfn iam-role
region us-east-1 imds
many-yak-61188
07/17/2021, 4:26 PMmany-yak-61188
07/17/2021, 4:34 PMpackage main
import (
"fmt"
"<http://github.com/aws/aws-sdk-go/aws|github.com/aws/aws-sdk-go/aws>"
"<http://github.com/aws/aws-sdk-go/aws/session|github.com/aws/aws-sdk-go/aws/session>"
"<http://github.com/aws/aws-sdk-go/service/ec2|github.com/aws/aws-sdk-go/service/ec2>"
)
func main() {
states := [] string {"running"}
region := "us-east-1"
sess := session.Must(session.NewSession(&aws.Config{
Region: aws.String(region),
}))
ec2Svc := ec2.New(sess)
params := &ec2.DescribeInstancesInput{
Filters: []*ec2.Filter{
{
Name: aws.String("instance-state-name"),
Values: aws.StringSlice(states),
},
},
}
result, err := ec2Svc.DescribeInstances(params)
if err != nil {
fmt.Println("Error", err)
} else {
fmt.Printf("\n\n\nFetching instance details for region: %s \n ", region)
if len(result.Reservations) == 0 {
fmt.Printf("There is no instance for the region: %s\n", region)
}
for _, reservation := range result.Reservations {
fmt.Println("printing instance details.....")
for _, instance := range reservation.Instances {
fmt.Println("instance id " + *instance.InstanceId)
fmt.Println("current State " + *instance.State.Name)
}
}
fmt.Printf("done for region %s **** \n", region)
}
}
many-yak-61188
07/17/2021, 4:34 PMmany-yak-61188
07/17/2021, 4:34 PMmany-yak-61188
07/17/2021, 4:46 PMbillowy-army-68599
billowy-army-68599
many-yak-61188
07/17/2021, 6:21 PMpulumi config set aws:skipMetadataApiCheck false
if only i read things more carefully, extremely sorry about that.many-yak-61188
07/17/2021, 6:22 PMbillowy-army-68599