salmon-hair-39994
07/10/2023, 10:22 PMaws.ProviderArgs
, but keep getting the error like below
error: 1 error occurred:\n \t* error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.\n \n Please see <https://registry.terraform.io/providers/hashicorp/aws>\n for more information about providing credentials.\n \n Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, access disabled to EC2 IMDS via client option, or \"AWS_EC2_METADATA_DISABLED\" environment variable\n\nResources:\n
Also was tried set the SkipMetadataApiCheck: false
didn’t help at all. Any suggestions will be appreciatedsalmon-account-74572
07/10/2023, 10:27 PM// Set up a provider for the destination region
dstProvider, err := aws.NewProvider(ctx, "dstProvider", &aws.ProviderArgs{
Region: pulumi.String(dstVpcRegion),
})
Note that dstVpcRegion
was a configuration parameter I pulled into the program using config.Require
.salmon-hair-39994
07/10/2023, 10:28 PMprovider, err := aws.NewProvider(ctx, "aws-provider-"+region, &aws.ProviderArgs{
Region: pulumi.String(region),
})
salmon-account-74572
07/10/2023, 10:29 PMpulumi.Provider(provider))
when creating other resources?salmon-hair-39994
07/10/2023, 10:29 PMsalmon-account-74572
07/10/2023, 10:30 PMsalmon-hair-39994
07/10/2023, 10:30 PMpulumi.ResourceOption
opts := make([]pulumi.ResourceOption, 0)
opts = append(opts, pulumi.Provider(provider))
// Create ecr repo
repo, err := ecr.NewRepository(ctx, serviceName, repoArgs, opts...)
if err != nil {
return nil, err
}
salmon-account-74572
07/10/2023, 10:33 PMsalmon-hair-39994
07/10/2023, 10:34 PMsalmon-account-74572
07/10/2023, 10:36 PMsalmon-hair-39994
07/10/2023, 10:38 PMGetMetadata, access disabled to EC2 IMDS
, in my case I’m not creating EC2 resource 🙂 i’m trying to create elastic container repobillowy-army-68599
salmon-hair-39994
07/10/2023, 10:50 PMbillowy-army-68599
salmon-hair-39994
07/10/2023, 10:52 PMOPERATOR_ROLE_ARN
env to assign an AWS IAM rolebillowy-army-68599
salmon-hair-39994
07/10/2023, 11:12 PMsalmon-account-74572
07/10/2023, 11:16 PMsalmon-hair-39994
07/10/2023, 11:19 PMfew-pillow-1133
07/18/2023, 1:39 AMsalmon-hair-39994
07/18/2023, 4:04 AMSkipMetadataApiCheck: pulumi.BoolPtr(false),
in my code did fix the issue