many-yak-61188
07/14/2021, 5:10 PMAWS_ACCESS_KEY_ID
& AWS_SECRET_ACCESS_KEY
. On the machine I tried some aws cli commands and they work perfectly. QQ: Is there a way use pulumi/actions without configuring credentials, because the host that is the runner has role based permissions assigned to it?billowy-army-68599
07/14/2021, 5:30 PMmany-yak-61188
07/14/2021, 5:44 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.pulumi up
in my github workflow, it fails with the error belowerror: 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
curl
and aws cli
. Posting output from aws cli belowaws 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
package 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)
}
}
billowy-army-68599
07/17/2021, 5:58 PMmany-yak-61188
07/17/2021, 6:21 PMpulumi config set aws:skipMetadataApiCheck false
if only i read things more carefully, extremely sorry about that.billowy-army-68599
07/17/2021, 6:46 PM